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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1138 - (hide annotations) (download)
Sat Mar 31 09:33:40 2007 UTC (17 years ago) by persson
File size: 25204 byte(s)
* reworked instrument properties dialog - properties can now be edited
* code cleanup: removed the pointer to member usage in paramedit as it
  just made things more complicated

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

  ViewVC Help
Powered by ViewVC