forked from thunderox/triceratops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lfo_gui.cpp
executable file
·152 lines (119 loc) · 4.01 KB
/
lfo_gui.cpp
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#include "lfo_gui.h"
//-------------------------------------------------------------------
lfo_gui::lfo_gui (int port_number,string top_colour, string bottom_colour)
{
tab = new Gtk::HBox();
gui_retrig = new toggle();
gui_retrig->top_colour.set(top_colour);
gui_retrig->bottom_colour.set(bottom_colour);
gui_retrig->set_label("RETRIG");
gui_retrig->port_number = port_number;
gui_retrig->pos_mode = 1;
++port_number;
gui_speed = new knob();
gui_speed ->top_colour.set(top_colour);
gui_speed ->bottom_colour.set(bottom_colour);
gui_speed->set_min(1);
gui_speed->set_max(600);
gui_speed->set_value(120);
gui_speed->set_snap(true);
gui_speed->set_label("SPEED");
gui_speed->pos_mode = 2;
gui_speed->scroll_wheel_speed = 1;
gui_speed->port_number = port_number;
++port_number;
gui_wave = new wave_widget();
gui_wave->top_colour.set(top_colour);
gui_wave->bottom_colour.set(bottom_colour);
gui_wave->set_label("WAVE");
gui_wave->set_lfo_mode(true);
gui_wave->port_number = port_number;
++port_number;
gui_dco1_pitch = new fader();
gui_dco1_pitch->top_colour.set(top_colour);
gui_dco1_pitch->bottom_colour.set(bottom_colour);
gui_dco1_pitch->set_label("DCO1");
gui_dco1_pitch->port_number = port_number;
++port_number;
gui_dco2_pitch = new fader();
gui_dco2_pitch->top_colour.set(top_colour);
gui_dco2_pitch->bottom_colour.set(bottom_colour);
gui_dco2_pitch->set_label("DCO2");
gui_dco2_pitch->port_number = port_number;
++port_number;
gui_dco3_pitch = new fader();
gui_dco3_pitch->top_colour.set(top_colour);
gui_dco3_pitch->bottom_colour.set(bottom_colour);
gui_dco3_pitch->set_label("DCO3");
gui_dco3_pitch->port_number = port_number;
++port_number;
gui_cutoff = new fader();
gui_cutoff->top_colour.set(top_colour);
gui_cutoff->bottom_colour.set(bottom_colour);
gui_cutoff->set_label("CUTOFF");
gui_cutoff->set_min(0);
gui_cutoff->set_max(0.25);
gui_cutoff->set_value(0);
gui_cutoff->scroll_wheel_speed = 0.01;
gui_cutoff->port_number = port_number;
++port_number;
gui_route1 = new fader();
gui_route1->top_colour.set(top_colour);
gui_route1->bottom_colour.set(bottom_colour);
gui_route1->set_label("ROUTE 1");
gui_route1->port_number = port_number;
++port_number;
gui_route1->route_port_number = port_number;
++port_number;
gui_route2 = new fader();
gui_route2->top_colour.set(top_colour);
gui_route2->bottom_colour.set(bottom_colour);
gui_route2->set_label("ROUTE 2");
gui_route2->port_number = port_number;
++port_number;
gui_route2->route_port_number = port_number;
++port_number;
Gtk::VBox* vbox1 = new Gtk::VBox();
vbox1->add(*gui_retrig);
vbox1->add(*gui_speed);
tab->add(*vbox1);
tab->add(*gui_wave);
spacer* spacer1 = new spacer();
spacer1->top_colour.set(top_colour);
spacer1->bottom_colour.set(bottom_colour);
spacer1->set_size_request(40,70);
spacer1->pos_mode = 0;
tab->add(*gui_dco1_pitch);
tab->add(*gui_dco2_pitch);
tab->add(*gui_dco3_pitch);
tab->add(*spacer1);
tab->add(*gui_cutoff);
tab->add(*gui_route1);
tab->add(*gui_route2);
}
//-------------------------------------------------------------------
lfo_gui::~lfo_gui()
{
}
//-------------------------------------------------------------------
void lfo_gui::set_controller(LV2UI_Controller controller, LV2UI_Write_Function write_function)
{
gui_retrig->controller = controller;
gui_retrig->write_function = write_function;
gui_speed->controller = controller;
gui_speed->write_function = write_function;
gui_dco1_pitch->controller = controller;
gui_dco1_pitch->write_function = write_function;
gui_dco2_pitch->controller = controller;
gui_dco2_pitch->write_function = write_function;
gui_dco3_pitch->controller = controller;
gui_dco3_pitch->write_function = write_function;
gui_cutoff->controller = controller;
gui_cutoff->write_function = write_function;
gui_route1->controller = controller;
gui_route1->write_function = write_function;
gui_route2->controller = controller;
gui_route2->write_function = write_function;
gui_wave->controller = controller;
gui_wave->write_function = write_function;
}