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