/[svn]/gigedit/trunk/src/dimregionedit.cpp
ViewVC logotype

Contents of /gigedit/trunk/src/dimregionedit.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1153 - (show annotations) (download)
Mon Apr 9 21:05:01 2007 UTC (17 years ago) by schoenebeck
File size: 26361 byte(s)
* added couple tooltips to dimregionedit

1 /*
2 * Copyright (C) 2006, 2007 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 "dimregionedit.h"
21
22 #include <libintl.h>
23 #define _(String) gettext(String)
24
25 DimRegionEdit::DimRegionEdit() :
26 eEG1PreAttack("PreAttack", 0, 100, 2),
27 eEG1Attack("Attack", 0, 60, 3),
28 eEG1Decay1("Decay1", 0.005, 60, 3),
29 eEG1Decay2("Decay2", 0, 60, 3),
30 eEG1InfiniteSustain("InfiniteSustain"),
31 eEG1Sustain("Sustain", 0, 100, 2),
32 eEG1Release("Release", 0, 60, 3),
33 eEG1Hold("Hold"),
34 eEG1Controller("Controller"),
35 eEG1ControllerInvert("ControllerInvert"),
36 eEG1ControllerAttackInfluence("ControllerAttackInfluence", 0, 3),
37 eEG1ControllerDecayInfluence("ControllerDecayInfluence", 0, 3),
38 eEG1ControllerReleaseInfluence("ControllerReleaseInfluence", 0, 3),
39 eLFO1Frequency("Frequency", 0.1, 10, 2),
40 eLFO1InternalDepth("InternalDepth", 0, 1200),
41 eLFO1ControlDepth("ControlDepth", 0, 1200),
42 eLFO1Controller("Controller"),
43 eLFO1FlipPhase("FlipPhase"),
44 eLFO1Sync("Sync"),
45 eEG2PreAttack("PreAttack", 0, 100, 2),
46 eEG2Attack("Attack", 0, 60, 3),
47 eEG2Decay1("Decay1", 0.005, 60, 3),
48 eEG2Decay2("Decay2", 0, 60, 3),
49 eEG2InfiniteSustain("InfiniteSustain"),
50 eEG2Sustain("Sustain", 0, 100, 2),
51 eEG2Release("Release", 0, 60, 3),
52 eEG2Controller("Controller"),
53 eEG2ControllerInvert("ControllerInvert"),
54 eEG2ControllerAttackInfluence("ControllerAttackInfluence", 0, 3),
55 eEG2ControllerDecayInfluence("ControllerDecayInfluence", 0, 3),
56 eEG2ControllerReleaseInfluence("ControllerReleaseInfluence", 0, 3),
57 eLFO2Frequency("Frequency", 0.1, 10, 2),
58 eLFO2InternalDepth("InternalDepth", 0, 1200),
59 eLFO2ControlDepth("ControlDepth", 0, 1200),
60 eLFO2Controller("Controller"),
61 eLFO2FlipPhase("FlipPhase"),
62 eLFO2Sync("Sync"),
63 eEG3Attack("Attack", 0, 10, 3),
64 eEG3Depth("Depth", -1200, 1200),
65 eLFO3Frequency("Frequency", 0.1, 10, 2),
66 eLFO3InternalDepth("InternalDepth", 0, 1200),
67 eLFO3ControlDepth("ControlDepth", 0, 1200),
68 eLFO3Controller("Controller"),
69 eLFO3Sync("Sync"),
70 eVCFEnabled("Enabled"),
71 eVCFType("Type"),
72 eVCFCutoffController("CutoffController"),
73 eVCFCutoffControllerInvert("CutoffControllerInvert"),
74 eVCFCutoff("Cutoff"),
75 eVCFVelocityCurve("VelocityCurve"),
76 eVCFVelocityScale("VelocityScale"),
77 eVCFVelocityDynamicRange("VelocityDynamicRange", 0, 4),
78 eVCFResonance("Resonance"),
79 eVCFResonanceDynamic("ResonanceDynamic"),
80 eVCFResonanceController("ResonanceController"),
81 eVCFKeyboardTracking("KeyboardTracking"),
82 eVCFKeyboardTrackingBreakpoint("KeyboardTrackingBreakpoint"),
83 eVelocityResponseCurve("VelocityResponseCurve"),
84 eVelocityResponseDepth("VelocityResponseDepth", 0, 4),
85 eVelocityResponseCurveScaling("VelocityResponseCurveScaling"),
86 eReleaseVelocityResponseCurve("ReleaseVelocityResponseCurve"),
87 eReleaseVelocityResponseDepth("ReleaseVelocityResponseDepth", 0, 4),
88 eReleaseTriggerDecay("ReleaseTriggerDecay", 0, 8),
89 eCrossfade_in_start("Crossfade.in_start"),
90 eCrossfade_in_end("Crossfade.in_end"),
91 eCrossfade_out_start("Crossfade.out_start"),
92 eCrossfade_out_end("Crossfade.out_end"),
93 ePitchTrack("PitchTrack"),
94 eDimensionBypass("DimensionBypass"),
95 ePan("Pan", -64, 63),
96 eSelfMask("SelfMask"),
97 eAttenuationController("AttenuationController"),
98 eInvertAttenuationController("InvertAttenuationController"),
99 eAttenuationControllerThreshold("AttenuationControllerThreshold"),
100 eChannelOffset("ChannelOffset", 0, 9),
101 eSustainDefeat("SustainDefeat"),
102 eMSDecode("MSDecode"),
103 eSampleStartOffset("SampleStartOffset", 0, 2000),
104 eUnityNote("UnityNote"),
105 eFineTune("FineTune", -49, 50),
106 eGain("Gain", -96, 0, 2, -655360),
107 eGainPlus6("Gain +6dB", eGain, 6 * -655360),
108 eSampleLoops("SampleLoops", 0, 1)
109 {
110 for (int i = 0 ; i < 7 ; i++) {
111 table[i] = new Gtk::Table(3, 1);
112 table[i]->set_col_spacings(7);
113 }
114
115 // set tooltips
116 eUnityNote.set_tip(
117 _("note this sample is associated with (a.k.a. 'root note')")
118 );
119 eSampleStartOffset.set_tip(_("sample position at which playback should be started"));
120 ePan.set_tip(_("stereo balance (left/right)"));
121 eChannelOffset.set_tip(
122 _("output channel where the audio signal should be routed to (0 - 9)")
123 );
124 ePitchTrack.set_tip(
125 _("if true: sample will be pitched according to the key position "
126 "(this would be disabled for drums for example)")
127 );
128
129 pageno = 0;
130 rowno = 0;
131 firstRowInBlock = 0;
132
133 addHeader(_("Mandatory Settings:"));
134 addString("Sample", lSample, wSample);
135 //TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false);
136 tooltips.set_tip(*wSample, _("drop a sample here"));
137 addProp(eUnityNote);
138 addHeader(_("Optional Settings:"));
139 addProp(eSampleStartOffset);
140 addProp(ePan);
141 addProp(eChannelOffset);
142 addHeader("Loops:");
143 addProp(eSampleLoops);
144 addHeader("Crossfade:");
145 addProp(eCrossfade_in_start);
146 addProp(eCrossfade_in_end);
147 addProp(eCrossfade_out_start);
148 addProp(eCrossfade_out_end);
149
150 nextPage();
151
152 addHeader(_("General Amplitude Settings:"));
153 addProp(eGain);
154 addProp(eGainPlus6);
155 addProp(eAttenuationController);
156 addProp(eInvertAttenuationController);
157 addProp(eAttenuationControllerThreshold);
158 addHeader(_("Amplitude Envelope (EG1):"));
159 addProp(eEG1PreAttack);
160 addProp(eEG1Attack);
161 addProp(eEG1Decay1);
162 addProp(eEG1Decay2);
163 addProp(eEG1InfiniteSustain);
164 addProp(eEG1Sustain);
165 addProp(eEG1Release);
166 addProp(eEG1Hold);
167 addProp(eEG1Controller);
168 addProp(eEG1ControllerInvert);
169 addProp(eEG1ControllerAttackInfluence);
170 addProp(eEG1ControllerDecayInfluence);
171 addProp(eEG1ControllerReleaseInfluence);
172
173 nextPage();
174
175 addHeader(_("Amplitude Oscillator (LFO1):"));
176 addProp(eLFO1Frequency);
177 addProp(eLFO1InternalDepth);
178 addProp(eLFO1ControlDepth);
179 {
180 char* choices[] = { "internal", "modwheel", "breath",
181 "internal+modwheel", "internal+breath", 0 };
182 static const gig::lfo1_ctrl_t values[] = {
183 gig::lfo1_ctrl_internal,
184 gig::lfo1_ctrl_modwheel,
185 gig::lfo1_ctrl_breath,
186 gig::lfo1_ctrl_internal_modwheel,
187 gig::lfo1_ctrl_internal_breath
188 };
189 eLFO1Controller.set_choices(choices, values);
190 }
191 addProp(eLFO1Controller);
192 addProp(eLFO1FlipPhase);
193 addProp(eLFO1Sync);
194
195 nextPage();
196
197 addHeader(_("General Filter Settings:"));
198 addProp(eVCFEnabled);
199 {
200 char* choices[] = { "lowpass", "lowpassturbo", "bandpass",
201 "highpass", "bandreject", 0 };
202 static const gig::vcf_type_t values[] = {
203 gig::vcf_type_lowpass,
204 gig::vcf_type_lowpassturbo,
205 gig::vcf_type_bandpass,
206 gig::vcf_type_highpass,
207 gig::vcf_type_bandreject
208 };
209 eVCFType.set_choices(choices, values);
210 }
211 addProp(eVCFType);
212 {
213 char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2",
214 "breath", "foot", "sustainpedal", "softpedal",
215 "genpurpose7", "genpurpose8", "aftertouch", 0 };
216 static const gig::vcf_cutoff_ctrl_t values[] = {
217 gig::vcf_cutoff_ctrl_none,
218 gig::vcf_cutoff_ctrl_none2,
219 gig::vcf_cutoff_ctrl_modwheel,
220 gig::vcf_cutoff_ctrl_effect1,
221 gig::vcf_cutoff_ctrl_effect2,
222 gig::vcf_cutoff_ctrl_breath,
223 gig::vcf_cutoff_ctrl_foot,
224 gig::vcf_cutoff_ctrl_sustainpedal,
225 gig::vcf_cutoff_ctrl_softpedal,
226 gig::vcf_cutoff_ctrl_genpurpose7,
227 gig::vcf_cutoff_ctrl_genpurpose8,
228 gig::vcf_cutoff_ctrl_aftertouch
229 };
230 eVCFCutoffController.set_choices(choices, values);
231 }
232 addProp(eVCFCutoffController);
233 addProp(eVCFCutoffControllerInvert);
234 addProp(eVCFCutoff);
235 char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 };
236 static const gig::curve_type_t curve_type_values[] = {
237 gig::curve_type_nonlinear,
238 gig::curve_type_linear,
239 gig::curve_type_special
240 };
241 eVCFVelocityCurve.set_choices(curve_type_texts, curve_type_values);
242 addProp(eVCFVelocityCurve);
243 addProp(eVCFVelocityScale);
244 addProp(eVCFVelocityDynamicRange);
245 addProp(eVCFResonance);
246 addProp(eVCFResonanceDynamic);
247 {
248 char* choices[] = { "none", "genpurpose3", "genpurpose4",
249 "genpurpose5", "genpurpose6", 0 };
250 static const gig::vcf_res_ctrl_t values[] = {
251 gig::vcf_res_ctrl_none,
252 gig::vcf_res_ctrl_genpurpose3,
253 gig::vcf_res_ctrl_genpurpose4,
254 gig::vcf_res_ctrl_genpurpose5,
255 gig::vcf_res_ctrl_genpurpose6
256 };
257 eVCFResonanceController.set_choices(choices, values);
258 }
259 addProp(eVCFResonanceController);
260 addProp(eVCFKeyboardTracking);
261 addProp(eVCFKeyboardTrackingBreakpoint);
262
263 nextPage();
264
265 addHeader(_("Filter Cutoff Envelope (EG2):"));
266 addProp(eEG2PreAttack);
267 addProp(eEG2Attack);
268 addProp(eEG2Decay1);
269 addProp(eEG2Decay2);
270 addProp(eEG2InfiniteSustain);
271 addProp(eEG2Sustain);
272 addProp(eEG2Release);
273 addProp(eEG2Controller);
274 addProp(eEG2ControllerInvert);
275 addProp(eEG2ControllerAttackInfluence);
276 addProp(eEG2ControllerDecayInfluence);
277 addProp(eEG2ControllerReleaseInfluence);
278 addHeader(_("Filter Cutoff Oscillator (LFO2):"));
279 addProp(eLFO2Frequency);
280 addProp(eLFO2InternalDepth);
281 addProp(eLFO2ControlDepth);
282 {
283 char* choices[] = { "internal", "modwheel", "foot",
284 "internal+modwheel", "internal+foot", 0 };
285 static const gig::lfo2_ctrl_t values[] = {
286 gig::lfo2_ctrl_internal,
287 gig::lfo2_ctrl_modwheel,
288 gig::lfo2_ctrl_foot,
289 gig::lfo2_ctrl_internal_modwheel,
290 gig::lfo2_ctrl_internal_foot
291 };
292 eLFO2Controller.set_choices(choices, values);
293 }
294 addProp(eLFO2Controller);
295 addProp(eLFO2FlipPhase);
296 addProp(eLFO2Sync);
297
298 nextPage();
299
300 addHeader(_("General Pitch Settings:"));
301 addProp(eFineTune);
302 addProp(ePitchTrack);
303 addHeader(_("Pitch Envelope (EG3):"));
304 addProp(eEG3Attack);
305 addProp(eEG3Depth);
306 addHeader(_("Pitch Oscillator (LFO3):"));
307 addProp(eLFO3Frequency);
308 addProp(eLFO3InternalDepth);
309 addProp(eLFO3ControlDepth);
310 {
311 char* choices[] = { "internal", "modwheel", "aftertouch",
312 "internal+modwheel", "internal+aftertouch", 0 };
313 static const gig::lfo3_ctrl_t values[] = {
314 gig::lfo3_ctrl_internal,
315 gig::lfo3_ctrl_modwheel,
316 gig::lfo3_ctrl_aftertouch,
317 gig::lfo3_ctrl_internal_modwheel,
318 gig::lfo3_ctrl_internal_aftertouch
319 };
320 eLFO3Controller.set_choices(choices, values);
321 }
322 addProp(eLFO3Controller);
323 addProp(eLFO3Sync);
324
325 nextPage();
326
327 eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values);
328 addProp(eVelocityResponseCurve);
329 addProp(eVelocityResponseDepth);
330 addProp(eVelocityResponseCurveScaling);
331 eReleaseVelocityResponseCurve.set_choices(curve_type_texts,
332 curve_type_values);
333 addProp(eReleaseVelocityResponseCurve);
334 addProp(eReleaseVelocityResponseDepth);
335 addProp(eReleaseTriggerDecay);
336 {
337 char* choices[] = { "none", "effect4depth", "effect5depth", 0 };
338 static const gig::dim_bypass_ctrl_t values[] = {
339 gig::dim_bypass_ctrl_none,
340 gig::dim_bypass_ctrl_94,
341 gig::dim_bypass_ctrl_95
342 };
343 eDimensionBypass.set_choices(choices, values);
344 }
345 addProp(eDimensionBypass);
346 addProp(eSelfMask);
347 addProp(eSustainDefeat);
348 addProp(eMSDecode);
349
350 nextPage();
351
352
353 eEG1InfiniteSustain.signal_toggled().connect(
354 sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled) );
355 eEG2InfiniteSustain.signal_toggled().connect(
356 sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled) );
357 eEG1Controller.signal_changed().connect(
358 sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed) );
359 eEG2Controller.signal_changed().connect(
360 sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed) );
361 eLFO1Controller.signal_changed().connect(
362 sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed) );
363 eLFO2Controller.signal_changed().connect(
364 sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed) );
365 eLFO3Controller.signal_changed().connect(
366 sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed) );
367 eAttenuationController.signal_changed().connect(
368 sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed) );
369 eVCFEnabled.signal_toggled().connect(
370 sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled) );
371 eVCFCutoffController.signal_changed().connect(
372 sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed) );
373 eVCFResonanceController.signal_changed().connect(
374 sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed) );
375
376 eCrossfade_in_start.signal_value_changed().connect(
377 sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed));
378 eCrossfade_in_end.signal_value_changed().connect(
379 sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed));
380 eCrossfade_out_start.signal_value_changed().connect(
381 sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed));
382 eCrossfade_out_end.signal_value_changed().connect(
383 sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed));
384
385 append_page(*table[0], "Sample");
386 append_page(*table[1], "Amplitude (1)");
387 append_page(*table[2], "Amplitude (2)");
388 append_page(*table[3], "Filter (1)");
389 append_page(*table[4], "Filter (2)");
390 append_page(*table[5], "Pitch");
391 append_page(*table[6], "Misc");
392 }
393
394 DimRegionEdit::~DimRegionEdit()
395 {
396 }
397
398 void DimRegionEdit::addString(char* labelText, Gtk::Label*& label,
399 Gtk::Entry*& widget)
400 {
401 label = new Gtk::Label(Glib::ustring(labelText) + ":");
402 label->set_alignment(Gtk::ALIGN_LEFT);
403
404 table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,
405 Gtk::FILL, Gtk::SHRINK);
406
407 widget = new Gtk::Entry();
408
409 table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1,
410 Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
411
412 rowno++;
413 }
414
415 void DimRegionEdit::addHeader(char* text)
416 {
417 if (firstRowInBlock < rowno - 1)
418 {
419 Gtk::Label* filler = new Gtk::Label(" ");
420 table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno,
421 Gtk::FILL, Gtk::SHRINK);
422 }
423 Glib::ustring str = "<b>";
424 str += text;
425 str += "</b>";
426 Gtk::Label* label = new Gtk::Label(str);
427 label->set_use_markup();
428 label->set_alignment(Gtk::ALIGN_LEFT);
429 table[pageno]->attach(*label, 0, 3, rowno, rowno + 1,
430 Gtk::FILL, Gtk::SHRINK);
431 rowno++;
432 firstRowInBlock = rowno;
433 }
434
435 void DimRegionEdit::nextPage()
436 {
437 if (firstRowInBlock < rowno - 1)
438 {
439 Gtk::Label* filler = new Gtk::Label(" ");
440 table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno,
441 Gtk::FILL, Gtk::SHRINK);
442 }
443 pageno++;
444 rowno = 0;
445 firstRowInBlock = 0;
446 }
447
448 void DimRegionEdit::addProp(LabelWidget& prop)
449 {
450 table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1,
451 Gtk::FILL, Gtk::SHRINK);
452 table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1,
453 Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
454 rowno++;
455 }
456
457
458 void DimRegionEdit::set_dim_region(gig::DimensionRegion* d)
459 {
460 set_sensitive(d);
461 if (!d) return;
462
463 update_gui = false;
464 wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL");
465 eEG1PreAttack.set_ptr(&d->EG1PreAttack);
466 eEG1Attack.set_ptr(&d->EG1Attack);
467 eEG1Decay1.set_ptr(&d->EG1Decay1);
468 eEG1Decay2.set_ptr(&d->EG1Decay2);
469 eEG1InfiniteSustain.set_ptr(&d->EG1InfiniteSustain);
470 eEG1Sustain.set_ptr(&d->EG1Sustain);
471 eEG1Release.set_ptr(&d->EG1Release);
472 eEG1Hold.set_ptr(&d->EG1Hold);
473 eEG1Controller.set_ptr(&d->EG1Controller);
474 eEG1ControllerInvert.set_ptr(&d->EG1ControllerInvert);
475 eEG1ControllerAttackInfluence.set_ptr(&d->EG1ControllerAttackInfluence);
476 eEG1ControllerDecayInfluence.set_ptr(&d->EG1ControllerDecayInfluence);
477 eEG1ControllerReleaseInfluence.set_ptr(&d->EG1ControllerReleaseInfluence);
478 eLFO1Frequency.set_ptr(&d->LFO1Frequency);
479 eLFO1InternalDepth.set_ptr(&d->LFO1InternalDepth);
480 eLFO1ControlDepth.set_ptr(&d->LFO1ControlDepth);
481 eLFO1Controller.set_ptr(&d->LFO1Controller);
482 eLFO1FlipPhase.set_ptr(&d->LFO1FlipPhase);
483 eLFO1Sync.set_ptr(&d->LFO1Sync);
484 eEG2PreAttack.set_ptr(&d->EG2PreAttack);
485 eEG2Attack.set_ptr(&d->EG2Attack);
486 eEG2Decay1.set_ptr(&d->EG2Decay1);
487 eEG2Decay2.set_ptr(&d->EG2Decay2);
488 eEG2InfiniteSustain.set_ptr(&d->EG2InfiniteSustain);
489 eEG2Sustain.set_ptr(&d->EG2Sustain);
490 eEG2Release.set_ptr(&d->EG2Release);
491 eEG2Controller.set_ptr(&d->EG2Controller);
492 eEG2ControllerInvert.set_ptr(&d->EG2ControllerInvert);
493 eEG2ControllerAttackInfluence.set_ptr(&d->EG2ControllerAttackInfluence);
494 eEG2ControllerDecayInfluence.set_ptr(&d->EG2ControllerDecayInfluence);
495 eEG2ControllerReleaseInfluence.set_ptr(&d->EG2ControllerReleaseInfluence);
496 eLFO2Frequency.set_ptr(&d->LFO2Frequency);
497 eLFO2InternalDepth.set_ptr(&d->LFO2InternalDepth);
498 eLFO2ControlDepth.set_ptr(&d->LFO2ControlDepth);
499 eLFO2Controller.set_ptr(&d->LFO2Controller);
500 eLFO2FlipPhase.set_ptr(&d->LFO2FlipPhase);
501 eLFO2Sync.set_ptr(&d->LFO2Sync);
502 eEG3Attack.set_ptr(&d->EG3Attack);
503 eEG3Depth.set_ptr(&d->EG3Depth);
504 eLFO3Frequency.set_ptr(&d->LFO3Frequency);
505 eLFO3InternalDepth.set_ptr(&d->LFO3InternalDepth);
506 eLFO3ControlDepth.set_ptr(&d->LFO3ControlDepth);
507 eLFO3Controller.set_ptr(&d->LFO3Controller);
508 eLFO3Sync.set_ptr(&d->LFO3Sync);
509 eVCFEnabled.set_ptr(&d->VCFEnabled);
510 eVCFType.set_ptr(&d->VCFType);
511 eVCFCutoffController.set_ptr(&d->VCFCutoffController);
512 eVCFCutoffControllerInvert.set_ptr(&d->VCFCutoffControllerInvert);
513 eVCFCutoff.set_ptr(&d->VCFCutoff);
514 eVCFVelocityCurve.set_ptr(&d->VCFVelocityCurve);
515 eVCFVelocityScale.set_ptr(&d->VCFVelocityScale);
516 eVCFVelocityDynamicRange.set_ptr(&d->VCFVelocityDynamicRange);
517 eVCFResonance.set_ptr(&d->VCFResonance);
518 eVCFResonanceDynamic.set_ptr(&d->VCFResonanceDynamic);
519 eVCFResonanceController.set_ptr(&d->VCFResonanceController);
520 eVCFKeyboardTracking.set_ptr(&d->VCFKeyboardTracking);
521 eVCFKeyboardTrackingBreakpoint.set_ptr(&d->VCFKeyboardTrackingBreakpoint);
522 eVelocityResponseCurve.set_ptr(&d->VelocityResponseCurve);
523 eVelocityResponseDepth.set_ptr(&d->VelocityResponseDepth);
524 eVelocityResponseCurveScaling.set_ptr(&d->VelocityResponseCurveScaling);
525 eReleaseVelocityResponseCurve.set_ptr(&d->ReleaseVelocityResponseCurve);
526 eReleaseVelocityResponseDepth.set_ptr(&d->ReleaseVelocityResponseDepth);
527 eReleaseTriggerDecay.set_ptr(&d->ReleaseTriggerDecay);
528 eCrossfade_in_start.set_ptr(&d->Crossfade.in_start);
529 eCrossfade_in_end.set_ptr(&d->Crossfade.in_end);
530 eCrossfade_out_start.set_ptr(&d->Crossfade.out_start);
531 eCrossfade_out_end.set_ptr(&d->Crossfade.out_end);
532 ePitchTrack.set_ptr(&d->PitchTrack);
533 eDimensionBypass.set_ptr(&d->DimensionBypass);
534 ePan.set_ptr(&d->Pan);
535 eSelfMask.set_ptr(&d->SelfMask);
536 eAttenuationController.set_ptr(&d->AttenuationController);
537 eInvertAttenuationController.set_ptr(&d->InvertAttenuationController);
538 eAttenuationControllerThreshold.set_ptr(&d->AttenuationControllerThreshold);
539 eChannelOffset.set_ptr(&d->ChannelOffset);
540 eSustainDefeat.set_ptr(&d->SustainDefeat);
541 eMSDecode.set_ptr(&d->MSDecode);
542 eSampleStartOffset.set_ptr(&d->SampleStartOffset);
543 eUnityNote.set_ptr(&d->UnityNote);
544 eFineTune.set_ptr(&d->FineTune);
545 eGain.set_ptr(&d->Gain);
546 eGainPlus6.set_ptr(&d->Gain);
547 eSampleLoops.set_ptr(&d->SampleLoops);
548
549 VCFEnabled_toggled();
550
551 update_gui = true;
552 }
553
554 void DimRegionEdit::VCFEnabled_toggled()
555 {
556 bool sensitive = eVCFEnabled.get_active();
557 eVCFType.set_sensitive(sensitive);
558 eVCFCutoffController.set_sensitive(sensitive);
559 eVCFVelocityCurve.set_sensitive(sensitive);
560 eVCFVelocityScale.set_sensitive(sensitive);
561 eVCFVelocityDynamicRange.set_sensitive(sensitive);
562 eVCFResonance.set_sensitive(sensitive);
563 eVCFResonanceController.set_sensitive(sensitive);
564 eVCFKeyboardTracking.set_sensitive(sensitive);
565 eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive);
566 eEG2PreAttack.set_sensitive(sensitive);
567 eEG2Attack.set_sensitive(sensitive);
568 eEG2Decay1.set_sensitive(sensitive);
569 eEG2InfiniteSustain.set_sensitive(sensitive);
570 eEG2Sustain.set_sensitive(sensitive);
571 eEG2Release.set_sensitive(sensitive);
572 eEG2Controller.set_sensitive(sensitive);
573 eEG2ControllerAttackInfluence.set_sensitive(sensitive);
574 eEG2ControllerDecayInfluence.set_sensitive(sensitive);
575 eEG2ControllerReleaseInfluence.set_sensitive(sensitive);
576 eLFO2Frequency.set_sensitive(sensitive);
577 eLFO2InternalDepth.set_sensitive(sensitive);
578 eLFO2ControlDepth.set_sensitive(sensitive);
579 eLFO2Controller.set_sensitive(sensitive);
580 eLFO2FlipPhase.set_sensitive(sensitive);
581 eLFO2Sync.set_sensitive(sensitive);
582 if (sensitive) {
583 VCFCutoffController_changed();
584 VCFResonanceController_changed();
585 EG2InfiniteSustain_toggled();
586 EG2Controller_changed();
587 LFO2Controller_changed();
588 } else {
589 eVCFCutoffControllerInvert.set_sensitive(false);
590 eVCFCutoff.set_sensitive(false);
591 eVCFResonanceDynamic.set_sensitive(false);
592 eVCFResonance.set_sensitive(false);
593 eEG2Decay2.set_sensitive(false);
594 eEG2ControllerInvert.set_sensitive(false);
595 eLFO2InternalDepth.set_sensitive(false);
596 eLFO2ControlDepth.set_sensitive(false);
597 }
598 }
599
600 void DimRegionEdit::VCFCutoffController_changed()
601 {
602 int rowno = eVCFCutoffController.get_active_row_number();
603 bool hasController = rowno != 0 && rowno != 1;
604
605 eVCFCutoffControllerInvert.set_sensitive(hasController);
606 eVCFCutoff.set_sensitive(!hasController);
607 eVCFResonanceDynamic.set_sensitive(!hasController);
608 eVCFVelocityScale.label.set_text(hasController ? "MinimumCutoff:" :
609 "VelocityScale:");
610 }
611
612 void DimRegionEdit::VCFResonanceController_changed()
613 {
614 bool hasController = eVCFResonanceController.get_active_row_number() != 0;
615 eVCFResonance.set_sensitive(!hasController);
616 }
617
618 void DimRegionEdit::EG1InfiniteSustain_toggled()
619 {
620 bool infSus = eEG1InfiniteSustain.get_active();
621 eEG1Decay2.set_sensitive(!infSus);
622 }
623
624 void DimRegionEdit::EG2InfiniteSustain_toggled()
625 {
626 bool infSus = eEG2InfiniteSustain.get_active();
627 eEG2Decay2.set_sensitive(!infSus);
628 }
629
630 void DimRegionEdit::EG1Controller_changed()
631 {
632 bool hasController = eEG1Controller.get_active_row_number() != 0;
633 eEG1ControllerInvert.set_sensitive(hasController);
634 }
635
636 void DimRegionEdit::EG2Controller_changed()
637 {
638 bool hasController = eEG2Controller.get_active_row_number() != 0;
639 eEG2ControllerInvert.set_sensitive(hasController);
640 }
641
642 void DimRegionEdit::AttenuationController_changed()
643 {
644 bool hasController = eAttenuationController.get_active_row_number() != 0;
645 eInvertAttenuationController.set_sensitive(hasController);
646 }
647
648 void DimRegionEdit::LFO1Controller_changed()
649 {
650 int rowno = eLFO1Controller.get_active_row_number();
651 eLFO1ControlDepth.set_sensitive(rowno != 0);
652 eLFO1InternalDepth.set_sensitive(rowno != 1 && rowno != 2);
653 }
654
655 void DimRegionEdit::LFO2Controller_changed()
656 {
657 int rowno = eLFO2Controller.get_active_row_number();
658 eLFO2ControlDepth.set_sensitive(rowno != 0);
659 eLFO2InternalDepth.set_sensitive(rowno != 1 && rowno != 2);
660 }
661
662 void DimRegionEdit::LFO3Controller_changed()
663 {
664 int rowno = eLFO3Controller.get_active_row_number();
665 eLFO3ControlDepth.set_sensitive(rowno != 0);
666 eLFO3InternalDepth.set_sensitive(rowno != 1 && rowno != 2);
667 }
668
669 void DimRegionEdit::crossfade1_changed()
670 {
671 double c1 = eCrossfade_in_start.get_value();
672 double c2 = eCrossfade_in_end.get_value();
673 if (c1 > c2) eCrossfade_in_end.set_value(c1);
674 }
675
676 void DimRegionEdit::crossfade2_changed()
677 {
678 double c1 = eCrossfade_in_start.get_value();
679 double c2 = eCrossfade_in_end.get_value();
680 double c3 = eCrossfade_out_start.get_value();
681
682 if (c2 < c1) eCrossfade_in_start.set_value(c2);
683 if (c2 > c3) eCrossfade_out_start.set_value(c2);
684 }
685
686 void DimRegionEdit::crossfade3_changed()
687 {
688 double c2 = eCrossfade_in_end.get_value();
689 double c3 = eCrossfade_out_start.get_value();
690 double c4 = eCrossfade_out_end.get_value();
691
692 if (c3 < c2) eCrossfade_in_end.set_value(c3);
693 if (c3 > c4) eCrossfade_out_end.set_value(c3);
694 }
695
696 void DimRegionEdit::crossfade4_changed()
697 {
698 double c3 = eCrossfade_out_start.get_value();
699 double c4 = eCrossfade_out_end.get_value();
700
701 if (c4 < c3) eCrossfade_out_start.set_value(c4);
702 }

  ViewVC Help
Powered by ViewVC