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