1 |
/* |
2 |
* Copyright (C) 2006-2019 Andreas Persson |
3 |
* |
4 |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
6 |
* published by the Free Software Foundation; either version 2, or (at |
7 |
* your option) any later version. |
8 |
* |
9 |
* This program is distributed in the hope that it will be useful, but |
10 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
* General Public License for more details. |
13 |
* |
14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with program; see the file COPYING. If not, write to the Free |
16 |
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
17 |
* 02110-1301 USA. |
18 |
*/ |
19 |
|
20 |
#include "global.h" |
21 |
#include "dimregionedit.h" |
22 |
|
23 |
#include "compat.h" |
24 |
|
25 |
#if USE_GTKMM_GRID |
26 |
# include <gtkmm/grid.h> |
27 |
#else |
28 |
# include <gtkmm/table.h> |
29 |
#endif |
30 |
|
31 |
#include "Settings.h" |
32 |
|
33 |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
34 |
getter(getter), dimreg(0) { |
35 |
set_size_request(80, 80); |
36 |
} |
37 |
|
38 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
39 |
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
40 |
const Cairo::RefPtr<Cairo::Context>& cr = |
41 |
get_window()->create_cairo_context(); |
42 |
#else |
43 |
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
44 |
#endif |
45 |
if (dimreg) { |
46 |
int w = get_width(); |
47 |
int h = get_height(); |
48 |
|
49 |
for (int pass = 0 ; pass < 2 ; pass++) { |
50 |
for (double x = 0 ; x <= w ; x++) { |
51 |
int vel = int(x * (127 - 1e-10) / w + 1); |
52 |
double y = (1 - (dimreg->*getter)(vel)) * (h - 3) + 1.5; |
53 |
|
54 |
if (x < 1e-10) { |
55 |
cr->move_to(x, y); |
56 |
} else { |
57 |
cr->line_to(x, y); |
58 |
} |
59 |
} |
60 |
if (pass == 0) { |
61 |
cr->line_to(w, h); |
62 |
cr->line_to(0, h); |
63 |
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 0.2 : 0.1); |
64 |
cr->fill(); |
65 |
} else { |
66 |
cr->set_line_width(3); |
67 |
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 1.0 : 0.3); |
68 |
cr->stroke(); |
69 |
} |
70 |
} |
71 |
} |
72 |
return true; |
73 |
} |
74 |
|
75 |
|
76 |
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
77 |
set_size_request(500, 100); |
78 |
} |
79 |
|
80 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
81 |
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
82 |
const Cairo::RefPtr<Cairo::Context>& cr = |
83 |
get_window()->create_cairo_context(); |
84 |
#else |
85 |
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
86 |
#endif |
87 |
if (dimreg) { |
88 |
cr->translate(1.5, 0); |
89 |
|
90 |
// first, draw curves for the other layers |
91 |
gig::Region* region = dimreg->GetParent(); |
92 |
int dimregno; |
93 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
94 |
if (region->pDimensionRegions[dimregno] == dimreg) { |
95 |
break; |
96 |
} |
97 |
} |
98 |
int bitcount = 0; |
99 |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
100 |
if (region->pDimensionDefinitions[dim].dimension == |
101 |
gig::dimension_layer) { |
102 |
int mask = |
103 |
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
104 |
bitcount); |
105 |
int c = dimregno & mask; // mask away the layer dimension |
106 |
|
107 |
for (int i = 0 ; i < region->pDimensionDefinitions[dim].zones ; |
108 |
i++) { |
109 |
gig::DimensionRegion* d = |
110 |
region->pDimensionRegions[c + (i << bitcount)]; |
111 |
if (d != dimreg) { |
112 |
draw_one_curve(cr, d, false); |
113 |
} |
114 |
} |
115 |
break; |
116 |
} |
117 |
bitcount += region->pDimensionDefinitions[dim].bits; |
118 |
} |
119 |
|
120 |
// then, draw the currently selected layer |
121 |
draw_one_curve(cr, dimreg, is_sensitive()); |
122 |
} |
123 |
return true; |
124 |
} |
125 |
|
126 |
void CrossfadeCurve::draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr, |
127 |
const gig::DimensionRegion* d, |
128 |
bool sensitive) { |
129 |
int w = get_width(); |
130 |
int h = get_height(); |
131 |
|
132 |
if (d->Crossfade.out_end) { |
133 |
for (int pass = 0 ; pass < 2 ; pass++) { |
134 |
cr->move_to(d->Crossfade.in_start / 127.0 * (w - 3), h); |
135 |
cr->line_to(d->Crossfade.in_end / 127.0 * (w - 3), 1.5); |
136 |
cr->line_to(d->Crossfade.out_start / 127.0 * (w - 3), 1.5); |
137 |
cr->line_to(d->Crossfade.out_end / 127.0 * (w - 3), h); |
138 |
|
139 |
if (pass == 0) { |
140 |
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 0.2 : 0.1); |
141 |
cr->fill(); |
142 |
} else { |
143 |
cr->set_line_width(3); |
144 |
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 1.0 : 0.3); |
145 |
cr->stroke(); |
146 |
} |
147 |
} |
148 |
} |
149 |
} |
150 |
|
151 |
|
152 |
LFOGraph::LFOGraph() : dimreg(0) { |
153 |
set_size_request(500, 100); |
154 |
} |
155 |
|
156 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
157 |
bool LFOGraph::on_expose_event(GdkEventExpose* e) { |
158 |
const Cairo::RefPtr<Cairo::Context>& cr = |
159 |
get_window()->create_cairo_context(); |
160 |
#else |
161 |
bool LFOGraph::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
162 |
#endif |
163 |
if (dimreg) { |
164 |
const int w = get_width(); |
165 |
const int h = get_height(); |
166 |
const bool sensitive = is_sensitive(); |
167 |
const bool signedRange = this->signedRange(); |
168 |
const float visiblePeriods = 5.f; // such that minimum LFO frequency 0.1 Hz draws exactly a half period |
169 |
|
170 |
// short-hand functions for setting colors |
171 |
auto setGrayColor = [&] { |
172 |
cr->set_source_rgba(0.88, 0.88, 0.88, sensitive ? 1.0 : 0.3); |
173 |
}; |
174 |
auto setBlackColor = [&] { |
175 |
cr->set_source_rgba(0, 0, 0, sensitive ? 1.0 : 0.3); |
176 |
}; |
177 |
auto setGreenColor = [&] { |
178 |
cr->set_source_rgba(94/255.f, 219/255.f, 80/255.f, sensitive ? 1.0 : 0.3); |
179 |
}; |
180 |
auto setRedColor = [&] { |
181 |
cr->set_source_rgba(255.f, 44/255.f, 44/255.f, sensitive ? 1.0 : 0.3); |
182 |
}; |
183 |
/*auto setBlueColor = [&] { |
184 |
cr->set_source_rgba(53/255.f, 167/255.f, 255.f, sensitive ? 1.0 : 0.3); |
185 |
};*/ |
186 |
auto setOrangeColor = [&] { |
187 |
cr->set_source_rgba(255.f, 177/255.f, 82/255.f, sensitive ? 1.0 : 0.3); |
188 |
}; |
189 |
auto setWhiteColor = [&] { |
190 |
cr->set_source_rgba(255.f, 255.f, 255.f, sensitive ? 1.0 : 0.3); |
191 |
}; |
192 |
|
193 |
// fill background white |
194 |
cr->rectangle(0, 0, w, h); |
195 |
setWhiteColor(); |
196 |
cr->fill(); |
197 |
|
198 |
// draw horizontal center line (dashed gray) if LFO range is signed |
199 |
if (signedRange) { |
200 |
cr->move_to(0, h/2); |
201 |
cr->line_to(w, h/2); |
202 |
cr->set_line_width(2); |
203 |
setGrayColor(); |
204 |
cr->set_dash(std::vector<double>{ 7, 5 }, 0 /*offset*/); |
205 |
cr->stroke(); |
206 |
} |
207 |
|
208 |
// draw a vertical line for each second |
209 |
for (int period = 1; period < visiblePeriods; ++period) { |
210 |
int x = float(w) / float(visiblePeriods) * period; |
211 |
cr->move_to(x, 0); |
212 |
cr->line_to(x, h); |
213 |
cr->set_line_width(2); |
214 |
setGrayColor(); |
215 |
cr->set_dash(std::vector<double>{ 5, 3 }, 0 /*offset*/); |
216 |
cr->stroke(); |
217 |
} |
218 |
|
219 |
// how many curves shall we draw, two or one? |
220 |
const int runs = (hasControllerAssigned()) ? 2 : 1; |
221 |
// only draw the two curves in dashed style if they're very close to each other |
222 |
const bool dashedCurves = (runs == 2 && controllerDepth() < 63); |
223 |
// draw the required amount of curves |
224 |
for (int run = 0; run < runs; ++run) { |
225 |
// setup the LFO generator with the relevant parameters |
226 |
lfo.setup({ |
227 |
.waveType = waveType(), |
228 |
.rangeType = (signedRange) ? LinuxSampler::LFO::range_signed : LinuxSampler::LFO::range_unsigned, |
229 |
.frequency = frequency(), |
230 |
.phase = phase(), |
231 |
.startLevel = startLevel(), |
232 |
.internalDepth = internalDepth(), |
233 |
.midiControllerDepth = controllerDepth(), |
234 |
.flipPolarity = flipPolarity(), |
235 |
.samplerate = w / visiblePeriods, |
236 |
.maxValue = (signedRange) ? h/2 : h, |
237 |
}); |
238 |
// 1st curve reflects min. CC value, 2nd curve max. CC value |
239 |
lfo.setMIDICtrlValue( (run == 0) ? 0 : 127 ); |
240 |
|
241 |
// the actual render/draw loop |
242 |
for (int x = 0; x < w ; ++x) { |
243 |
const float y = |
244 |
(signedRange) ? |
245 |
h/2 - lfo.render() : |
246 |
h - lfo.render(); |
247 |
if (x == 0) |
248 |
cr->move_to(x, y); |
249 |
else |
250 |
cr->line_to(x, y); |
251 |
} |
252 |
cr->set_line_width( (frequency() <= 4.f) ? 2 : 1 ); |
253 |
if (runs == 1) |
254 |
setOrangeColor(); |
255 |
else if (run == 0) |
256 |
setGreenColor(); |
257 |
else |
258 |
setRedColor(); |
259 |
if (dashedCurves) |
260 |
cr->set_dash(std::vector<double>{ 3, 3 }, (run == 0) ? 0 : 3 /*offset*/); |
261 |
else |
262 |
cr->set_dash(std::vector<double>(), 0 /*offset*/); |
263 |
cr->stroke(); |
264 |
} |
265 |
|
266 |
// draw text legend |
267 |
if (runs == 2) { |
268 |
setRedColor(); |
269 |
cr->move_to(2, 10); |
270 |
cr->show_text("CC Max."); |
271 |
|
272 |
setGreenColor(); |
273 |
cr->move_to(2, 23); |
274 |
cr->show_text("CC Min."); |
275 |
} else { // no controller assigned, internal depth only ... |
276 |
setOrangeColor(); |
277 |
cr->move_to(2, 10); |
278 |
cr->show_text("Const. Depth"); |
279 |
} |
280 |
// draw text legend for each second ("1s", "2s", ...) |
281 |
for (int period = 1; period < visiblePeriods; ++period) { |
282 |
int x = float(w) / float(visiblePeriods) * period; |
283 |
setBlackColor(); |
284 |
cr->move_to(x - 13, h - 3); |
285 |
cr->show_text(ToString(period) + "s"); |
286 |
} |
287 |
} |
288 |
return true; |
289 |
} |
290 |
|
291 |
|
292 |
EGStateOptions::EGStateOptions() : HBox(), |
293 |
label(_("May be cancelled: ")), |
294 |
checkBoxAttack(_("Attack")), |
295 |
checkBoxAttackHold(_("Attack Hold")), |
296 |
checkBoxDecay1(_("Decay 1")), |
297 |
checkBoxDecay2(_("Decay 2")), |
298 |
checkBoxRelease(_("Release")) |
299 |
{ |
300 |
set_spacing(6); |
301 |
|
302 |
pack_start(label); |
303 |
pack_start(checkBoxAttack, Gtk::PACK_SHRINK); |
304 |
pack_start(checkBoxAttackHold, Gtk::PACK_SHRINK); |
305 |
pack_start(checkBoxDecay1, Gtk::PACK_SHRINK); |
306 |
pack_start(checkBoxDecay2, Gtk::PACK_SHRINK); |
307 |
pack_start(checkBoxRelease, Gtk::PACK_SHRINK); |
308 |
|
309 |
checkBoxAttack.set_tooltip_text(_( |
310 |
"If checked: a note-off aborts the 'attack' stage." |
311 |
)); |
312 |
checkBoxAttackHold.set_tooltip_text(_( |
313 |
"If checked: a note-off aborts the 'attack hold' stage." |
314 |
)); |
315 |
checkBoxDecay1.set_tooltip_text(_( |
316 |
"If checked: a note-off aborts the 'decay 1' stage." |
317 |
)); |
318 |
checkBoxDecay2.set_tooltip_text(_( |
319 |
"If checked: a note-off aborts the 'decay 2' stage." |
320 |
)); |
321 |
checkBoxRelease.set_tooltip_text(_( |
322 |
"If checked: a note-on reverts back from the 'release' stage." |
323 |
)); |
324 |
} |
325 |
|
326 |
void EGStateOptions::on_show_tooltips_changed() { |
327 |
const bool b = Settings::singleton()->showTooltips; |
328 |
|
329 |
checkBoxAttack.set_has_tooltip(b); |
330 |
checkBoxAttackHold.set_has_tooltip(b); |
331 |
checkBoxDecay1.set_has_tooltip(b); |
332 |
checkBoxDecay2.set_has_tooltip(b); |
333 |
checkBoxRelease.set_has_tooltip(b); |
334 |
} |
335 |
|
336 |
|
337 |
DimRegionEdit::DimRegionEdit() : |
338 |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
339 |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
340 |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
341 |
eEG1PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
342 |
eEG1Attack(_("Attack Time (seconds)"), 0, 60, 3), |
343 |
eEG1Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
344 |
eEG1Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
345 |
eEG1InfiniteSustain(_("Infinite sustain")), |
346 |
eEG1Sustain(_("Sustain Level (%)"), 0, 100, 2), |
347 |
eEG1Release(_("Release Time (seconds)"), 0, 60, 3), |
348 |
eEG1Hold(_("Hold Attack Stage until Loop End")), |
349 |
eEG1Controller(_("Controller")), |
350 |
eEG1ControllerInvert(_("Controller invert")), |
351 |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
352 |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
353 |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
354 |
eLFO1Wave(_("Wave Form")), |
355 |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
356 |
eLFO1Phase(_("Phase"), 0.0, 360.0, 2), |
357 |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
358 |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
359 |
eLFO1Controller(_("Controller")), |
360 |
eLFO1FlipPhase(_("Flip phase")), |
361 |
eLFO1Sync(_("Sync")), |
362 |
eEG2PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
363 |
eEG2Attack(_("Attack Time (seconds)"), 0, 60, 3), |
364 |
eEG2Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
365 |
eEG2Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
366 |
eEG2InfiniteSustain(_("Infinite sustain")), |
367 |
eEG2Sustain(_("Sustain Level (%)"), 0, 100, 2), |
368 |
eEG2Release(_("Release Time (seconds)"), 0, 60, 3), |
369 |
eEG2Controller(_("Controller")), |
370 |
eEG2ControllerInvert(_("Controller invert")), |
371 |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
372 |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
373 |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
374 |
eLFO2Wave(_("Wave Form")), |
375 |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
376 |
eLFO2Phase(_("Phase"), 0.0, 360.0, 2), |
377 |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
378 |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
379 |
eLFO2Controller(_("Controller")), |
380 |
eLFO2FlipPhase(_("Flip phase")), |
381 |
eLFO2Sync(_("Sync")), |
382 |
eEG3Attack(_("Attack"), 0, 10, 3), |
383 |
eEG3Depth(_("Depth"), -1200, 1200), |
384 |
eLFO3Wave(_("Wave Form")), |
385 |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
386 |
eLFO3Phase(_("Phase"), 0.0, 360.0, 2), |
387 |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
388 |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
389 |
eLFO3Controller(_("Controller")), |
390 |
eLFO3FlipPhase(_("Flip phase")), |
391 |
eLFO3Sync(_("Sync")), |
392 |
eVCFEnabled(_("Enabled")), |
393 |
eVCFType(_("Type")), |
394 |
eVCFCutoffController(_("Cutoff controller")), |
395 |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
396 |
eVCFCutoff(_("Cutoff")), |
397 |
eVCFVelocityCurve(_("Velocity curve")), |
398 |
eVCFVelocityScale(_("Velocity scale")), |
399 |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
400 |
eVCFResonance(_("Resonance")), |
401 |
eVCFResonanceDynamic(_("Resonance dynamic")), |
402 |
eVCFResonanceController(_("Resonance controller")), |
403 |
eVCFKeyboardTracking(_("Keyboard tracking")), |
404 |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
405 |
eVelocityResponseCurve(_("Velocity response curve")), |
406 |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
407 |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
408 |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
409 |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
410 |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
411 |
eCrossfade_in_start(_("Crossfade-in start")), |
412 |
eCrossfade_in_end(_("Crossfade-in end")), |
413 |
eCrossfade_out_start(_("Crossfade-out start")), |
414 |
eCrossfade_out_end(_("Crossfade-out end")), |
415 |
ePitchTrack(_("Pitch track")), |
416 |
eSustainReleaseTrigger(_("Sustain Release Trigger")), |
417 |
eNoNoteOffReleaseTrigger(_("No note-off release trigger")), |
418 |
eDimensionBypass(_("Dimension bypass")), |
419 |
ePan(_("Pan"), -64, 63), |
420 |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
421 |
eAttenuationController(_("Attenuation controller")), |
422 |
eInvertAttenuationController(_("Invert attenuation controller")), |
423 |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
424 |
eChannelOffset(_("Channel offset"), 0, 9), |
425 |
eSustainDefeat(_("Ignore Hold Pedal (a.k.a. \"Sustain defeat\")")), |
426 |
eMSDecode(_("Decode Mid/Side Recordings")), |
427 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
428 |
eUnityNote(_("Unity note")), |
429 |
eSampleGroup(_("Sample Group")), |
430 |
eSampleFormatInfo(_("Sample Format")), |
431 |
eSampleID("Sample ID"), |
432 |
eChecksum("Wave Data CRC-32"), |
433 |
eFineTune(_("Fine tune"), -49, 50), |
434 |
eGain(_("Gain (dB)"), -96, +96, 2, -655360), |
435 |
eSampleLoopEnabled(_("Enabled")), |
436 |
eSampleLoopStart(_("Loop start position")), |
437 |
eSampleLoopLength(_("Loop size")), |
438 |
eSampleLoopType(_("Loop type")), |
439 |
eSampleLoopInfinite(_("Infinite loop")), |
440 |
eSampleLoopPlayCount(_("Playback count"), 1), |
441 |
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
442 |
update_model(0) |
443 |
{ |
444 |
// make synthesis parameter page tabs scrollable |
445 |
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
446 |
set_scrollable(); |
447 |
|
448 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
449 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
450 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
451 |
connect(eEG1Decay2, &gig::DimensionRegion::EG1Decay2); |
452 |
connect(eEG1InfiniteSustain, &gig::DimensionRegion::EG1InfiniteSustain); |
453 |
connect(eEG1Sustain, &gig::DimensionRegion::EG1Sustain); |
454 |
connect(eEG1Release, &gig::DimensionRegion::EG1Release); |
455 |
connect(eEG1Hold, &gig::DimensionRegion::EG1Hold); |
456 |
connect(eEG1Controller, &gig::DimensionRegion::EG1Controller); |
457 |
connect(eEG1ControllerInvert, &gig::DimensionRegion::EG1ControllerInvert); |
458 |
connect(eEG1ControllerAttackInfluence, |
459 |
&gig::DimensionRegion::EG1ControllerAttackInfluence); |
460 |
connect(eEG1ControllerDecayInfluence, |
461 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
462 |
connect(eEG1ControllerReleaseInfluence, |
463 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
464 |
connect(eEG1StateOptions.checkBoxAttack, &gig::DimensionRegion::EG1Options, |
465 |
&gig::eg_opt_t::AttackCancel); |
466 |
connect(eEG1StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG1Options, |
467 |
&gig::eg_opt_t::AttackHoldCancel); |
468 |
connect(eEG1StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG1Options, |
469 |
&gig::eg_opt_t::Decay1Cancel); |
470 |
connect(eEG1StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG1Options, |
471 |
&gig::eg_opt_t::Decay2Cancel); |
472 |
connect(eEG1StateOptions.checkBoxRelease, &gig::DimensionRegion::EG1Options, |
473 |
&gig::eg_opt_t::ReleaseCancel); |
474 |
connect(eLFO1Wave, &gig::DimensionRegion::LFO1WaveForm); |
475 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
476 |
connect(eLFO1Phase, &gig::DimensionRegion::LFO1Phase); |
477 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
478 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
479 |
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
480 |
connect(eLFO1FlipPhase, &gig::DimensionRegion::LFO1FlipPhase); |
481 |
connect(eLFO1Sync, &gig::DimensionRegion::LFO1Sync); |
482 |
connect(eEG2PreAttack, &gig::DimensionRegion::EG2PreAttack); |
483 |
connect(eEG2Attack, &gig::DimensionRegion::EG2Attack); |
484 |
connect(eEG2Decay1, &gig::DimensionRegion::EG2Decay1); |
485 |
connect(eEG2Decay2, &gig::DimensionRegion::EG2Decay2); |
486 |
connect(eEG2InfiniteSustain, &gig::DimensionRegion::EG2InfiniteSustain); |
487 |
connect(eEG2Sustain, &gig::DimensionRegion::EG2Sustain); |
488 |
connect(eEG2Release, &gig::DimensionRegion::EG2Release); |
489 |
connect(eEG2Controller, &gig::DimensionRegion::EG2Controller); |
490 |
connect(eEG2ControllerInvert, &gig::DimensionRegion::EG2ControllerInvert); |
491 |
connect(eEG2ControllerAttackInfluence, |
492 |
&gig::DimensionRegion::EG2ControllerAttackInfluence); |
493 |
connect(eEG2ControllerDecayInfluence, |
494 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
495 |
connect(eEG2ControllerReleaseInfluence, |
496 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
497 |
connect(eEG2StateOptions.checkBoxAttack, &gig::DimensionRegion::EG2Options, |
498 |
&gig::eg_opt_t::AttackCancel); |
499 |
connect(eEG2StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG2Options, |
500 |
&gig::eg_opt_t::AttackHoldCancel); |
501 |
connect(eEG2StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG2Options, |
502 |
&gig::eg_opt_t::Decay1Cancel); |
503 |
connect(eEG2StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG2Options, |
504 |
&gig::eg_opt_t::Decay2Cancel); |
505 |
connect(eEG2StateOptions.checkBoxRelease, &gig::DimensionRegion::EG2Options, |
506 |
&gig::eg_opt_t::ReleaseCancel); |
507 |
connect(eLFO2Wave, &gig::DimensionRegion::LFO2WaveForm); |
508 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
509 |
connect(eLFO2Phase, &gig::DimensionRegion::LFO2Phase); |
510 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
511 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
512 |
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
513 |
connect(eLFO2FlipPhase, &gig::DimensionRegion::LFO2FlipPhase); |
514 |
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
515 |
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
516 |
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
517 |
connect(eLFO3Wave, &gig::DimensionRegion::LFO3WaveForm); |
518 |
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
519 |
connect(eLFO3Phase, &gig::DimensionRegion::LFO3Phase); |
520 |
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
521 |
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
522 |
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
523 |
connect(eLFO3FlipPhase, &gig::DimensionRegion::LFO3FlipPhase); |
524 |
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
525 |
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
526 |
connect(eVCFType, &gig::DimensionRegion::VCFType); |
527 |
connect(eVCFCutoffController, |
528 |
&gig::DimensionRegion::SetVCFCutoffController); |
529 |
connect(eVCFCutoffControllerInvert, |
530 |
&gig::DimensionRegion::VCFCutoffControllerInvert); |
531 |
connect(eVCFCutoff, &gig::DimensionRegion::VCFCutoff); |
532 |
connect(eVCFVelocityCurve, &gig::DimensionRegion::SetVCFVelocityCurve); |
533 |
connect(eVCFVelocityScale, &gig::DimensionRegion::SetVCFVelocityScale); |
534 |
connect(eVCFVelocityDynamicRange, |
535 |
&gig::DimensionRegion::SetVCFVelocityDynamicRange); |
536 |
connect(eVCFResonance, &gig::DimensionRegion::VCFResonance); |
537 |
connect(eVCFResonanceDynamic, &gig::DimensionRegion::VCFResonanceDynamic); |
538 |
connect(eVCFResonanceController, |
539 |
&gig::DimensionRegion::VCFResonanceController); |
540 |
connect(eVCFKeyboardTracking, &gig::DimensionRegion::VCFKeyboardTracking); |
541 |
connect(eVCFKeyboardTrackingBreakpoint, |
542 |
&gig::DimensionRegion::VCFKeyboardTrackingBreakpoint); |
543 |
connect(eVelocityResponseCurve, |
544 |
&gig::DimensionRegion::SetVelocityResponseCurve); |
545 |
connect(eVelocityResponseDepth, |
546 |
&gig::DimensionRegion::SetVelocityResponseDepth); |
547 |
connect(eVelocityResponseCurveScaling, |
548 |
&gig::DimensionRegion::SetVelocityResponseCurveScaling); |
549 |
connect(eReleaseVelocityResponseCurve, |
550 |
&gig::DimensionRegion::SetReleaseVelocityResponseCurve); |
551 |
connect(eReleaseVelocityResponseDepth, |
552 |
&gig::DimensionRegion::SetReleaseVelocityResponseDepth); |
553 |
connect(eReleaseTriggerDecay, &gig::DimensionRegion::ReleaseTriggerDecay); |
554 |
connect(eCrossfade_in_start, &DimRegionEdit::set_Crossfade_in_start); |
555 |
connect(eCrossfade_in_end, &DimRegionEdit::set_Crossfade_in_end); |
556 |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
557 |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
558 |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
559 |
connect(eSustainReleaseTrigger, &gig::DimensionRegion::SustainReleaseTrigger); |
560 |
connect(eNoNoteOffReleaseTrigger, &gig::DimensionRegion::NoNoteOffReleaseTrigger); |
561 |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
562 |
connect(ePan, &gig::DimensionRegion::Pan); |
563 |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
564 |
connect(eAttenuationController, |
565 |
&gig::DimensionRegion::AttenuationController); |
566 |
connect(eInvertAttenuationController, |
567 |
&gig::DimensionRegion::InvertAttenuationController); |
568 |
connect(eAttenuationControllerThreshold, |
569 |
&gig::DimensionRegion::AttenuationControllerThreshold); |
570 |
connect(eChannelOffset, &gig::DimensionRegion::ChannelOffset); |
571 |
connect(eSustainDefeat, &gig::DimensionRegion::SustainDefeat); |
572 |
connect(eMSDecode, &gig::DimensionRegion::MSDecode); |
573 |
connect(eSampleStartOffset, &gig::DimensionRegion::SampleStartOffset); |
574 |
connect(eUnityNote, &DimRegionEdit::set_UnityNote); |
575 |
connect(eFineTune, &DimRegionEdit::set_FineTune); |
576 |
connect(eGain, &DimRegionEdit::set_Gain); |
577 |
connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled); |
578 |
connect(eSampleLoopType, &DimRegionEdit::set_LoopType); |
579 |
connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart); |
580 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
581 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
582 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
583 |
buttonSelectSample.signal_clicked().connect( |
584 |
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
585 |
); |
586 |
|
587 |
for (int i = 0 ; i < 9 ; i++) { |
588 |
#if USE_GTKMM_GRID |
589 |
table[i] = new Gtk::Grid; |
590 |
table[i]->set_column_spacing(7); |
591 |
#else |
592 |
table[i] = new Gtk::Table(3, 1); |
593 |
table[i]->set_col_spacings(7); |
594 |
#endif |
595 |
|
596 |
// on Gtk 3 there is absolutely no margin by default |
597 |
#if GTKMM_MAJOR_VERSION >= 3 |
598 |
# if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12 |
599 |
table[i]->set_margin_left(12); |
600 |
table[i]->set_margin_right(12); |
601 |
# else |
602 |
table[i]->set_margin_start(12); |
603 |
table[i]->set_margin_end(12); |
604 |
# endif |
605 |
#endif |
606 |
} |
607 |
|
608 |
// set tooltips |
609 |
eUnityNote.set_tip( |
610 |
_("Note this sample is associated with (a.k.a. 'root note')") |
611 |
); |
612 |
buttonSelectSample.set_tooltip_text( |
613 |
_("Selects the sample of this dimension region on the left hand side's sample tree view.") |
614 |
); |
615 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
616 |
ePan.set_tip(_("Stereo balance (left/right)")); |
617 |
eChannelOffset.set_tip( |
618 |
_("Output channel where the audio signal should be routed to (0 - 9)") |
619 |
); |
620 |
ePitchTrack.set_tip( |
621 |
_("If true: sample will be pitched according to the key position " |
622 |
"(this would be disabled for drums for example)") |
623 |
); |
624 |
eSampleLoopEnabled.set_tip(_("If enabled: repeats to playback the sample")); |
625 |
eSampleLoopStart.set_tip( |
626 |
_("Start position within the sample (in sample points) of the area to " |
627 |
"be looped") |
628 |
); |
629 |
eSampleLoopLength.set_tip( |
630 |
_("Duration (in sample points) of the area to be looped") |
631 |
); |
632 |
eSampleLoopType.set_tip( |
633 |
_("Direction in which the loop area in the sample should be played back") |
634 |
); |
635 |
eSampleLoopInfinite.set_tip( |
636 |
_("Whether the loop area should be played back forever\n" |
637 |
"Caution: this setting is stored on Sample side, thus is shared " |
638 |
"among all dimension regions that use this sample!") |
639 |
); |
640 |
eSampleLoopPlayCount.set_tip( |
641 |
_("How many times the loop area should be played back\n" |
642 |
"Caution: this setting is stored on Sample side, thus is shared " |
643 |
"among all dimension regions that use this sample!") |
644 |
); |
645 |
|
646 |
eEG1PreAttack.set_tip( |
647 |
"Very first level this EG starts with. It rises then in Attack Time " |
648 |
"seconds from this initial level to 100%." |
649 |
); |
650 |
eEG1Attack.set_tip( |
651 |
"Duration of the EG's Attack stage, which raises its level from " |
652 |
"Pre-Attack Level to 100%." |
653 |
); |
654 |
eEG1Hold.set_tip( |
655 |
"On looped sounds, enabling this will cause the Decay 1 stage not to " |
656 |
"enter before the loop has been passed one time." |
657 |
); |
658 |
eAttenuationController.set_tip(_( |
659 |
"If you are not using the 'Layer' dimension, then this controller " |
660 |
"simply alters the volume. If you are using the 'Layer' dimension, " |
661 |
"then this controller is controlling the crossfade between Layers in " |
662 |
"real-time." |
663 |
)); |
664 |
|
665 |
eLFO1Sync.set_tip( |
666 |
"If not checked, every voice will use its own LFO instance, which " |
667 |
"causes voices triggered at different points in time to have different " |
668 |
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
669 |
"share one single LFO, causing all voices to have the same LFO level, " |
670 |
"no matter when the individual notes have been triggered." |
671 |
); |
672 |
eLFO2Sync.set_tip( |
673 |
"If not checked, every voice will use its own LFO instance, which " |
674 |
"causes voices triggered at different points in time to have different " |
675 |
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
676 |
"share one single LFO, causing all voices to have the same LFO level, " |
677 |
"no matter when the individual notes have been triggered." |
678 |
); |
679 |
eLFO3Sync.set_tip( |
680 |
"If not checked, every voice will use its own LFO instance, which " |
681 |
"causes voices triggered at different points in time to have different " |
682 |
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
683 |
"share one single LFO, causing all voices to have the same LFO level, " |
684 |
"no matter when the individual notes have been triggered." |
685 |
); |
686 |
eLFO1FlipPhase.set_tip( |
687 |
"Inverts the LFO's generated wave vertically." |
688 |
); |
689 |
eLFO2FlipPhase.set_tip( |
690 |
"Inverts the LFO's generated wave vertically." |
691 |
); |
692 |
eLFO3FlipPhase.set_tip( |
693 |
"Inverts the LFO's generated wave vertically." |
694 |
); |
695 |
|
696 |
pageno = 0; |
697 |
rowno = 0; |
698 |
firstRowInBlock = 0; |
699 |
|
700 |
addHeader(_("Mandatory Settings")); |
701 |
addString(_("Sample"), lSample, wSample, buttonNullSampleReference); |
702 |
buttonNullSampleReference->set_label("X"); |
703 |
buttonNullSampleReference->set_tooltip_text(_("Remove current sample reference (NULL reference). This can be used to define a \"silent\" case where no sample shall be played.")); |
704 |
buttonNullSampleReference->signal_clicked().connect( |
705 |
sigc::mem_fun(*this, &DimRegionEdit::nullOutSampleReference) |
706 |
); |
707 |
//TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false); |
708 |
#ifdef OLD_TOOLTIPS |
709 |
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
710 |
#else |
711 |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
712 |
#endif |
713 |
addProp(eUnityNote); |
714 |
addProp(eSampleGroup); |
715 |
addProp(eSampleFormatInfo); |
716 |
addProp(eSampleID); |
717 |
addProp(eChecksum); |
718 |
addRightHandSide(buttonSelectSample); |
719 |
addHeader(_("Optional Settings")); |
720 |
addProp(eSampleStartOffset); |
721 |
addProp(eChannelOffset); |
722 |
addHeader(_("Loops")); |
723 |
addProp(eSampleLoopEnabled); |
724 |
addProp(eSampleLoopStart); |
725 |
addProp(eSampleLoopLength); |
726 |
{ |
727 |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
728 |
static const uint32_t values[] = { |
729 |
gig::loop_type_normal, |
730 |
gig::loop_type_bidirectional, |
731 |
gig::loop_type_backward |
732 |
}; |
733 |
eSampleLoopType.set_choices(choices, values); |
734 |
} |
735 |
addProp(eSampleLoopType); |
736 |
addProp(eSampleLoopInfinite); |
737 |
addProp(eSampleLoopPlayCount); |
738 |
|
739 |
nextPage(); |
740 |
|
741 |
addHeader(_("General Amplitude Settings")); |
742 |
addProp(eGain); |
743 |
addProp(ePan); |
744 |
addHeader(_("Amplitude Envelope (EG1)")); |
745 |
addProp(eEG1PreAttack); |
746 |
addProp(eEG1Attack); |
747 |
addProp(eEG1Hold); |
748 |
addProp(eEG1Decay1); |
749 |
addProp(eEG1Decay2); |
750 |
addProp(eEG1InfiniteSustain); |
751 |
addProp(eEG1Sustain); |
752 |
addProp(eEG1Release); |
753 |
addProp(eEG1Controller); |
754 |
addProp(eEG1ControllerInvert); |
755 |
addProp(eEG1ControllerAttackInfluence); |
756 |
addProp(eEG1ControllerDecayInfluence); |
757 |
addProp(eEG1ControllerReleaseInfluence); |
758 |
addLine(eEG1StateOptions); |
759 |
|
760 |
nextPage(); |
761 |
|
762 |
addHeader(_("Amplitude Oscillator (LFO1)")); |
763 |
addProp(eLFO1Wave); |
764 |
addProp(eLFO1Frequency); |
765 |
addProp(eLFO1Phase); |
766 |
addProp(eLFO1InternalDepth); |
767 |
addProp(eLFO1ControlDepth); |
768 |
{ |
769 |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
770 |
_("internal+modwheel"), _("internal+breath"), 0 }; |
771 |
static const gig::lfo1_ctrl_t values[] = { |
772 |
gig::lfo1_ctrl_internal, |
773 |
gig::lfo1_ctrl_modwheel, |
774 |
gig::lfo1_ctrl_breath, |
775 |
gig::lfo1_ctrl_internal_modwheel, |
776 |
gig::lfo1_ctrl_internal_breath |
777 |
}; |
778 |
eLFO1Controller.set_choices(choices, values); |
779 |
} |
780 |
addProp(eLFO1Controller); |
781 |
addProp(eLFO1FlipPhase); |
782 |
addProp(eLFO1Sync); |
783 |
{ |
784 |
Gtk::Frame* frame = new Gtk::Frame; |
785 |
frame->add(lfo1Graph); |
786 |
// on Gtk 3 there is no margin at all by default |
787 |
#if GTKMM_MAJOR_VERSION >= 3 |
788 |
frame->set_margin_top(12); |
789 |
frame->set_margin_bottom(12); |
790 |
#endif |
791 |
#if USE_GTKMM_GRID |
792 |
table[pageno]->attach(*frame, 1, rowno, 2); |
793 |
#else |
794 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
795 |
Gtk::SHRINK, Gtk::SHRINK); |
796 |
#endif |
797 |
rowno++; |
798 |
} |
799 |
eLFO1Wave.signal_value_changed().connect( |
800 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
801 |
); |
802 |
eLFO1Frequency.signal_value_changed().connect( |
803 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
804 |
); |
805 |
eLFO1Phase.signal_value_changed().connect( |
806 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
807 |
); |
808 |
eLFO1InternalDepth.signal_value_changed().connect( |
809 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
810 |
); |
811 |
eLFO1ControlDepth.signal_value_changed().connect( |
812 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
813 |
); |
814 |
eLFO1Controller.signal_value_changed().connect( |
815 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
816 |
); |
817 |
eLFO1FlipPhase.signal_value_changed().connect( |
818 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
819 |
); |
820 |
eLFO1Sync.signal_value_changed().connect( |
821 |
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
822 |
); |
823 |
|
824 |
nextPage(); |
825 |
|
826 |
addHeader(_("Crossfade")); |
827 |
addProp(eAttenuationController); |
828 |
addProp(eInvertAttenuationController); |
829 |
addProp(eAttenuationControllerThreshold); |
830 |
addProp(eCrossfade_in_start); |
831 |
addProp(eCrossfade_in_end); |
832 |
addProp(eCrossfade_out_start); |
833 |
addProp(eCrossfade_out_end); |
834 |
|
835 |
Gtk::Frame* frame = new Gtk::Frame; |
836 |
frame->add(crossfade_curve); |
837 |
// on Gtk 3 there is no margin at all by default |
838 |
#if GTKMM_MAJOR_VERSION >= 3 |
839 |
frame->set_margin_top(12); |
840 |
frame->set_margin_bottom(12); |
841 |
#endif |
842 |
#if USE_GTKMM_GRID |
843 |
table[pageno]->attach(*frame, 1, rowno, 2); |
844 |
#else |
845 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
846 |
Gtk::SHRINK, Gtk::SHRINK); |
847 |
#endif |
848 |
rowno++; |
849 |
|
850 |
eCrossfade_in_start.signal_value_changed().connect( |
851 |
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
852 |
eCrossfade_in_end.signal_value_changed().connect( |
853 |
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
854 |
eCrossfade_out_start.signal_value_changed().connect( |
855 |
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
856 |
eCrossfade_out_end.signal_value_changed().connect( |
857 |
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
858 |
|
859 |
nextPage(); |
860 |
|
861 |
addHeader(_("General Filter Settings")); |
862 |
addProp(eVCFEnabled); |
863 |
{ |
864 |
const char* choices[] = { |
865 |
_("lowpass"), _("lowpassturbo"), _("bandpass"), _("highpass"), |
866 |
_("bandreject"), |
867 |
_("lowpass 1-pole [EXT]"), |
868 |
_("lowpass 2-pole [EXT]"), |
869 |
_("lowpass 4-pole [EXT]"), |
870 |
_("lowpass 6-pole [EXT]"), |
871 |
_("highpass 1-pole [EXT]"), |
872 |
_("highpass 2-pole [EXT]"), |
873 |
_("highpass 4-pole [EXT]"), |
874 |
_("highpass 6-pole [EXT]"), |
875 |
_("bandpass 2-pole [EXT]"), |
876 |
_("bandreject 2-pole [EXT]"), |
877 |
NULL |
878 |
}; |
879 |
static const gig::vcf_type_t values[] = { |
880 |
// GigaStudio original filter types |
881 |
gig::vcf_type_lowpass, |
882 |
gig::vcf_type_lowpassturbo, |
883 |
gig::vcf_type_bandpass, |
884 |
gig::vcf_type_highpass, |
885 |
gig::vcf_type_bandreject, |
886 |
// LinuxSampler filter types (as gig format extension) |
887 |
gig::vcf_type_lowpass_1p, |
888 |
gig::vcf_type_lowpass_2p, |
889 |
gig::vcf_type_lowpass_4p, |
890 |
gig::vcf_type_lowpass_6p, |
891 |
gig::vcf_type_highpass_1p, |
892 |
gig::vcf_type_highpass_2p, |
893 |
gig::vcf_type_highpass_4p, |
894 |
gig::vcf_type_highpass_6p, |
895 |
gig::vcf_type_bandpass_2p, |
896 |
gig::vcf_type_bandreject_2p, |
897 |
}; |
898 |
eVCFType.set_choices(choices, values); |
899 |
} |
900 |
addProp(eVCFType); |
901 |
{ |
902 |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
903 |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
904 |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
905 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
906 |
gig::vcf_cutoff_ctrl_none, |
907 |
gig::vcf_cutoff_ctrl_none2, |
908 |
gig::vcf_cutoff_ctrl_modwheel, |
909 |
gig::vcf_cutoff_ctrl_effect1, |
910 |
gig::vcf_cutoff_ctrl_effect2, |
911 |
gig::vcf_cutoff_ctrl_breath, |
912 |
gig::vcf_cutoff_ctrl_foot, |
913 |
gig::vcf_cutoff_ctrl_sustainpedal, |
914 |
gig::vcf_cutoff_ctrl_softpedal, |
915 |
gig::vcf_cutoff_ctrl_genpurpose7, |
916 |
gig::vcf_cutoff_ctrl_genpurpose8, |
917 |
gig::vcf_cutoff_ctrl_aftertouch |
918 |
}; |
919 |
eVCFCutoffController.set_choices(choices, values); |
920 |
} |
921 |
addProp(eVCFCutoffController); |
922 |
addProp(eVCFCutoffControllerInvert); |
923 |
addProp(eVCFCutoff); |
924 |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
925 |
static const gig::curve_type_t curve_type_values[] = { |
926 |
gig::curve_type_nonlinear, |
927 |
gig::curve_type_linear, |
928 |
gig::curve_type_special |
929 |
}; |
930 |
eVCFVelocityCurve.set_choices(curve_type_texts, curve_type_values); |
931 |
addProp(eVCFVelocityCurve); |
932 |
addProp(eVCFVelocityScale); |
933 |
addProp(eVCFVelocityDynamicRange); |
934 |
|
935 |
eVCFCutoffController.signal_value_changed().connect( |
936 |
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
937 |
eVCFVelocityCurve.signal_value_changed().connect( |
938 |
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
939 |
eVCFVelocityScale.signal_value_changed().connect( |
940 |
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
941 |
eVCFVelocityDynamicRange.signal_value_changed().connect( |
942 |
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
943 |
|
944 |
frame = new Gtk::Frame; |
945 |
frame->add(cutoff_curve); |
946 |
// on Gtk 3 there is no margin at all by default |
947 |
#if GTKMM_MAJOR_VERSION >= 3 |
948 |
frame->set_margin_top(12); |
949 |
frame->set_margin_bottom(12); |
950 |
#endif |
951 |
#if USE_GTKMM_GRID |
952 |
table[pageno]->attach(*frame, 1, rowno, 2); |
953 |
#else |
954 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
955 |
Gtk::SHRINK, Gtk::SHRINK); |
956 |
#endif |
957 |
rowno++; |
958 |
|
959 |
addProp(eVCFResonance); |
960 |
addProp(eVCFResonanceDynamic); |
961 |
{ |
962 |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
963 |
_("genpurpose5"), _("genpurpose6"), 0 }; |
964 |
static const gig::vcf_res_ctrl_t values[] = { |
965 |
gig::vcf_res_ctrl_none, |
966 |
gig::vcf_res_ctrl_genpurpose3, |
967 |
gig::vcf_res_ctrl_genpurpose4, |
968 |
gig::vcf_res_ctrl_genpurpose5, |
969 |
gig::vcf_res_ctrl_genpurpose6 |
970 |
}; |
971 |
eVCFResonanceController.set_choices(choices, values); |
972 |
} |
973 |
addProp(eVCFResonanceController); |
974 |
addProp(eVCFKeyboardTracking); |
975 |
addProp(eVCFKeyboardTrackingBreakpoint); |
976 |
|
977 |
nextPage(); |
978 |
|
979 |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
980 |
addProp(eEG2PreAttack); |
981 |
addProp(eEG2Attack); |
982 |
addProp(eEG2Decay1); |
983 |
addProp(eEG2Decay2); |
984 |
addProp(eEG2InfiniteSustain); |
985 |
addProp(eEG2Sustain); |
986 |
addProp(eEG2Release); |
987 |
addProp(eEG2Controller); |
988 |
addProp(eEG2ControllerInvert); |
989 |
addProp(eEG2ControllerAttackInfluence); |
990 |
addProp(eEG2ControllerDecayInfluence); |
991 |
addProp(eEG2ControllerReleaseInfluence); |
992 |
addLine(eEG2StateOptions); |
993 |
|
994 |
nextPage(); |
995 |
|
996 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
997 |
addProp(eLFO2Wave); |
998 |
addProp(eLFO2Frequency); |
999 |
addProp(eLFO2Phase); |
1000 |
addProp(eLFO2InternalDepth); |
1001 |
addProp(eLFO2ControlDepth); |
1002 |
{ |
1003 |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
1004 |
_("internal+modwheel"), _("internal+foot"), 0 }; |
1005 |
static const gig::lfo2_ctrl_t values[] = { |
1006 |
gig::lfo2_ctrl_internal, |
1007 |
gig::lfo2_ctrl_modwheel, |
1008 |
gig::lfo2_ctrl_foot, |
1009 |
gig::lfo2_ctrl_internal_modwheel, |
1010 |
gig::lfo2_ctrl_internal_foot |
1011 |
}; |
1012 |
eLFO2Controller.set_choices(choices, values); |
1013 |
} |
1014 |
addProp(eLFO2Controller); |
1015 |
addProp(eLFO2FlipPhase); |
1016 |
addProp(eLFO2Sync); |
1017 |
{ |
1018 |
Gtk::Frame* frame = new Gtk::Frame; |
1019 |
frame->add(lfo2Graph); |
1020 |
// on Gtk 3 there is no margin at all by default |
1021 |
#if GTKMM_MAJOR_VERSION >= 3 |
1022 |
frame->set_margin_top(12); |
1023 |
frame->set_margin_bottom(12); |
1024 |
#endif |
1025 |
#if USE_GTKMM_GRID |
1026 |
table[pageno]->attach(*frame, 1, rowno, 2); |
1027 |
#else |
1028 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1029 |
Gtk::SHRINK, Gtk::SHRINK); |
1030 |
#endif |
1031 |
rowno++; |
1032 |
} |
1033 |
eLFO2Wave.signal_value_changed().connect( |
1034 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1035 |
); |
1036 |
eLFO2Frequency.signal_value_changed().connect( |
1037 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1038 |
); |
1039 |
eLFO2Phase.signal_value_changed().connect( |
1040 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1041 |
); |
1042 |
eLFO2InternalDepth.signal_value_changed().connect( |
1043 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1044 |
); |
1045 |
eLFO2ControlDepth.signal_value_changed().connect( |
1046 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1047 |
); |
1048 |
eLFO2Controller.signal_value_changed().connect( |
1049 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1050 |
); |
1051 |
eLFO2FlipPhase.signal_value_changed().connect( |
1052 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1053 |
); |
1054 |
eLFO2Sync.signal_value_changed().connect( |
1055 |
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
1056 |
); |
1057 |
|
1058 |
nextPage(); |
1059 |
|
1060 |
addHeader(_("General Pitch Settings")); |
1061 |
addProp(eFineTune); |
1062 |
addProp(ePitchTrack); |
1063 |
addHeader(_("Pitch Envelope (EG3)")); |
1064 |
addProp(eEG3Attack); |
1065 |
addProp(eEG3Depth); |
1066 |
addHeader(_("Pitch Oscillator (LFO3)")); |
1067 |
addProp(eLFO3Wave); |
1068 |
addProp(eLFO3Frequency); |
1069 |
addProp(eLFO3Phase); |
1070 |
addProp(eLFO3InternalDepth); |
1071 |
addProp(eLFO3ControlDepth); |
1072 |
{ |
1073 |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
1074 |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
1075 |
static const gig::lfo3_ctrl_t values[] = { |
1076 |
gig::lfo3_ctrl_internal, |
1077 |
gig::lfo3_ctrl_modwheel, |
1078 |
gig::lfo3_ctrl_aftertouch, |
1079 |
gig::lfo3_ctrl_internal_modwheel, |
1080 |
gig::lfo3_ctrl_internal_aftertouch |
1081 |
}; |
1082 |
eLFO3Controller.set_choices(choices, values); |
1083 |
} |
1084 |
addProp(eLFO3Controller); |
1085 |
addProp(eLFO3FlipPhase); |
1086 |
addProp(eLFO3Sync); |
1087 |
{ |
1088 |
Gtk::Frame* frame = new Gtk::Frame; |
1089 |
frame->add(lfo3Graph); |
1090 |
// on Gtk 3 there is no margin at all by default |
1091 |
#if GTKMM_MAJOR_VERSION >= 3 |
1092 |
frame->set_margin_top(12); |
1093 |
frame->set_margin_bottom(12); |
1094 |
#endif |
1095 |
#if USE_GTKMM_GRID |
1096 |
table[pageno]->attach(*frame, 1, rowno, 2); |
1097 |
#else |
1098 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1099 |
Gtk::SHRINK, Gtk::SHRINK); |
1100 |
#endif |
1101 |
rowno++; |
1102 |
} |
1103 |
eLFO3Wave.signal_value_changed().connect( |
1104 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1105 |
); |
1106 |
eLFO3Frequency.signal_value_changed().connect( |
1107 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1108 |
); |
1109 |
eLFO3Phase.signal_value_changed().connect( |
1110 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1111 |
); |
1112 |
eLFO3InternalDepth.signal_value_changed().connect( |
1113 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1114 |
); |
1115 |
eLFO3ControlDepth.signal_value_changed().connect( |
1116 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1117 |
); |
1118 |
eLFO3Controller.signal_value_changed().connect( |
1119 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1120 |
); |
1121 |
eLFO3FlipPhase.signal_value_changed().connect( |
1122 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1123 |
); |
1124 |
eLFO3Sync.signal_value_changed().connect( |
1125 |
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1126 |
); |
1127 |
|
1128 |
nextPage(); |
1129 |
|
1130 |
addHeader(_("Velocity Response")); |
1131 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
1132 |
addProp(eVelocityResponseCurve); |
1133 |
addProp(eVelocityResponseDepth); |
1134 |
addProp(eVelocityResponseCurveScaling); |
1135 |
|
1136 |
eVelocityResponseCurve.signal_value_changed().connect( |
1137 |
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
1138 |
eVelocityResponseDepth.signal_value_changed().connect( |
1139 |
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
1140 |
eVelocityResponseCurveScaling.signal_value_changed().connect( |
1141 |
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
1142 |
|
1143 |
frame = new Gtk::Frame; |
1144 |
frame->add(velocity_curve); |
1145 |
// on Gtk 3 there is no margin at all by default |
1146 |
#if GTKMM_MAJOR_VERSION >= 3 |
1147 |
frame->set_margin_top(12); |
1148 |
frame->set_margin_bottom(12); |
1149 |
#endif |
1150 |
#if USE_GTKMM_GRID |
1151 |
table[pageno]->attach(*frame, 1, rowno, 2); |
1152 |
#else |
1153 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1154 |
Gtk::SHRINK, Gtk::SHRINK); |
1155 |
#endif |
1156 |
rowno++; |
1157 |
|
1158 |
addHeader(_("Release Velocity Response")); |
1159 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
1160 |
curve_type_values); |
1161 |
addProp(eReleaseVelocityResponseCurve); |
1162 |
addProp(eReleaseVelocityResponseDepth); |
1163 |
|
1164 |
eReleaseVelocityResponseCurve.signal_value_changed().connect( |
1165 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
1166 |
eReleaseVelocityResponseDepth.signal_value_changed().connect( |
1167 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
1168 |
frame = new Gtk::Frame; |
1169 |
frame->add(release_curve); |
1170 |
// on Gtk 3 there is no margin at all by default |
1171 |
#if GTKMM_MAJOR_VERSION >= 3 |
1172 |
frame->set_margin_top(12); |
1173 |
frame->set_margin_bottom(12); |
1174 |
#endif |
1175 |
#if USE_GTKMM_GRID |
1176 |
table[pageno]->attach(*frame, 1, rowno, 2); |
1177 |
#else |
1178 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1179 |
Gtk::SHRINK, Gtk::SHRINK); |
1180 |
#endif |
1181 |
rowno++; |
1182 |
|
1183 |
addProp(eReleaseTriggerDecay); |
1184 |
{ |
1185 |
const char* choices[] = { _("off"), _("on (max. velocity)"), _("on (key velocity)"), 0 }; |
1186 |
static const gig::sust_rel_trg_t values[] = { |
1187 |
gig::sust_rel_trg_none, |
1188 |
gig::sust_rel_trg_maxvelocity, |
1189 |
gig::sust_rel_trg_keyvelocity |
1190 |
}; |
1191 |
eSustainReleaseTrigger.set_choices(choices, values); |
1192 |
} |
1193 |
eSustainReleaseTrigger.set_tip(_( |
1194 |
"By default release trigger samples are played on note-off events only. " |
1195 |
"This option allows to play release trigger sample on sustain pedal up " |
1196 |
"events as well. NOTE: This is a format extension!" |
1197 |
)); |
1198 |
addProp(eSustainReleaseTrigger); |
1199 |
{ |
1200 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
1201 |
static const gig::dim_bypass_ctrl_t values[] = { |
1202 |
gig::dim_bypass_ctrl_none, |
1203 |
gig::dim_bypass_ctrl_94, |
1204 |
gig::dim_bypass_ctrl_95 |
1205 |
}; |
1206 |
eDimensionBypass.set_choices(choices, values); |
1207 |
} |
1208 |
eNoNoteOffReleaseTrigger.set_tip(_( |
1209 |
"By default release trigger samples are played on note-off events only. " |
1210 |
"If this option is checked, then no release trigger sample is played " |
1211 |
"when releasing a note. NOTE: This is a format extension!" |
1212 |
)); |
1213 |
addProp(eNoNoteOffReleaseTrigger); |
1214 |
addProp(eDimensionBypass); |
1215 |
eSelfMask.widget.set_tooltip_text(_( |
1216 |
"If enabled: new notes with higher velocity value will stop older " |
1217 |
"notes with lower velocity values, that way you can save voices that " |
1218 |
"would barely be audible. This is also useful for certain drum sounds." |
1219 |
)); |
1220 |
addProp(eSelfMask); |
1221 |
eSustainDefeat.widget.set_tooltip_text(_( |
1222 |
"If enabled: sustain pedal will not hold a note. This way you can use " |
1223 |
"the sustain pedal for other purposes, for example to switch among " |
1224 |
"dimension regions." |
1225 |
)); |
1226 |
addProp(eSustainDefeat); |
1227 |
eMSDecode.widget.set_tooltip_text(_( |
1228 |
"Defines if Mid/Side Recordings should be decoded. Mid/Side Recordings " |
1229 |
"are an alternative way to record sounds in stereo. The sampler needs " |
1230 |
"to decode such samples to actually make use of them. Note: this " |
1231 |
"feature is currently not supported by LinuxSampler." |
1232 |
)); |
1233 |
addProp(eMSDecode); |
1234 |
|
1235 |
nextPage(); |
1236 |
|
1237 |
|
1238 |
eEG1InfiniteSustain.signal_value_changed().connect( |
1239 |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled)); |
1240 |
eEG2InfiniteSustain.signal_value_changed().connect( |
1241 |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled)); |
1242 |
eEG1Controller.signal_value_changed().connect( |
1243 |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed)); |
1244 |
eEG2Controller.signal_value_changed().connect( |
1245 |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed)); |
1246 |
eLFO1Controller.signal_value_changed().connect( |
1247 |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed)); |
1248 |
eLFO2Controller.signal_value_changed().connect( |
1249 |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed)); |
1250 |
eLFO3Controller.signal_value_changed().connect( |
1251 |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed)); |
1252 |
eAttenuationController.signal_value_changed().connect( |
1253 |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed)); |
1254 |
eVCFEnabled.signal_value_changed().connect( |
1255 |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled)); |
1256 |
eVCFCutoffController.signal_value_changed().connect( |
1257 |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed)); |
1258 |
eVCFResonanceController.signal_value_changed().connect( |
1259 |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed)); |
1260 |
|
1261 |
eCrossfade_in_start.signal_value_changed().connect( |
1262 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
1263 |
eCrossfade_in_end.signal_value_changed().connect( |
1264 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
1265 |
eCrossfade_out_start.signal_value_changed().connect( |
1266 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
1267 |
eCrossfade_out_end.signal_value_changed().connect( |
1268 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
1269 |
|
1270 |
eSampleLoopEnabled.signal_value_changed().connect( |
1271 |
sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements)); |
1272 |
eSampleLoopStart.signal_value_changed().connect( |
1273 |
sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed)); |
1274 |
eSampleLoopLength.signal_value_changed().connect( |
1275 |
sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed)); |
1276 |
eSampleLoopInfinite.signal_value_changed().connect( |
1277 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
1278 |
|
1279 |
append_page(*table[0], _("Sample")); |
1280 |
append_page(*table[1], _("Amp (1)")); |
1281 |
append_page(*table[2], _("Amp (2)")); |
1282 |
append_page(*table[3], _("Amp (3)")); |
1283 |
append_page(*table[4], _("Filter (1)")); |
1284 |
append_page(*table[5], _("Filter (2)")); |
1285 |
append_page(*table[6], _("Filter (3)")); |
1286 |
append_page(*table[7], _("Pitch")); |
1287 |
append_page(*table[8], _("Misc")); |
1288 |
|
1289 |
Settings::singleton()->showTooltips.get_proxy().signal_changed().connect( |
1290 |
sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed) |
1291 |
); |
1292 |
|
1293 |
on_show_tooltips_changed(); |
1294 |
} |
1295 |
|
1296 |
DimRegionEdit::~DimRegionEdit() |
1297 |
{ |
1298 |
} |
1299 |
|
1300 |
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
1301 |
Gtk::Entry*& widget) |
1302 |
{ |
1303 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1304 |
#if HAS_GTKMM_ALIGNMENT |
1305 |
label->set_alignment(Gtk::ALIGN_START); |
1306 |
#else |
1307 |
label->set_halign(Gtk::Align::START); |
1308 |
#endif |
1309 |
|
1310 |
#if USE_GTKMM_GRID |
1311 |
table[pageno]->attach(*label, 1, rowno); |
1312 |
#else |
1313 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1314 |
Gtk::FILL, Gtk::SHRINK); |
1315 |
#endif |
1316 |
|
1317 |
widget = new Gtk::Entry(); |
1318 |
|
1319 |
#if USE_GTKMM_GRID |
1320 |
table[pageno]->attach(*widget, 2, rowno); |
1321 |
#else |
1322 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
1323 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1324 |
#endif |
1325 |
|
1326 |
rowno++; |
1327 |
} |
1328 |
|
1329 |
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
1330 |
Gtk::Entry*& widget, Gtk::Button*& button) |
1331 |
{ |
1332 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1333 |
#if HAS_GTKMM_ALIGNMENT |
1334 |
label->set_alignment(Gtk::ALIGN_START); |
1335 |
#else |
1336 |
label->set_halign(Gtk::Align::START); |
1337 |
#endif |
1338 |
|
1339 |
#if USE_GTKMM_GRID |
1340 |
table[pageno]->attach(*label, 1, rowno); |
1341 |
#else |
1342 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1343 |
Gtk::FILL, Gtk::SHRINK); |
1344 |
#endif |
1345 |
|
1346 |
widget = new Gtk::Entry(); |
1347 |
button = new Gtk::Button(); |
1348 |
|
1349 |
HBox* hbox = new HBox; |
1350 |
hbox->pack_start(*widget); |
1351 |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
1352 |
|
1353 |
#if USE_GTKMM_GRID |
1354 |
table[pageno]->attach(*hbox, 2, rowno); |
1355 |
#else |
1356 |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
1357 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1358 |
#endif |
1359 |
|
1360 |
rowno++; |
1361 |
} |
1362 |
|
1363 |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
1364 |
{ |
1365 |
if (firstRowInBlock < rowno - 1) |
1366 |
{ |
1367 |
Gtk::Label* filler = new Gtk::Label(" "); |
1368 |
#if USE_GTKMM_GRID |
1369 |
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1370 |
#else |
1371 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1372 |
Gtk::FILL, Gtk::SHRINK); |
1373 |
#endif |
1374 |
} |
1375 |
Glib::ustring str = "<b>"; |
1376 |
str += text; |
1377 |
str += "</b>"; |
1378 |
Gtk::Label* label = new Gtk::Label(str); |
1379 |
label->set_use_markup(); |
1380 |
#if HAS_GTKMM_ALIGNMENT |
1381 |
label->set_alignment(Gtk::ALIGN_START); |
1382 |
#else |
1383 |
label->set_halign(Gtk::Align::START); |
1384 |
#endif |
1385 |
// on GTKMM 3 there is absolutely no margin by default |
1386 |
#if GTKMM_MAJOR_VERSION >= 3 |
1387 |
label->set_margin_top(18); |
1388 |
label->set_margin_bottom(13); |
1389 |
#endif |
1390 |
#if USE_GTKMM_GRID |
1391 |
table[pageno]->attach(*label, 0, rowno, 3); |
1392 |
#else |
1393 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1394 |
Gtk::FILL, Gtk::SHRINK); |
1395 |
#endif |
1396 |
rowno++; |
1397 |
firstRowInBlock = rowno; |
1398 |
return label; |
1399 |
} |
1400 |
|
1401 |
void DimRegionEdit::on_show_tooltips_changed() { |
1402 |
const bool b = Settings::singleton()->showTooltips; |
1403 |
|
1404 |
buttonSelectSample.set_has_tooltip(b); |
1405 |
buttonNullSampleReference->set_has_tooltip(b); |
1406 |
wSample->set_has_tooltip(b); |
1407 |
|
1408 |
eEG1StateOptions.on_show_tooltips_changed(); |
1409 |
eEG2StateOptions.on_show_tooltips_changed(); |
1410 |
|
1411 |
set_has_tooltip(b); |
1412 |
} |
1413 |
|
1414 |
void DimRegionEdit::nextPage() |
1415 |
{ |
1416 |
if (firstRowInBlock < rowno - 1) |
1417 |
{ |
1418 |
Gtk::Label* filler = new Gtk::Label(" "); |
1419 |
#if USE_GTKMM_GRID |
1420 |
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1421 |
#else |
1422 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1423 |
Gtk::FILL, Gtk::SHRINK); |
1424 |
#endif |
1425 |
} |
1426 |
pageno++; |
1427 |
rowno = 0; |
1428 |
firstRowInBlock = 0; |
1429 |
} |
1430 |
|
1431 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1432 |
{ |
1433 |
#if USE_GTKMM_GRID |
1434 |
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1435 |
#else |
1436 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1437 |
Gtk::FILL, Gtk::SHRINK); |
1438 |
#endif |
1439 |
rowno++; |
1440 |
} |
1441 |
|
1442 |
void DimRegionEdit::addProp(LabelWidget& prop) |
1443 |
{ |
1444 |
#if USE_GTKMM_GRID |
1445 |
table[pageno]->attach(prop.label, 1, rowno); |
1446 |
table[pageno]->attach(prop.widget, 2, rowno); |
1447 |
#else |
1448 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1449 |
Gtk::FILL, Gtk::SHRINK); |
1450 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1451 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1452 |
#endif |
1453 |
rowno++; |
1454 |
} |
1455 |
|
1456 |
void DimRegionEdit::addLine(HBox& line) |
1457 |
{ |
1458 |
#if USE_GTKMM_GRID |
1459 |
table[pageno]->attach(line, 1, rowno, 2); |
1460 |
#else |
1461 |
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1462 |
Gtk::FILL, Gtk::SHRINK); |
1463 |
#endif |
1464 |
rowno++; |
1465 |
} |
1466 |
|
1467 |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1468 |
{ |
1469 |
#if USE_GTKMM_GRID |
1470 |
table[pageno]->attach(widget, 2, rowno); |
1471 |
#else |
1472 |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1473 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1474 |
#endif |
1475 |
rowno++; |
1476 |
} |
1477 |
|
1478 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
1479 |
{ |
1480 |
dimregion = d; |
1481 |
velocity_curve.set_dim_region(d); |
1482 |
release_curve.set_dim_region(d); |
1483 |
cutoff_curve.set_dim_region(d); |
1484 |
crossfade_curve.set_dim_region(d); |
1485 |
lfo1Graph.set_dim_region(d); |
1486 |
lfo2Graph.set_dim_region(d); |
1487 |
lfo3Graph.set_dim_region(d); |
1488 |
|
1489 |
set_sensitive(d); |
1490 |
if (!d) return; |
1491 |
|
1492 |
update_model++; |
1493 |
eEG1PreAttack.set_value(d->EG1PreAttack); |
1494 |
eEG1Attack.set_value(d->EG1Attack); |
1495 |
eEG1Decay1.set_value(d->EG1Decay1); |
1496 |
eEG1Decay2.set_value(d->EG1Decay2); |
1497 |
eEG1InfiniteSustain.set_value(d->EG1InfiniteSustain); |
1498 |
eEG1Sustain.set_value(d->EG1Sustain); |
1499 |
eEG1Release.set_value(d->EG1Release); |
1500 |
eEG1Hold.set_value(d->EG1Hold); |
1501 |
eEG1Controller.set_value(d->EG1Controller); |
1502 |
eEG1ControllerInvert.set_value(d->EG1ControllerInvert); |
1503 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1504 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1505 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1506 |
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1507 |
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1508 |
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1509 |
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1510 |
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1511 |
eLFO1Wave.set_value(d->LFO1WaveForm); |
1512 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1513 |
eLFO1Phase.set_value(d->LFO1Phase); |
1514 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1515 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1516 |
eLFO1Controller.set_value(d->LFO1Controller); |
1517 |
eLFO1FlipPhase.set_value(d->LFO1FlipPhase); |
1518 |
eLFO1Sync.set_value(d->LFO1Sync); |
1519 |
eEG2PreAttack.set_value(d->EG2PreAttack); |
1520 |
eEG2Attack.set_value(d->EG2Attack); |
1521 |
eEG2Decay1.set_value(d->EG2Decay1); |
1522 |
eEG2Decay2.set_value(d->EG2Decay2); |
1523 |
eEG2InfiniteSustain.set_value(d->EG2InfiniteSustain); |
1524 |
eEG2Sustain.set_value(d->EG2Sustain); |
1525 |
eEG2Release.set_value(d->EG2Release); |
1526 |
eEG2Controller.set_value(d->EG2Controller); |
1527 |
eEG2ControllerInvert.set_value(d->EG2ControllerInvert); |
1528 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1529 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1530 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1531 |
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1532 |
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1533 |
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1534 |
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1535 |
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1536 |
eLFO2Wave.set_value(d->LFO2WaveForm); |
1537 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1538 |
eLFO2Phase.set_value(d->LFO2Phase); |
1539 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1540 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1541 |
eLFO2Controller.set_value(d->LFO2Controller); |
1542 |
eLFO2FlipPhase.set_value(d->LFO2FlipPhase); |
1543 |
eLFO2Sync.set_value(d->LFO2Sync); |
1544 |
eEG3Attack.set_value(d->EG3Attack); |
1545 |
eEG3Depth.set_value(d->EG3Depth); |
1546 |
eLFO3Wave.set_value(d->LFO3WaveForm); |
1547 |
eLFO3Frequency.set_value(d->LFO3Frequency); |
1548 |
eLFO3Phase.set_value(d->LFO3Phase); |
1549 |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
1550 |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
1551 |
eLFO3Controller.set_value(d->LFO3Controller); |
1552 |
eLFO3FlipPhase.set_value(d->LFO3FlipPhase); |
1553 |
eLFO3Sync.set_value(d->LFO3Sync); |
1554 |
eVCFEnabled.set_value(d->VCFEnabled); |
1555 |
eVCFType.set_value(d->VCFType); |
1556 |
eVCFCutoffController.set_value(d->VCFCutoffController); |
1557 |
eVCFCutoffControllerInvert.set_value(d->VCFCutoffControllerInvert); |
1558 |
eVCFCutoff.set_value(d->VCFCutoff); |
1559 |
eVCFVelocityCurve.set_value(d->VCFVelocityCurve); |
1560 |
eVCFVelocityScale.set_value(d->VCFVelocityScale); |
1561 |
eVCFVelocityDynamicRange.set_value(d->VCFVelocityDynamicRange); |
1562 |
eVCFResonance.set_value(d->VCFResonance); |
1563 |
eVCFResonanceDynamic.set_value(d->VCFResonanceDynamic); |
1564 |
eVCFResonanceController.set_value(d->VCFResonanceController); |
1565 |
eVCFKeyboardTracking.set_value(d->VCFKeyboardTracking); |
1566 |
eVCFKeyboardTrackingBreakpoint.set_value(d->VCFKeyboardTrackingBreakpoint); |
1567 |
eVelocityResponseCurve.set_value(d->VelocityResponseCurve); |
1568 |
eVelocityResponseDepth.set_value(d->VelocityResponseDepth); |
1569 |
eVelocityResponseCurveScaling.set_value(d->VelocityResponseCurveScaling); |
1570 |
eReleaseVelocityResponseCurve.set_value(d->ReleaseVelocityResponseCurve); |
1571 |
eReleaseVelocityResponseDepth.set_value(d->ReleaseVelocityResponseDepth); |
1572 |
eReleaseTriggerDecay.set_value(d->ReleaseTriggerDecay); |
1573 |
eCrossfade_in_start.set_value(d->Crossfade.in_start); |
1574 |
eCrossfade_in_end.set_value(d->Crossfade.in_end); |
1575 |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
1576 |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
1577 |
ePitchTrack.set_value(d->PitchTrack); |
1578 |
eSustainReleaseTrigger.set_value(d->SustainReleaseTrigger); |
1579 |
eNoNoteOffReleaseTrigger.set_value(d->NoNoteOffReleaseTrigger); |
1580 |
eDimensionBypass.set_value(d->DimensionBypass); |
1581 |
ePan.set_value(d->Pan); |
1582 |
eSelfMask.set_value(d->SelfMask); |
1583 |
eAttenuationController.set_value(d->AttenuationController); |
1584 |
eInvertAttenuationController.set_value(d->InvertAttenuationController); |
1585 |
eAttenuationControllerThreshold.set_value(d->AttenuationControllerThreshold); |
1586 |
eChannelOffset.set_value(d->ChannelOffset); |
1587 |
eSustainDefeat.set_value(d->SustainDefeat); |
1588 |
eMSDecode.set_value(d->MSDecode); |
1589 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1590 |
eUnityNote.set_value(d->UnityNote); |
1591 |
// show sample group name |
1592 |
{ |
1593 |
Glib::ustring s = "---"; |
1594 |
if (d->pSample && d->pSample->GetGroup()) |
1595 |
s = d->pSample->GetGroup()->Name; |
1596 |
eSampleGroup.text.set_text(s); |
1597 |
} |
1598 |
// assemble sample format info string |
1599 |
{ |
1600 |
Glib::ustring s; |
1601 |
if (d->pSample) { |
1602 |
switch (d->pSample->Channels) { |
1603 |
case 1: s = _("Mono"); break; |
1604 |
case 2: s = _("Stereo"); break; |
1605 |
default: |
1606 |
s = ToString(d->pSample->Channels) + _(" audio channels"); |
1607 |
break; |
1608 |
} |
1609 |
s += " " + ToString(d->pSample->BitDepth) + " Bits"; |
1610 |
s += " " + ToString(d->pSample->SamplesPerSecond/1000) + "." |
1611 |
+ ToString((d->pSample->SamplesPerSecond%1000)/100) + " kHz"; |
1612 |
} else { |
1613 |
s = _("No sample assigned to this dimension region."); |
1614 |
} |
1615 |
eSampleFormatInfo.text.set_text(s); |
1616 |
} |
1617 |
// generate sample's memory address pointer string |
1618 |
{ |
1619 |
Glib::ustring s; |
1620 |
if (d->pSample) { |
1621 |
char buf[64] = {}; |
1622 |
snprintf(buf, sizeof(buf), "%p", d->pSample); |
1623 |
s = buf; |
1624 |
} else { |
1625 |
s = "---"; |
1626 |
} |
1627 |
eSampleID.text.set_text(s); |
1628 |
} |
1629 |
// generate raw wave form data CRC-32 checksum string |
1630 |
{ |
1631 |
Glib::ustring s = "---"; |
1632 |
if (d->pSample) { |
1633 |
char buf[64] = {}; |
1634 |
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1635 |
s = buf; |
1636 |
} |
1637 |
eChecksum.text.set_text(s); |
1638 |
} |
1639 |
buttonSelectSample.set_sensitive(d && d->pSample); |
1640 |
eFineTune.set_value(d->FineTune); |
1641 |
eGain.set_value(d->Gain); |
1642 |
eSampleLoopEnabled.set_value(d->SampleLoops); |
1643 |
eSampleLoopType.set_value( |
1644 |
d->SampleLoops ? d->pSampleLoops[0].LoopType : 0); |
1645 |
eSampleLoopStart.set_value( |
1646 |
d->SampleLoops ? d->pSampleLoops[0].LoopStart : 0); |
1647 |
eSampleLoopLength.set_value( |
1648 |
d->SampleLoops ? d->pSampleLoops[0].LoopLength : 0); |
1649 |
eSampleLoopInfinite.set_value( |
1650 |
d->pSample && d->pSample->LoopPlayCount == 0); |
1651 |
eSampleLoopPlayCount.set_value( |
1652 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
1653 |
update_model--; |
1654 |
|
1655 |
wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) : |
1656 |
_("NULL")); |
1657 |
|
1658 |
update_loop_elements(); |
1659 |
VCFEnabled_toggled(); |
1660 |
} |
1661 |
|
1662 |
|
1663 |
void DimRegionEdit::VCFEnabled_toggled() |
1664 |
{ |
1665 |
bool sensitive = eVCFEnabled.get_value(); |
1666 |
eVCFType.set_sensitive(sensitive); |
1667 |
eVCFCutoffController.set_sensitive(sensitive); |
1668 |
eVCFVelocityCurve.set_sensitive(sensitive); |
1669 |
eVCFVelocityScale.set_sensitive(sensitive); |
1670 |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
1671 |
cutoff_curve.set_sensitive(sensitive); |
1672 |
eVCFResonance.set_sensitive(sensitive); |
1673 |
eVCFResonanceController.set_sensitive(sensitive); |
1674 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
1675 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
1676 |
lEG2->set_sensitive(sensitive); |
1677 |
eEG2PreAttack.set_sensitive(sensitive); |
1678 |
eEG2Attack.set_sensitive(sensitive); |
1679 |
eEG2Decay1.set_sensitive(sensitive); |
1680 |
eEG2InfiniteSustain.set_sensitive(sensitive); |
1681 |
eEG2Sustain.set_sensitive(sensitive); |
1682 |
eEG2Release.set_sensitive(sensitive); |
1683 |
eEG2Controller.set_sensitive(sensitive); |
1684 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1685 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1686 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1687 |
eEG2StateOptions.set_sensitive(sensitive); |
1688 |
lLFO2->set_sensitive(sensitive); |
1689 |
eLFO2Wave.set_sensitive(sensitive); |
1690 |
eLFO2Frequency.set_sensitive(sensitive); |
1691 |
eLFO2Phase.set_sensitive(sensitive); |
1692 |
eLFO2InternalDepth.set_sensitive(sensitive); |
1693 |
eLFO2ControlDepth.set_sensitive(sensitive); |
1694 |
eLFO2Controller.set_sensitive(sensitive); |
1695 |
eLFO2FlipPhase.set_sensitive(sensitive); |
1696 |
eLFO2Sync.set_sensitive(sensitive); |
1697 |
lfo2Graph.set_sensitive(sensitive); |
1698 |
if (sensitive) { |
1699 |
VCFCutoffController_changed(); |
1700 |
VCFResonanceController_changed(); |
1701 |
EG2InfiniteSustain_toggled(); |
1702 |
EG2Controller_changed(); |
1703 |
LFO2Controller_changed(); |
1704 |
} else { |
1705 |
eVCFCutoffControllerInvert.set_sensitive(false); |
1706 |
eVCFCutoff.set_sensitive(false); |
1707 |
eVCFResonanceDynamic.set_sensitive(false); |
1708 |
eVCFResonance.set_sensitive(false); |
1709 |
eEG2Decay2.set_sensitive(false); |
1710 |
eEG2ControllerInvert.set_sensitive(false); |
1711 |
eLFO2InternalDepth.set_sensitive(false); |
1712 |
eLFO2ControlDepth.set_sensitive(false); |
1713 |
} |
1714 |
} |
1715 |
|
1716 |
void DimRegionEdit::VCFCutoffController_changed() |
1717 |
{ |
1718 |
gig::vcf_cutoff_ctrl_t ctrl = eVCFCutoffController.get_value(); |
1719 |
bool hasController = ctrl != gig::vcf_cutoff_ctrl_none && ctrl != gig::vcf_cutoff_ctrl_none2; |
1720 |
|
1721 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
1722 |
eVCFCutoff.set_sensitive(!hasController); |
1723 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
1724 |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
1725 |
_("Velocity scale:")); |
1726 |
} |
1727 |
|
1728 |
void DimRegionEdit::VCFResonanceController_changed() |
1729 |
{ |
1730 |
bool hasController = eVCFResonanceController.get_value() != gig::vcf_res_ctrl_none; |
1731 |
eVCFResonance.set_sensitive(!hasController); |
1732 |
} |
1733 |
|
1734 |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
1735 |
{ |
1736 |
bool infSus = eEG1InfiniteSustain.get_value(); |
1737 |
eEG1Decay2.set_sensitive(!infSus); |
1738 |
} |
1739 |
|
1740 |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
1741 |
{ |
1742 |
bool infSus = eEG2InfiniteSustain.get_value(); |
1743 |
eEG2Decay2.set_sensitive(!infSus); |
1744 |
} |
1745 |
|
1746 |
void DimRegionEdit::EG1Controller_changed() |
1747 |
{ |
1748 |
bool hasController = eEG1Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
1749 |
eEG1ControllerInvert.set_sensitive(hasController); |
1750 |
} |
1751 |
|
1752 |
void DimRegionEdit::EG2Controller_changed() |
1753 |
{ |
1754 |
bool hasController = eEG2Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
1755 |
eEG2ControllerInvert.set_sensitive(hasController); |
1756 |
} |
1757 |
|
1758 |
void DimRegionEdit::AttenuationController_changed() |
1759 |
{ |
1760 |
bool hasController = |
1761 |
eAttenuationController.get_value().type != gig::leverage_ctrl_t::type_none; |
1762 |
eInvertAttenuationController.set_sensitive(hasController); |
1763 |
eAttenuationControllerThreshold.set_sensitive(hasController); |
1764 |
eCrossfade_in_start.set_sensitive(hasController); |
1765 |
eCrossfade_in_end.set_sensitive(hasController); |
1766 |
eCrossfade_out_start.set_sensitive(hasController); |
1767 |
eCrossfade_out_end.set_sensitive(hasController); |
1768 |
crossfade_curve.set_sensitive(hasController); |
1769 |
} |
1770 |
|
1771 |
void DimRegionEdit::LFO1Controller_changed() |
1772 |
{ |
1773 |
gig::lfo1_ctrl_t ctrl = eLFO1Controller.get_value(); |
1774 |
eLFO1ControlDepth.set_sensitive(ctrl != gig::lfo1_ctrl_internal); |
1775 |
eLFO1InternalDepth.set_sensitive(ctrl != gig::lfo1_ctrl_modwheel && |
1776 |
ctrl != gig::lfo1_ctrl_breath); |
1777 |
} |
1778 |
|
1779 |
void DimRegionEdit::LFO2Controller_changed() |
1780 |
{ |
1781 |
gig::lfo2_ctrl_t ctrl = eLFO2Controller.get_value(); |
1782 |
eLFO2ControlDepth.set_sensitive(ctrl != gig::lfo2_ctrl_internal); |
1783 |
eLFO2InternalDepth.set_sensitive(ctrl != gig::lfo2_ctrl_modwheel && |
1784 |
ctrl != gig::lfo2_ctrl_foot); |
1785 |
} |
1786 |
|
1787 |
void DimRegionEdit::LFO3Controller_changed() |
1788 |
{ |
1789 |
gig::lfo3_ctrl_t ctrl = eLFO3Controller.get_value(); |
1790 |
eLFO3ControlDepth.set_sensitive(ctrl != gig::lfo3_ctrl_internal); |
1791 |
eLFO3InternalDepth.set_sensitive(ctrl != gig::lfo3_ctrl_modwheel && |
1792 |
ctrl != gig::lfo3_ctrl_aftertouch); |
1793 |
} |
1794 |
|
1795 |
void DimRegionEdit::crossfade1_changed() |
1796 |
{ |
1797 |
update_model++; |
1798 |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1799 |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1800 |
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1801 |
update_model--; |
1802 |
} |
1803 |
|
1804 |
void DimRegionEdit::crossfade2_changed() |
1805 |
{ |
1806 |
update_model++; |
1807 |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1808 |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1809 |
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1810 |
update_model--; |
1811 |
} |
1812 |
|
1813 |
void DimRegionEdit::crossfade3_changed() |
1814 |
{ |
1815 |
update_model++; |
1816 |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1817 |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1818 |
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1819 |
update_model--; |
1820 |
} |
1821 |
|
1822 |
void DimRegionEdit::crossfade4_changed() |
1823 |
{ |
1824 |
update_model++; |
1825 |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1826 |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1827 |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1828 |
update_model--; |
1829 |
} |
1830 |
|
1831 |
void DimRegionEdit::update_loop_elements() |
1832 |
{ |
1833 |
update_model++; |
1834 |
const bool active = eSampleLoopEnabled.get_value(); |
1835 |
eSampleLoopStart.set_sensitive(active); |
1836 |
eSampleLoopLength.set_sensitive(active); |
1837 |
eSampleLoopType.set_sensitive(active); |
1838 |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
1839 |
// sample loop shall never be longer than the actual sample size |
1840 |
loop_start_changed(); |
1841 |
loop_length_changed(); |
1842 |
eSampleLoopStart.set_value( |
1843 |
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopStart : 0); |
1844 |
eSampleLoopLength.set_value( |
1845 |
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopLength : 0); |
1846 |
|
1847 |
eSampleLoopInfinite.set_value( |
1848 |
dimregion->pSample && dimregion->pSample->LoopPlayCount == 0); |
1849 |
|
1850 |
loop_infinite_toggled(); |
1851 |
update_model--; |
1852 |
} |
1853 |
|
1854 |
void DimRegionEdit::loop_start_changed() { |
1855 |
if (dimregion && dimregion->SampleLoops) { |
1856 |
eSampleLoopLength.set_upper(dimregion->pSample ? |
1857 |
dimregion->pSample->SamplesTotal - |
1858 |
dimregion->pSampleLoops[0].LoopStart : 0); |
1859 |
} |
1860 |
} |
1861 |
|
1862 |
void DimRegionEdit::loop_length_changed() { |
1863 |
if (dimregion && dimregion->SampleLoops) { |
1864 |
eSampleLoopStart.set_upper(dimregion->pSample ? |
1865 |
dimregion->pSample->SamplesTotal - |
1866 |
dimregion->pSampleLoops[0].LoopLength : 0); |
1867 |
} |
1868 |
} |
1869 |
|
1870 |
void DimRegionEdit::loop_infinite_toggled() { |
1871 |
eSampleLoopPlayCount.set_sensitive( |
1872 |
dimregion && dimregion->pSample && |
1873 |
!eSampleLoopInfinite.get_value() && |
1874 |
eSampleLoopEnabled.get_value() |
1875 |
); |
1876 |
update_model++; |
1877 |
eSampleLoopPlayCount.set_value( |
1878 |
dimregion->pSample ? dimregion->pSample->LoopPlayCount : 0); |
1879 |
update_model--; |
1880 |
} |
1881 |
|
1882 |
bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1883 |
{ |
1884 |
bool result = false; |
1885 |
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1886 |
itDimReg != dimregs.end(); ++itDimReg) |
1887 |
{ |
1888 |
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1889 |
} |
1890 |
return result; |
1891 |
} |
1892 |
|
1893 |
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1894 |
{ |
1895 |
if (dimreg) { |
1896 |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
1897 |
|
1898 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1899 |
//DimRegionChangeGuard(this, dimregion); |
1900 |
|
1901 |
// make sure stereo samples always are the same in both |
1902 |
// dimregs in the samplechannel dimension |
1903 |
int nbDimregs = 1; |
1904 |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1905 |
if (sample->Channels == 2) { |
1906 |
gig::Region* region = dimreg->GetParent(); |
1907 |
|
1908 |
int bitcount = 0; |
1909 |
int stereo_bit = 0; |
1910 |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1911 |
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1912 |
stereo_bit = 1 << bitcount; |
1913 |
break; |
1914 |
} |
1915 |
bitcount += region->pDimensionDefinitions[dim].bits; |
1916 |
} |
1917 |
|
1918 |
if (stereo_bit) { |
1919 |
int dimregno; |
1920 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1921 |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1922 |
break; |
1923 |
} |
1924 |
} |
1925 |
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1926 |
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1927 |
nbDimregs = 2; |
1928 |
} |
1929 |
} |
1930 |
|
1931 |
gig::Sample* oldref = dimreg->pSample; |
1932 |
|
1933 |
for (int i = 0 ; i < nbDimregs ; i++) { |
1934 |
d[i]->pSample = sample; |
1935 |
|
1936 |
// copy sample information from Sample to DimensionRegion |
1937 |
if (copy_sample_unity) |
1938 |
d[i]->UnityNote = sample->MIDIUnityNote; |
1939 |
if (copy_sample_tune) |
1940 |
d[i]->FineTune = sample->FineTune; |
1941 |
if (copy_sample_loop) { |
1942 |
int loops = sample->Loops ? 1 : 0; |
1943 |
while (d[i]->SampleLoops > loops) { |
1944 |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1945 |
} |
1946 |
while (d[i]->SampleLoops < sample->Loops) { |
1947 |
DLS::sample_loop_t loop; |
1948 |
d[i]->AddSampleLoop(&loop); |
1949 |
} |
1950 |
if (loops) { |
1951 |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1952 |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1953 |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1954 |
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1955 |
} |
1956 |
} |
1957 |
} |
1958 |
|
1959 |
// update ui |
1960 |
update_model++; |
1961 |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1962 |
eUnityNote.set_value(dimreg->UnityNote); |
1963 |
eFineTune.set_value(dimreg->FineTune); |
1964 |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1965 |
update_loop_elements(); |
1966 |
update_model--; |
1967 |
|
1968 |
sample_ref_changed_signal.emit(oldref, sample); |
1969 |
return true; |
1970 |
} |
1971 |
return false; |
1972 |
} |
1973 |
|
1974 |
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_to_be_changed() { |
1975 |
return dimreg_to_be_changed_signal; |
1976 |
} |
1977 |
|
1978 |
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_changed() { |
1979 |
return dimreg_changed_signal; |
1980 |
} |
1981 |
|
1982 |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& DimRegionEdit::signal_sample_ref_changed() { |
1983 |
return sample_ref_changed_signal; |
1984 |
} |
1985 |
|
1986 |
|
1987 |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion& d, uint8_t value) |
1988 |
{ |
1989 |
d.UnityNote = value; |
1990 |
} |
1991 |
|
1992 |
void DimRegionEdit::set_FineTune(gig::DimensionRegion& d, int16_t value) |
1993 |
{ |
1994 |
d.FineTune = value; |
1995 |
} |
1996 |
|
1997 |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion& d, |
1998 |
uint8_t value) |
1999 |
{ |
2000 |
d.Crossfade.in_start = value; |
2001 |
if (d.Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
2002 |
} |
2003 |
|
2004 |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion& d, |
2005 |
uint8_t value) |
2006 |
{ |
2007 |
d.Crossfade.in_end = value; |
2008 |
if (value < d.Crossfade.in_start) set_Crossfade_in_start(d, value); |
2009 |
if (value > d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
2010 |
} |
2011 |
|
2012 |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion& d, |
2013 |
uint8_t value) |
2014 |
{ |
2015 |
d.Crossfade.out_start = value; |
2016 |
if (value < d.Crossfade.in_end) set_Crossfade_in_end(d, value); |
2017 |
if (value > d.Crossfade.out_end) set_Crossfade_out_end(d, value); |
2018 |
} |
2019 |
|
2020 |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion& d, |
2021 |
uint8_t value) |
2022 |
{ |
2023 |
d.Crossfade.out_end = value; |
2024 |
if (value < d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
2025 |
} |
2026 |
|
2027 |
void DimRegionEdit::set_Gain(gig::DimensionRegion& d, int32_t value) |
2028 |
{ |
2029 |
d.SetGain(value); |
2030 |
} |
2031 |
|
2032 |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion& d, bool value) |
2033 |
{ |
2034 |
if (value) { |
2035 |
// create a new sample loop in case there is none yet |
2036 |
if (!d.SampleLoops) { |
2037 |
DimRegionChangeGuard(this, &d); |
2038 |
|
2039 |
DLS::sample_loop_t loop; |
2040 |
loop.LoopType = gig::loop_type_normal; |
2041 |
// loop the whole sample by default |
2042 |
loop.LoopStart = 0; |
2043 |
loop.LoopLength = |
2044 |
(d.pSample) ? d.pSample->SamplesTotal : 0; |
2045 |
d.AddSampleLoop(&loop); |
2046 |
} |
2047 |
} else { |
2048 |
if (d.SampleLoops) { |
2049 |
DimRegionChangeGuard(this, &d); |
2050 |
|
2051 |
// delete ALL existing sample loops |
2052 |
while (d.SampleLoops) { |
2053 |
d.DeleteSampleLoop(&d.pSampleLoops[0]); |
2054 |
} |
2055 |
} |
2056 |
} |
2057 |
} |
2058 |
|
2059 |
void DimRegionEdit::set_LoopType(gig::DimensionRegion& d, uint32_t value) |
2060 |
{ |
2061 |
if (d.SampleLoops) d.pSampleLoops[0].LoopType = value; |
2062 |
} |
2063 |
|
2064 |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion& d, uint32_t value) |
2065 |
{ |
2066 |
if (d.SampleLoops) { |
2067 |
d.pSampleLoops[0].LoopStart = |
2068 |
d.pSample ? |
2069 |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
2070 |
d.pSampleLoops[0].LoopLength)) : |
2071 |
0; |
2072 |
} |
2073 |
} |
2074 |
|
2075 |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion& d, uint32_t value) |
2076 |
{ |
2077 |
if (d.SampleLoops) { |
2078 |
d.pSampleLoops[0].LoopLength = |
2079 |
d.pSample ? |
2080 |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
2081 |
d.pSampleLoops[0].LoopStart)) : |
2082 |
0; |
2083 |
} |
2084 |
} |
2085 |
|
2086 |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion& d, bool value) |
2087 |
{ |
2088 |
if (d.pSample) { |
2089 |
if (value) d.pSample->LoopPlayCount = 0; |
2090 |
else if (d.pSample->LoopPlayCount == 0) d.pSample->LoopPlayCount = 1; |
2091 |
} |
2092 |
} |
2093 |
|
2094 |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion& d, uint32_t value) |
2095 |
{ |
2096 |
if (d.pSample) d.pSample->LoopPlayCount = value; |
2097 |
} |
2098 |
|
2099 |
void DimRegionEdit::nullOutSampleReference() { |
2100 |
if (!dimregion) return; |
2101 |
gig::Sample* oldref = dimregion->pSample; |
2102 |
if (!oldref) return; |
2103 |
|
2104 |
DimRegionChangeGuard(this, dimregion); |
2105 |
|
2106 |
// in case currently assigned sample is a stereo one, then remove both |
2107 |
// references (expected to be due to a "stereo dimension") |
2108 |
gig::DimensionRegion* d[2] = { dimregion, NULL }; |
2109 |
if (oldref->Channels == 2) { |
2110 |
gig::Region* region = dimregion->GetParent(); |
2111 |
{ |
2112 |
int stereo_bit = 0; |
2113 |
int bitcount = 0; |
2114 |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
2115 |
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
2116 |
stereo_bit = 1 << bitcount; |
2117 |
break; |
2118 |
} |
2119 |
bitcount += region->pDimensionDefinitions[dim].bits; |
2120 |
} |
2121 |
|
2122 |
if (stereo_bit) { |
2123 |
int dimregno; |
2124 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
2125 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
2126 |
break; |
2127 |
} |
2128 |
} |
2129 |
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
2130 |
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
2131 |
} |
2132 |
} |
2133 |
} |
2134 |
|
2135 |
if (d[0]) d[0]->pSample = NULL; |
2136 |
if (d[1]) d[1]->pSample = NULL; |
2137 |
|
2138 |
// update UI elements |
2139 |
set_dim_region(dimregion); |
2140 |
|
2141 |
sample_ref_changed_signal.emit(oldref, NULL); |
2142 |
} |
2143 |
|
2144 |
void DimRegionEdit::onButtonSelectSamplePressed() { |
2145 |
if (!dimregion) return; |
2146 |
if (!dimregion->pSample) return; |
2147 |
select_sample_signal.emit(dimregion->pSample); |
2148 |
} |
2149 |
|
2150 |
sigc::signal<void, gig::Sample*>& DimRegionEdit::signal_select_sample() { |
2151 |
return select_sample_signal; |
2152 |
} |