-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainComponent.h
97 lines (74 loc) · 2.25 KB
/
MainComponent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
==============================================================================
This file was auto-generated!
==============================================================================
*/
#ifndef MAINCOMPONENT_H_INCLUDED
#define MAINCOMPONENT_H_INCLUDED
#include "../JuceLibraryCode/JuceHeader.h"
#include "AudioCallback.h"
#include <vector>
#include "loadfile.h"
#include "stempler.h"
#include <fftw3.h>
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class note {
public:
note(float* n_buf, long n_len, int n_chn, float n_speed);
float get_samp();
bool del_me;
private:
float* buffer;
long len;
int chn;
float read_p;
float speed;
};
class MainContentComponent : public Component, public ButtonListener, public SliderListener, private AudioCallback, public KeyListener
{
public:
//==============================================================================
MainContentComponent();
~MainContentComponent();
void paint (Graphics&);
void resized();
void buttonClicked(Button* button);
void sliderValueChanged(Slider* sider);
void load_button();
void fill_buffer(int bufsize);
void calc_tuning();
float* out_buf;
float* file_buf;
int file_fs;
long file_len;
int file_chn;
bool is_file_loaded;
float* file_mX;
float* file_pX;
std::vector<float> toonh;
bool is_calc_done;
tuning* ladder;
int key_count;
bool mirror_tuning;
float peak_tresh;
const char* backgroundtled_jpg;
int backgroundtled_jpgSize;
Image cachedImage_backgroundtled_jpg;
private:
//==============================================================================
void audioCallback(float** buffer, int channels, int frames);
bool keyPressed(const KeyPress &key, Component* origin);
std::vector<note> notes;
TextButton* load_but;
TextButton* calc_but;
std::vector<TextButton*> keyboard;
Slider* tn_sldr;
Slider* th_sldr;
void change_keyboard(int keys);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent)
};
#endif // MAINCOMPONENT_H_INCLUDED