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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1150 - (hide annotations) (download)
Sun Apr 8 00:14:17 2007 UTC (16 years, 10 months ago) by schoenebeck
File size: 25594 byte(s)
* restructured dimension region editor for elements to be in a more
  logical and intuitive order

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

  ViewVC Help
Powered by ViewVC