19 |
|
|
20 |
#include "paramedit.h" |
#include "paramedit.h" |
21 |
|
|
|
bool update_gui; |
|
|
|
|
22 |
namespace { |
namespace { |
23 |
const char* const controlChangeTexts[] = { |
const char* const controlChangeTexts[] = { |
24 |
"none", "channelaftertouch", "velocity", |
"none", "channelaftertouch", "velocity", |
95 |
|
|
96 |
void NumEntryGain::value_changed() |
void NumEntryGain::value_changed() |
97 |
{ |
{ |
98 |
if (ptr && update_gui) { |
if (ptr) { |
99 |
*ptr = int32_t(spinbutton.get_value() * coeff); |
const double f = pow(10, spinbutton.get_digits()); |
100 |
|
int new_value = round_to_int(spinbutton.get_value() * f); |
101 |
|
|
102 |
|
if (new_value != round_to_int(*ptr / coeff * f)) |
103 |
|
{ |
104 |
|
*ptr = round_to_int(new_value / f * coeff); |
105 |
|
sig_changed(); |
106 |
|
} |
107 |
} |
} |
108 |
} |
} |
109 |
|
|
128 |
|
|
129 |
void BoolEntryPlus6::value_changed() |
void BoolEntryPlus6::value_changed() |
130 |
{ |
{ |
131 |
if (ptr && update_gui) { |
if (ptr) { |
132 |
bool plus6 = checkbutton.get_active(); |
bool plus6 = checkbutton.get_active(); |
133 |
if (plus6) { |
if (plus6) { |
134 |
eGain.set_value(0); |
eGain.set_value(0); |
135 |
*ptr = plus6value; |
*ptr = plus6value; |
136 |
|
sig_changed(); |
137 |
} else { |
} else { |
138 |
if (*ptr < 0) { |
if (*ptr < 0) { |
139 |
*ptr = 0; |
*ptr = 0; |
140 |
|
sig_changed(); |
141 |
} |
} |
142 |
} |
} |
143 |
eGain.set_sensitive(!plus6); |
eGain.set_sensitive(!plus6); |
161 |
|
|
162 |
void NumEntryPermille::value_changed() |
void NumEntryPermille::value_changed() |
163 |
{ |
{ |
164 |
if (ptr && update_gui) { |
if (ptr) { |
165 |
*ptr = uint16_t(spinbutton.get_value() * 10 + 0.5); |
uint16_t new_value = uint16_t(spinbutton.get_value() * 10 + 0.5); |
166 |
|
if (new_value != *ptr) { |
167 |
|
*ptr = uint16_t(spinbutton.get_value() * 10 + 0.5); |
168 |
|
sig_changed(); |
169 |
|
} |
170 |
} |
} |
171 |
} |
} |
172 |
|
|
215 |
// Convert the Adjustment position to text |
// Convert the Adjustment position to text |
216 |
bool NoteEntry::on_output() |
bool NoteEntry::on_output() |
217 |
{ |
{ |
218 |
int x = int(spinbutton.get_adjustment()->get_value()); |
int x = int(spinbutton.get_adjustment()->get_value() + 0.5); |
219 |
char buf[10]; |
char buf[10]; |
220 |
sprintf(buf, "%s%d", notes[x % 12], x / 12 - 1); |
sprintf(buf, "%s%d", notes[x % 12], x / 12 - 1); |
221 |
spinbutton.set_text(buf); |
spinbutton.set_text(buf); |
238 |
|
|
239 |
void ChoiceEntryLeverageCtrl::value_changed() |
void ChoiceEntryLeverageCtrl::value_changed() |
240 |
{ |
{ |
241 |
if (ptr && update_gui) { |
if (ptr) { |
242 |
int rowno = combobox.get_active_row_number(); |
int rowno = combobox.get_active_row_number(); |
243 |
switch (rowno) |
switch (rowno) |
244 |
{ |
{ |
267 |
} |
} |
268 |
break; |
break; |
269 |
} |
} |
270 |
|
if (rowno >= 0) sig_changed(); |
271 |
} |
} |
272 |
} |
} |
273 |
|
|
318 |
|
|
319 |
void BoolEntry::value_changed() |
void BoolEntry::value_changed() |
320 |
{ |
{ |
321 |
if (ptr && update_gui) { |
if (ptr) { |
322 |
*ptr = checkbutton.get_active(); |
*ptr = checkbutton.get_active(); |
323 |
|
sig_changed(); |
324 |
} |
} |
325 |
} |
} |
326 |
|
|
341 |
|
|
342 |
void StringEntry::value_changed() |
void StringEntry::value_changed() |
343 |
{ |
{ |
344 |
if (ptr && update_gui) { |
if (ptr) { |
345 |
*ptr = entry.get_text(); |
*ptr = entry.get_text(); |
346 |
|
sig_changed(); |
347 |
} |
} |
348 |
} |
} |
349 |
|
|