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) { |
const double f = pow(10, spinbutton.get_digits()); |
99 |
*ptr = int32_t(spinbutton.get_value() * coeff); |
int new_value = round_to_int(spinbutton.get_value() * f); |
100 |
|
if (ptr) { |
101 |
|
if (new_value != round_to_int(*ptr / coeff * f)) |
102 |
|
{ |
103 |
|
sig_to_be_changed.emit(); |
104 |
|
*ptr = round_to_int(new_value / f * coeff); |
105 |
|
sig_val_changed.emit(new_value); |
106 |
|
sig_changed.emit(); |
107 |
|
} |
108 |
|
} else { |
109 |
|
sig_to_be_changed.emit(); |
110 |
|
sig_val_changed.emit(new_value); |
111 |
|
sig_changed.emit(); |
112 |
} |
} |
113 |
} |
} |
114 |
|
|
124 |
|
|
125 |
BoolEntryPlus6::BoolEntryPlus6(const char* labelText, NumEntryGain& eGain, int32_t plus6value) : |
BoolEntryPlus6::BoolEntryPlus6(const char* labelText, NumEntryGain& eGain, int32_t plus6value) : |
126 |
LabelWidget(labelText, checkbutton), |
LabelWidget(labelText, checkbutton), |
127 |
|
checkbutton(labelText), |
128 |
eGain(eGain), |
eGain(eGain), |
129 |
plus6value(plus6value) |
plus6value(plus6value) |
130 |
{ |
{ |
134 |
|
|
135 |
void BoolEntryPlus6::value_changed() |
void BoolEntryPlus6::value_changed() |
136 |
{ |
{ |
137 |
if (ptr && update_gui) { |
if (ptr) { |
138 |
bool plus6 = checkbutton.get_active(); |
bool plus6 = checkbutton.get_active(); |
139 |
if (plus6) { |
if (plus6) { |
140 |
eGain.set_value(0); |
eGain.set_value(0); |
141 |
*ptr = plus6value; |
*ptr = plus6value; |
142 |
|
sig_changed(); |
143 |
} else { |
} else { |
144 |
if (*ptr < 0) { |
if (*ptr < 0) { |
145 |
*ptr = 0; |
*ptr = 0; |
146 |
|
sig_changed(); |
147 |
} |
} |
148 |
} |
} |
149 |
eGain.set_sensitive(!plus6); |
eGain.set_sensitive(!plus6); |
167 |
|
|
168 |
void NumEntryPermille::value_changed() |
void NumEntryPermille::value_changed() |
169 |
{ |
{ |
170 |
if (ptr && update_gui) { |
if (ptr) { |
171 |
*ptr = uint16_t(spinbutton.get_value() * 10 + 0.5); |
uint16_t new_value = uint16_t(spinbutton.get_value() * 10 + 0.5); |
172 |
|
if (new_value != *ptr) { |
173 |
|
*ptr = uint16_t(spinbutton.get_value() * 10 + 0.5); |
174 |
|
sig_changed(); |
175 |
|
} |
176 |
} |
} |
177 |
} |
} |
178 |
|
|
221 |
// Convert the Adjustment position to text |
// Convert the Adjustment position to text |
222 |
bool NoteEntry::on_output() |
bool NoteEntry::on_output() |
223 |
{ |
{ |
224 |
int x = int(spinbutton.get_adjustment()->get_value()); |
int x = int(spinbutton.get_adjustment()->get_value() + 0.5); |
225 |
char buf[10]; |
char buf[10]; |
226 |
sprintf(buf, "%s%d", notes[x % 12], x / 12 - 1); |
sprintf(buf, "%s%d", notes[x % 12], x / 12 - 1); |
227 |
spinbutton.set_text(buf); |
spinbutton.set_text(buf); |
244 |
|
|
245 |
void ChoiceEntryLeverageCtrl::value_changed() |
void ChoiceEntryLeverageCtrl::value_changed() |
246 |
{ |
{ |
247 |
if (ptr && update_gui) { |
if (ptr) { |
248 |
int rowno = combobox.get_active_row_number(); |
int rowno = combobox.get_active_row_number(); |
249 |
switch (rowno) |
switch (rowno) |
250 |
{ |
{ |
273 |
} |
} |
274 |
break; |
break; |
275 |
} |
} |
276 |
|
if (rowno >= 0) sig_changed(); |
277 |
} |
} |
278 |
} |
} |
279 |
|
|
324 |
|
|
325 |
void BoolEntry::value_changed() |
void BoolEntry::value_changed() |
326 |
{ |
{ |
327 |
if (ptr && update_gui) { |
if (ptr) { |
328 |
*ptr = checkbutton.get_active(); |
*ptr = checkbutton.get_active(); |
329 |
|
sig_changed(); |
330 |
} |
} |
331 |
} |
} |
332 |
|
|
347 |
|
|
348 |
void StringEntry::value_changed() |
void StringEntry::value_changed() |
349 |
{ |
{ |
350 |
if (ptr && update_gui) { |
if (ptr) { |
351 |
*ptr = entry.get_text(); |
*ptr = entry.get_text(); |
352 |
|
sig_changed(); |
353 |
} |
} |
354 |
} |
} |
355 |
|
|