1 |
/* |
2 |
* Copyright (C) 2006-2010 Andreas Persson |
3 |
* |
4 |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
6 |
* published by the Free Software Foundation; either version 2, or (at |
7 |
* your option) any later version. |
8 |
* |
9 |
* This program is distributed in the hope that it will be useful, but |
10 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
* General Public License for more details. |
13 |
* |
14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with program; see the file COPYING. If not, write to the Free |
16 |
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
17 |
* 02110-1301 USA. |
18 |
*/ |
19 |
|
20 |
#include "dimregionedit.h" |
21 |
|
22 |
#include "global.h" |
23 |
|
24 |
DimRegionEdit::DimRegionEdit() : |
25 |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
26 |
eEG1Attack(_("Attack"), 0, 60, 3), |
27 |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
28 |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
29 |
eEG1InfiniteSustain(_("Infinite sustain")), |
30 |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
31 |
eEG1Release(_("Release"), 0, 60, 3), |
32 |
eEG1Hold(_("Hold")), |
33 |
eEG1Controller(_("Controller")), |
34 |
eEG1ControllerInvert(_("Controller invert")), |
35 |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
36 |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
37 |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
38 |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
39 |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
40 |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
41 |
eLFO1Controller(_("Controller")), |
42 |
eLFO1FlipPhase(_("Flip phase")), |
43 |
eLFO1Sync(_("Sync")), |
44 |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
45 |
eEG2Attack(_("Attack"), 0, 60, 3), |
46 |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
47 |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
48 |
eEG2InfiniteSustain(_("Infinite sustain")), |
49 |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
50 |
eEG2Release(_("Release"), 0, 60, 3), |
51 |
eEG2Controller(_("Controller")), |
52 |
eEG2ControllerInvert(_("Controller invert")), |
53 |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
54 |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
55 |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
56 |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
57 |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
58 |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
59 |
eLFO2Controller(_("Controller")), |
60 |
eLFO2FlipPhase(_("Flip phase")), |
61 |
eLFO2Sync(_("Sync")), |
62 |
eEG3Attack(_("Attack"), 0, 10, 3), |
63 |
eEG3Depth(_("Depth"), -1200, 1200), |
64 |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
65 |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
66 |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
67 |
eLFO3Controller(_("Controller")), |
68 |
eLFO3Sync(_("Sync")), |
69 |
eVCFEnabled(_("Enabled")), |
70 |
eVCFType(_("Type")), |
71 |
eVCFCutoffController(_("Cutoff controller")), |
72 |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
73 |
eVCFCutoff(_("Cutoff")), |
74 |
eVCFVelocityCurve(_("Velocity curve")), |
75 |
eVCFVelocityScale(_("Velocity scale")), |
76 |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
77 |
eVCFResonance(_("Resonance")), |
78 |
eVCFResonanceDynamic(_("Resonance dynamic")), |
79 |
eVCFResonanceController(_("Resonance controller")), |
80 |
eVCFKeyboardTracking(_("Keyboard tracking")), |
81 |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
82 |
eVelocityResponseCurve(_("Velocity response curve")), |
83 |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
84 |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
85 |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
86 |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
87 |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
88 |
eCrossfade_in_start(_("Crossfade-in start")), |
89 |
eCrossfade_in_end(_("Crossfade-in end")), |
90 |
eCrossfade_out_start(_("Crossfade-out start")), |
91 |
eCrossfade_out_end(_("Crossfade-out end")), |
92 |
ePitchTrack(_("Pitch track")), |
93 |
eDimensionBypass(_("Dimension bypass")), |
94 |
ePan(_("Pan"), -64, 63), |
95 |
eSelfMask(_("Self mask")), |
96 |
eAttenuationController(_("Attenuation controller")), |
97 |
eInvertAttenuationController(_("Invert attenuation controller")), |
98 |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
99 |
eChannelOffset(_("Channel offset"), 0, 9), |
100 |
eSustainDefeat(_("Sustain defeat")), |
101 |
eMSDecode(_("MS decode")), |
102 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
103 |
eUnityNote(_("Unity note")), |
104 |
eFineTune(_("Fine tune"), -49, 50), |
105 |
eGain(_("Gain"), -96, 0, 2, -655360), |
106 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
107 |
eSampleLoopEnabled(_("Enabled")), |
108 |
eSampleLoopStart(_("Loop start positon")), |
109 |
eSampleLoopLength(_("Loop size")), |
110 |
eSampleLoopType(_("Loop type")), |
111 |
eSampleLoopInfinite(_("Infinite loop")), |
112 |
eSampleLoopPlayCount(_("Playback count"), 1), |
113 |
update_model(0) |
114 |
{ |
115 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
116 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
117 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
118 |
connect(eEG1Decay2, &gig::DimensionRegion::EG1Decay2); |
119 |
connect(eEG1InfiniteSustain, &gig::DimensionRegion::EG1InfiniteSustain); |
120 |
connect(eEG1Sustain, &gig::DimensionRegion::EG1Sustain); |
121 |
connect(eEG1Release, &gig::DimensionRegion::EG1Release); |
122 |
connect(eEG1Hold, &gig::DimensionRegion::EG1Hold); |
123 |
connect(eEG1Controller, &gig::DimensionRegion::EG1Controller); |
124 |
connect(eEG1ControllerInvert, &gig::DimensionRegion::EG1ControllerInvert); |
125 |
connect(eEG1ControllerAttackInfluence, |
126 |
&gig::DimensionRegion::EG1ControllerAttackInfluence); |
127 |
connect(eEG1ControllerDecayInfluence, |
128 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
129 |
connect(eEG1ControllerReleaseInfluence, |
130 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
131 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
132 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
133 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
134 |
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
135 |
connect(eLFO1FlipPhase, &gig::DimensionRegion::LFO1FlipPhase); |
136 |
connect(eLFO1Sync, &gig::DimensionRegion::LFO1Sync); |
137 |
connect(eEG2PreAttack, &gig::DimensionRegion::EG2PreAttack); |
138 |
connect(eEG2Attack, &gig::DimensionRegion::EG2Attack); |
139 |
connect(eEG2Decay1, &gig::DimensionRegion::EG2Decay1); |
140 |
connect(eEG2Decay2, &gig::DimensionRegion::EG2Decay2); |
141 |
connect(eEG2InfiniteSustain, &gig::DimensionRegion::EG2InfiniteSustain); |
142 |
connect(eEG2Sustain, &gig::DimensionRegion::EG2Sustain); |
143 |
connect(eEG2Release, &gig::DimensionRegion::EG2Release); |
144 |
connect(eEG2Controller, &gig::DimensionRegion::EG2Controller); |
145 |
connect(eEG2ControllerInvert, &gig::DimensionRegion::EG2ControllerInvert); |
146 |
connect(eEG2ControllerAttackInfluence, |
147 |
&gig::DimensionRegion::EG2ControllerAttackInfluence); |
148 |
connect(eEG2ControllerDecayInfluence, |
149 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
150 |
connect(eEG2ControllerReleaseInfluence, |
151 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
152 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
153 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
154 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
155 |
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
156 |
connect(eLFO2FlipPhase, &gig::DimensionRegion::LFO2FlipPhase); |
157 |
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
158 |
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
159 |
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
160 |
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
161 |
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
162 |
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
163 |
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
164 |
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
165 |
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
166 |
connect(eVCFType, &gig::DimensionRegion::VCFType); |
167 |
connect(eVCFCutoffController, |
168 |
&gig::DimensionRegion::SetVCFCutoffController); |
169 |
connect(eVCFCutoffControllerInvert, |
170 |
&gig::DimensionRegion::VCFCutoffControllerInvert); |
171 |
connect(eVCFCutoff, &gig::DimensionRegion::VCFCutoff); |
172 |
connect(eVCFVelocityCurve, &gig::DimensionRegion::SetVCFVelocityCurve); |
173 |
connect(eVCFVelocityScale, &gig::DimensionRegion::SetVCFVelocityScale); |
174 |
connect(eVCFVelocityDynamicRange, |
175 |
&gig::DimensionRegion::SetVCFVelocityDynamicRange); |
176 |
connect(eVCFResonance, &gig::DimensionRegion::VCFResonance); |
177 |
connect(eVCFResonanceDynamic, &gig::DimensionRegion::VCFResonanceDynamic); |
178 |
connect(eVCFResonanceController, |
179 |
&gig::DimensionRegion::VCFResonanceController); |
180 |
connect(eVCFKeyboardTracking, &gig::DimensionRegion::VCFKeyboardTracking); |
181 |
connect(eVCFKeyboardTrackingBreakpoint, |
182 |
&gig::DimensionRegion::VCFKeyboardTrackingBreakpoint); |
183 |
connect(eVelocityResponseCurve, |
184 |
&gig::DimensionRegion::SetVelocityResponseCurve); |
185 |
connect(eVelocityResponseDepth, |
186 |
&gig::DimensionRegion::SetVelocityResponseDepth); |
187 |
connect(eVelocityResponseCurveScaling, |
188 |
&gig::DimensionRegion::SetVelocityResponseCurveScaling); |
189 |
connect(eReleaseVelocityResponseCurve, |
190 |
&gig::DimensionRegion::SetReleaseVelocityResponseCurve); |
191 |
connect(eReleaseVelocityResponseDepth, |
192 |
&gig::DimensionRegion::SetReleaseVelocityResponseDepth); |
193 |
connect(eReleaseTriggerDecay, &gig::DimensionRegion::ReleaseTriggerDecay); |
194 |
connect(eCrossfade_in_start, &DimRegionEdit::set_Crossfade_in_start); |
195 |
connect(eCrossfade_in_end, &DimRegionEdit::set_Crossfade_in_end); |
196 |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
197 |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
198 |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
199 |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
200 |
connect(ePan, &gig::DimensionRegion::Pan); |
201 |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
202 |
connect(eAttenuationController, |
203 |
&gig::DimensionRegion::AttenuationController); |
204 |
connect(eInvertAttenuationController, |
205 |
&gig::DimensionRegion::InvertAttenuationController); |
206 |
connect(eAttenuationControllerThreshold, |
207 |
&gig::DimensionRegion::AttenuationControllerThreshold); |
208 |
connect(eChannelOffset, &gig::DimensionRegion::ChannelOffset); |
209 |
connect(eSustainDefeat, &gig::DimensionRegion::SustainDefeat); |
210 |
connect(eMSDecode, &gig::DimensionRegion::MSDecode); |
211 |
connect(eSampleStartOffset, &gig::DimensionRegion::SampleStartOffset); |
212 |
connect(eUnityNote, &DimRegionEdit::set_UnityNote); |
213 |
connect(eFineTune, &DimRegionEdit::set_FineTune); |
214 |
connect(eGain, &DimRegionEdit::set_Gain); |
215 |
connect(eGainPlus6, &DimRegionEdit::set_Gain); |
216 |
connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled); |
217 |
connect(eSampleLoopType, &DimRegionEdit::set_LoopType); |
218 |
connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart); |
219 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
220 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
221 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
222 |
|
223 |
for (int i = 0 ; i < 7 ; i++) { |
224 |
table[i] = new Gtk::Table(3, 1); |
225 |
table[i]->set_col_spacings(7); |
226 |
} |
227 |
|
228 |
// set tooltips |
229 |
eUnityNote.set_tip( |
230 |
_("Note this sample is associated with (a.k.a. 'root note')") |
231 |
); |
232 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
233 |
ePan.set_tip(_("Stereo balance (left/right)")); |
234 |
eChannelOffset.set_tip( |
235 |
_("Output channel where the audio signal should be routed to (0 - 9)") |
236 |
); |
237 |
ePitchTrack.set_tip( |
238 |
_("If true: sample will be pitched according to the key position " |
239 |
"(this would be disabled for drums for example)") |
240 |
); |
241 |
eSampleLoopEnabled.set_tip(_("If enabled: repeats to playback the sample")); |
242 |
eSampleLoopStart.set_tip( |
243 |
_("Start position within the sample (in sample points) of the area to " |
244 |
"be looped") |
245 |
); |
246 |
eSampleLoopLength.set_tip( |
247 |
_("Duration (in sample points) of the area to be looped") |
248 |
); |
249 |
eSampleLoopType.set_tip( |
250 |
_("Direction in which the loop area in the sample should be played back") |
251 |
); |
252 |
eSampleLoopInfinite.set_tip( |
253 |
_("Whether the loop area should be played back forever\n" |
254 |
"Caution: this setting is stored on Sample side, thus is shared " |
255 |
"among all dimension regions that use this sample!") |
256 |
); |
257 |
eSampleLoopPlayCount.set_tip( |
258 |
_("How many times the loop area should be played back\n" |
259 |
"Caution: this setting is stored on Sample side, thus is shared " |
260 |
"among all dimension regions that use this sample!") |
261 |
); |
262 |
|
263 |
pageno = 0; |
264 |
rowno = 0; |
265 |
firstRowInBlock = 0; |
266 |
|
267 |
addHeader(_("Mandatory Settings")); |
268 |
addString(_("Sample"), lSample, wSample); |
269 |
//TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false); |
270 |
#ifdef OLD_TOOLTIPS |
271 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
272 |
#else |
273 |
wSample->set_tooltip_text(_("Drop a sample here")); |
274 |
#endif |
275 |
addProp(eUnityNote); |
276 |
addHeader(_("Optional Settings")); |
277 |
addProp(eSampleStartOffset); |
278 |
addProp(eChannelOffset); |
279 |
addHeader(_("Loops")); |
280 |
addProp(eSampleLoopEnabled); |
281 |
addProp(eSampleLoopStart); |
282 |
addProp(eSampleLoopLength); |
283 |
{ |
284 |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
285 |
static const uint32_t values[] = { |
286 |
gig::loop_type_normal, |
287 |
gig::loop_type_bidirectional, |
288 |
gig::loop_type_backward |
289 |
}; |
290 |
eSampleLoopType.set_choices(choices, values); |
291 |
} |
292 |
addProp(eSampleLoopType); |
293 |
addProp(eSampleLoopInfinite); |
294 |
addProp(eSampleLoopPlayCount); |
295 |
|
296 |
nextPage(); |
297 |
|
298 |
addHeader(_("General Amplitude Settings")); |
299 |
addProp(eGain); |
300 |
addProp(eGainPlus6); |
301 |
addProp(ePan); |
302 |
addHeader(_("Amplitude Envelope (EG1)")); |
303 |
addProp(eEG1PreAttack); |
304 |
addProp(eEG1Attack); |
305 |
addProp(eEG1Decay1); |
306 |
addProp(eEG1Decay2); |
307 |
addProp(eEG1InfiniteSustain); |
308 |
addProp(eEG1Sustain); |
309 |
addProp(eEG1Release); |
310 |
addProp(eEG1Hold); |
311 |
addProp(eEG1Controller); |
312 |
addProp(eEG1ControllerInvert); |
313 |
addProp(eEG1ControllerAttackInfluence); |
314 |
addProp(eEG1ControllerDecayInfluence); |
315 |
addProp(eEG1ControllerReleaseInfluence); |
316 |
|
317 |
nextPage(); |
318 |
|
319 |
addHeader(_("Amplitude Oscillator (LFO1)")); |
320 |
addProp(eLFO1Frequency); |
321 |
addProp(eLFO1InternalDepth); |
322 |
addProp(eLFO1ControlDepth); |
323 |
{ |
324 |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
325 |
_("internal+modwheel"), _("internal+breath"), 0 }; |
326 |
static const gig::lfo1_ctrl_t values[] = { |
327 |
gig::lfo1_ctrl_internal, |
328 |
gig::lfo1_ctrl_modwheel, |
329 |
gig::lfo1_ctrl_breath, |
330 |
gig::lfo1_ctrl_internal_modwheel, |
331 |
gig::lfo1_ctrl_internal_breath |
332 |
}; |
333 |
eLFO1Controller.set_choices(choices, values); |
334 |
} |
335 |
addProp(eLFO1Controller); |
336 |
addProp(eLFO1FlipPhase); |
337 |
addProp(eLFO1Sync); |
338 |
addHeader(_("Crossfade")); |
339 |
addProp(eAttenuationController); |
340 |
addProp(eInvertAttenuationController); |
341 |
addProp(eAttenuationControllerThreshold); |
342 |
addProp(eCrossfade_in_start); |
343 |
addProp(eCrossfade_in_end); |
344 |
addProp(eCrossfade_out_start); |
345 |
addProp(eCrossfade_out_end); |
346 |
|
347 |
nextPage(); |
348 |
|
349 |
addHeader(_("General Filter Settings")); |
350 |
addProp(eVCFEnabled); |
351 |
{ |
352 |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
353 |
_("highpass"), _("bandreject"), 0 }; |
354 |
static const gig::vcf_type_t values[] = { |
355 |
gig::vcf_type_lowpass, |
356 |
gig::vcf_type_lowpassturbo, |
357 |
gig::vcf_type_bandpass, |
358 |
gig::vcf_type_highpass, |
359 |
gig::vcf_type_bandreject |
360 |
}; |
361 |
eVCFType.set_choices(choices, values); |
362 |
} |
363 |
addProp(eVCFType); |
364 |
{ |
365 |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
366 |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
367 |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
368 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
369 |
gig::vcf_cutoff_ctrl_none, |
370 |
gig::vcf_cutoff_ctrl_none2, |
371 |
gig::vcf_cutoff_ctrl_modwheel, |
372 |
gig::vcf_cutoff_ctrl_effect1, |
373 |
gig::vcf_cutoff_ctrl_effect2, |
374 |
gig::vcf_cutoff_ctrl_breath, |
375 |
gig::vcf_cutoff_ctrl_foot, |
376 |
gig::vcf_cutoff_ctrl_sustainpedal, |
377 |
gig::vcf_cutoff_ctrl_softpedal, |
378 |
gig::vcf_cutoff_ctrl_genpurpose7, |
379 |
gig::vcf_cutoff_ctrl_genpurpose8, |
380 |
gig::vcf_cutoff_ctrl_aftertouch |
381 |
}; |
382 |
eVCFCutoffController.set_choices(choices, values); |
383 |
} |
384 |
addProp(eVCFCutoffController); |
385 |
addProp(eVCFCutoffControllerInvert); |
386 |
addProp(eVCFCutoff); |
387 |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
388 |
static const gig::curve_type_t curve_type_values[] = { |
389 |
gig::curve_type_nonlinear, |
390 |
gig::curve_type_linear, |
391 |
gig::curve_type_special |
392 |
}; |
393 |
eVCFVelocityCurve.set_choices(curve_type_texts, curve_type_values); |
394 |
addProp(eVCFVelocityCurve); |
395 |
addProp(eVCFVelocityScale); |
396 |
addProp(eVCFVelocityDynamicRange); |
397 |
addProp(eVCFResonance); |
398 |
addProp(eVCFResonanceDynamic); |
399 |
{ |
400 |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
401 |
_("genpurpose5"), _("genpurpose6"), 0 }; |
402 |
static const gig::vcf_res_ctrl_t values[] = { |
403 |
gig::vcf_res_ctrl_none, |
404 |
gig::vcf_res_ctrl_genpurpose3, |
405 |
gig::vcf_res_ctrl_genpurpose4, |
406 |
gig::vcf_res_ctrl_genpurpose5, |
407 |
gig::vcf_res_ctrl_genpurpose6 |
408 |
}; |
409 |
eVCFResonanceController.set_choices(choices, values); |
410 |
} |
411 |
addProp(eVCFResonanceController); |
412 |
addProp(eVCFKeyboardTracking); |
413 |
addProp(eVCFKeyboardTrackingBreakpoint); |
414 |
|
415 |
nextPage(); |
416 |
|
417 |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
418 |
addProp(eEG2PreAttack); |
419 |
addProp(eEG2Attack); |
420 |
addProp(eEG2Decay1); |
421 |
addProp(eEG2Decay2); |
422 |
addProp(eEG2InfiniteSustain); |
423 |
addProp(eEG2Sustain); |
424 |
addProp(eEG2Release); |
425 |
addProp(eEG2Controller); |
426 |
addProp(eEG2ControllerInvert); |
427 |
addProp(eEG2ControllerAttackInfluence); |
428 |
addProp(eEG2ControllerDecayInfluence); |
429 |
addProp(eEG2ControllerReleaseInfluence); |
430 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
431 |
addProp(eLFO2Frequency); |
432 |
addProp(eLFO2InternalDepth); |
433 |
addProp(eLFO2ControlDepth); |
434 |
{ |
435 |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
436 |
_("internal+modwheel"), _("internal+foot"), 0 }; |
437 |
static const gig::lfo2_ctrl_t values[] = { |
438 |
gig::lfo2_ctrl_internal, |
439 |
gig::lfo2_ctrl_modwheel, |
440 |
gig::lfo2_ctrl_foot, |
441 |
gig::lfo2_ctrl_internal_modwheel, |
442 |
gig::lfo2_ctrl_internal_foot |
443 |
}; |
444 |
eLFO2Controller.set_choices(choices, values); |
445 |
} |
446 |
addProp(eLFO2Controller); |
447 |
addProp(eLFO2FlipPhase); |
448 |
addProp(eLFO2Sync); |
449 |
|
450 |
nextPage(); |
451 |
|
452 |
addHeader(_("General Pitch Settings")); |
453 |
addProp(eFineTune); |
454 |
addProp(ePitchTrack); |
455 |
addHeader(_("Pitch Envelope (EG3)")); |
456 |
addProp(eEG3Attack); |
457 |
addProp(eEG3Depth); |
458 |
addHeader(_("Pitch Oscillator (LFO3)")); |
459 |
addProp(eLFO3Frequency); |
460 |
addProp(eLFO3InternalDepth); |
461 |
addProp(eLFO3ControlDepth); |
462 |
{ |
463 |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
464 |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
465 |
static const gig::lfo3_ctrl_t values[] = { |
466 |
gig::lfo3_ctrl_internal, |
467 |
gig::lfo3_ctrl_modwheel, |
468 |
gig::lfo3_ctrl_aftertouch, |
469 |
gig::lfo3_ctrl_internal_modwheel, |
470 |
gig::lfo3_ctrl_internal_aftertouch |
471 |
}; |
472 |
eLFO3Controller.set_choices(choices, values); |
473 |
} |
474 |
addProp(eLFO3Controller); |
475 |
addProp(eLFO3Sync); |
476 |
|
477 |
nextPage(); |
478 |
|
479 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
480 |
addProp(eVelocityResponseCurve); |
481 |
addProp(eVelocityResponseDepth); |
482 |
addProp(eVelocityResponseCurveScaling); |
483 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
484 |
curve_type_values); |
485 |
addProp(eReleaseVelocityResponseCurve); |
486 |
addProp(eReleaseVelocityResponseDepth); |
487 |
addProp(eReleaseTriggerDecay); |
488 |
{ |
489 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
490 |
static const gig::dim_bypass_ctrl_t values[] = { |
491 |
gig::dim_bypass_ctrl_none, |
492 |
gig::dim_bypass_ctrl_94, |
493 |
gig::dim_bypass_ctrl_95 |
494 |
}; |
495 |
eDimensionBypass.set_choices(choices, values); |
496 |
} |
497 |
addProp(eDimensionBypass); |
498 |
addProp(eSelfMask); |
499 |
addProp(eSustainDefeat); |
500 |
addProp(eMSDecode); |
501 |
|
502 |
nextPage(); |
503 |
|
504 |
|
505 |
eEG1InfiniteSustain.signal_value_changed().connect( |
506 |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled)); |
507 |
eEG2InfiniteSustain.signal_value_changed().connect( |
508 |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled)); |
509 |
eEG1Controller.signal_value_changed().connect( |
510 |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed)); |
511 |
eEG2Controller.signal_value_changed().connect( |
512 |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed)); |
513 |
eLFO1Controller.signal_value_changed().connect( |
514 |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed)); |
515 |
eLFO2Controller.signal_value_changed().connect( |
516 |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed)); |
517 |
eLFO3Controller.signal_value_changed().connect( |
518 |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed)); |
519 |
eAttenuationController.signal_value_changed().connect( |
520 |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed)); |
521 |
eVCFEnabled.signal_value_changed().connect( |
522 |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled)); |
523 |
eVCFCutoffController.signal_value_changed().connect( |
524 |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed)); |
525 |
eVCFResonanceController.signal_value_changed().connect( |
526 |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed)); |
527 |
|
528 |
eCrossfade_in_start.signal_value_changed().connect( |
529 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
530 |
eCrossfade_in_end.signal_value_changed().connect( |
531 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
532 |
eCrossfade_out_start.signal_value_changed().connect( |
533 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
534 |
eCrossfade_out_end.signal_value_changed().connect( |
535 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
536 |
|
537 |
eSampleLoopEnabled.signal_value_changed().connect( |
538 |
sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements)); |
539 |
eSampleLoopStart.signal_value_changed().connect( |
540 |
sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed)); |
541 |
eSampleLoopLength.signal_value_changed().connect( |
542 |
sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed)); |
543 |
eSampleLoopInfinite.signal_value_changed().connect( |
544 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
545 |
|
546 |
append_page(*table[0], _("Sample")); |
547 |
append_page(*table[1], _("Amplitude (1)")); |
548 |
append_page(*table[2], _("Amplitude (2)")); |
549 |
append_page(*table[3], _("Filter (1)")); |
550 |
append_page(*table[4], _("Filter (2)")); |
551 |
append_page(*table[5], _("Pitch")); |
552 |
append_page(*table[6], _("Misc")); |
553 |
} |
554 |
|
555 |
DimRegionEdit::~DimRegionEdit() |
556 |
{ |
557 |
} |
558 |
|
559 |
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
560 |
Gtk::Entry*& widget) |
561 |
{ |
562 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
563 |
label->set_alignment(Gtk::ALIGN_LEFT); |
564 |
|
565 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
566 |
Gtk::FILL, Gtk::SHRINK); |
567 |
|
568 |
widget = new Gtk::Entry(); |
569 |
|
570 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
571 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
572 |
|
573 |
rowno++; |
574 |
} |
575 |
|
576 |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
577 |
{ |
578 |
if (firstRowInBlock < rowno - 1) |
579 |
{ |
580 |
Gtk::Label* filler = new Gtk::Label(" "); |
581 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
582 |
Gtk::FILL, Gtk::SHRINK); |
583 |
} |
584 |
Glib::ustring str = "<b>"; |
585 |
str += text; |
586 |
str += "</b>"; |
587 |
Gtk::Label* label = new Gtk::Label(str); |
588 |
label->set_use_markup(); |
589 |
label->set_alignment(Gtk::ALIGN_LEFT); |
590 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
591 |
Gtk::FILL, Gtk::SHRINK); |
592 |
rowno++; |
593 |
firstRowInBlock = rowno; |
594 |
return label; |
595 |
} |
596 |
|
597 |
void DimRegionEdit::nextPage() |
598 |
{ |
599 |
if (firstRowInBlock < rowno - 1) |
600 |
{ |
601 |
Gtk::Label* filler = new Gtk::Label(" "); |
602 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
603 |
Gtk::FILL, Gtk::SHRINK); |
604 |
} |
605 |
pageno++; |
606 |
rowno = 0; |
607 |
firstRowInBlock = 0; |
608 |
} |
609 |
|
610 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
611 |
{ |
612 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
613 |
Gtk::FILL, Gtk::SHRINK); |
614 |
rowno++; |
615 |
} |
616 |
|
617 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
618 |
{ |
619 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
620 |
Gtk::FILL, Gtk::SHRINK); |
621 |
rowno++; |
622 |
} |
623 |
|
624 |
void DimRegionEdit::addProp(LabelWidget& prop) |
625 |
{ |
626 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
627 |
Gtk::FILL, Gtk::SHRINK); |
628 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
629 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
630 |
rowno++; |
631 |
} |
632 |
|
633 |
|
634 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
635 |
{ |
636 |
dimregion = d; |
637 |
|
638 |
set_sensitive(d); |
639 |
if (!d) return; |
640 |
|
641 |
update_model++; |
642 |
eEG1PreAttack.set_value(d->EG1PreAttack); |
643 |
eEG1Attack.set_value(d->EG1Attack); |
644 |
eEG1Decay1.set_value(d->EG1Decay1); |
645 |
eEG1Decay2.set_value(d->EG1Decay2); |
646 |
eEG1InfiniteSustain.set_value(d->EG1InfiniteSustain); |
647 |
eEG1Sustain.set_value(d->EG1Sustain); |
648 |
eEG1Release.set_value(d->EG1Release); |
649 |
eEG1Hold.set_value(d->EG1Hold); |
650 |
eEG1Controller.set_value(d->EG1Controller); |
651 |
eEG1ControllerInvert.set_value(d->EG1ControllerInvert); |
652 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
653 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
654 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
655 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
656 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
657 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
658 |
eLFO1Controller.set_value(d->LFO1Controller); |
659 |
eLFO1FlipPhase.set_value(d->LFO1FlipPhase); |
660 |
eLFO1Sync.set_value(d->LFO1Sync); |
661 |
eEG2PreAttack.set_value(d->EG2PreAttack); |
662 |
eEG2Attack.set_value(d->EG2Attack); |
663 |
eEG2Decay1.set_value(d->EG2Decay1); |
664 |
eEG2Decay2.set_value(d->EG2Decay2); |
665 |
eEG2InfiniteSustain.set_value(d->EG2InfiniteSustain); |
666 |
eEG2Sustain.set_value(d->EG2Sustain); |
667 |
eEG2Release.set_value(d->EG2Release); |
668 |
eEG2Controller.set_value(d->EG2Controller); |
669 |
eEG2ControllerInvert.set_value(d->EG2ControllerInvert); |
670 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
671 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
672 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
673 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
674 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
675 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
676 |
eLFO2Controller.set_value(d->LFO2Controller); |
677 |
eLFO2FlipPhase.set_value(d->LFO2FlipPhase); |
678 |
eLFO2Sync.set_value(d->LFO2Sync); |
679 |
eEG3Attack.set_value(d->EG3Attack); |
680 |
eEG3Depth.set_value(d->EG3Depth); |
681 |
eLFO3Frequency.set_value(d->LFO3Frequency); |
682 |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
683 |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
684 |
eLFO3Controller.set_value(d->LFO3Controller); |
685 |
eLFO3Sync.set_value(d->LFO3Sync); |
686 |
eVCFEnabled.set_value(d->VCFEnabled); |
687 |
eVCFType.set_value(d->VCFType); |
688 |
eVCFCutoffController.set_value(d->VCFCutoffController); |
689 |
eVCFCutoffControllerInvert.set_value(d->VCFCutoffControllerInvert); |
690 |
eVCFCutoff.set_value(d->VCFCutoff); |
691 |
eVCFVelocityCurve.set_value(d->VCFVelocityCurve); |
692 |
eVCFVelocityScale.set_value(d->VCFVelocityScale); |
693 |
eVCFVelocityDynamicRange.set_value(d->VCFVelocityDynamicRange); |
694 |
eVCFResonance.set_value(d->VCFResonance); |
695 |
eVCFResonanceDynamic.set_value(d->VCFResonanceDynamic); |
696 |
eVCFResonanceController.set_value(d->VCFResonanceController); |
697 |
eVCFKeyboardTracking.set_value(d->VCFKeyboardTracking); |
698 |
eVCFKeyboardTrackingBreakpoint.set_value(d->VCFKeyboardTrackingBreakpoint); |
699 |
eVelocityResponseCurve.set_value(d->VelocityResponseCurve); |
700 |
eVelocityResponseDepth.set_value(d->VelocityResponseDepth); |
701 |
eVelocityResponseCurveScaling.set_value(d->VelocityResponseCurveScaling); |
702 |
eReleaseVelocityResponseCurve.set_value(d->ReleaseVelocityResponseCurve); |
703 |
eReleaseVelocityResponseDepth.set_value(d->ReleaseVelocityResponseDepth); |
704 |
eReleaseTriggerDecay.set_value(d->ReleaseTriggerDecay); |
705 |
eCrossfade_in_start.set_value(d->Crossfade.in_start); |
706 |
eCrossfade_in_end.set_value(d->Crossfade.in_end); |
707 |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
708 |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
709 |
ePitchTrack.set_value(d->PitchTrack); |
710 |
eDimensionBypass.set_value(d->DimensionBypass); |
711 |
ePan.set_value(d->Pan); |
712 |
eSelfMask.set_value(d->SelfMask); |
713 |
eAttenuationController.set_value(d->AttenuationController); |
714 |
eInvertAttenuationController.set_value(d->InvertAttenuationController); |
715 |
eAttenuationControllerThreshold.set_value(d->AttenuationControllerThreshold); |
716 |
eChannelOffset.set_value(d->ChannelOffset); |
717 |
eSustainDefeat.set_value(d->SustainDefeat); |
718 |
eMSDecode.set_value(d->MSDecode); |
719 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
720 |
eUnityNote.set_value(d->UnityNote); |
721 |
eFineTune.set_value(d->FineTune); |
722 |
eGain.set_value(d->Gain); |
723 |
eGainPlus6.set_value(d->Gain); |
724 |
eSampleLoopEnabled.set_value(d->SampleLoops); |
725 |
eSampleLoopType.set_value( |
726 |
d->SampleLoops ? d->pSampleLoops[0].LoopType : 0); |
727 |
eSampleLoopStart.set_value( |
728 |
d->SampleLoops ? d->pSampleLoops[0].LoopStart : 0); |
729 |
eSampleLoopLength.set_value( |
730 |
d->SampleLoops ? d->pSampleLoops[0].LoopLength : 0); |
731 |
eSampleLoopInfinite.set_value( |
732 |
d->pSample && d->pSample->LoopPlayCount == 0); |
733 |
eSampleLoopPlayCount.set_value( |
734 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
735 |
update_model--; |
736 |
|
737 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
738 |
|
739 |
update_loop_elements(); |
740 |
VCFEnabled_toggled(); |
741 |
} |
742 |
|
743 |
|
744 |
void DimRegionEdit::VCFEnabled_toggled() |
745 |
{ |
746 |
bool sensitive = eVCFEnabled.get_value(); |
747 |
eVCFType.set_sensitive(sensitive); |
748 |
eVCFCutoffController.set_sensitive(sensitive); |
749 |
eVCFVelocityCurve.set_sensitive(sensitive); |
750 |
eVCFVelocityScale.set_sensitive(sensitive); |
751 |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
752 |
eVCFResonance.set_sensitive(sensitive); |
753 |
eVCFResonanceController.set_sensitive(sensitive); |
754 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
755 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
756 |
lEG2->set_sensitive(sensitive); |
757 |
eEG2PreAttack.set_sensitive(sensitive); |
758 |
eEG2Attack.set_sensitive(sensitive); |
759 |
eEG2Decay1.set_sensitive(sensitive); |
760 |
eEG2InfiniteSustain.set_sensitive(sensitive); |
761 |
eEG2Sustain.set_sensitive(sensitive); |
762 |
eEG2Release.set_sensitive(sensitive); |
763 |
eEG2Controller.set_sensitive(sensitive); |
764 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
765 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
766 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
767 |
lLFO2->set_sensitive(sensitive); |
768 |
eLFO2Frequency.set_sensitive(sensitive); |
769 |
eLFO2InternalDepth.set_sensitive(sensitive); |
770 |
eLFO2ControlDepth.set_sensitive(sensitive); |
771 |
eLFO2Controller.set_sensitive(sensitive); |
772 |
eLFO2FlipPhase.set_sensitive(sensitive); |
773 |
eLFO2Sync.set_sensitive(sensitive); |
774 |
if (sensitive) { |
775 |
VCFCutoffController_changed(); |
776 |
VCFResonanceController_changed(); |
777 |
EG2InfiniteSustain_toggled(); |
778 |
EG2Controller_changed(); |
779 |
LFO2Controller_changed(); |
780 |
} else { |
781 |
eVCFCutoffControllerInvert.set_sensitive(false); |
782 |
eVCFCutoff.set_sensitive(false); |
783 |
eVCFResonanceDynamic.set_sensitive(false); |
784 |
eVCFResonance.set_sensitive(false); |
785 |
eEG2Decay2.set_sensitive(false); |
786 |
eEG2ControllerInvert.set_sensitive(false); |
787 |
eLFO2InternalDepth.set_sensitive(false); |
788 |
eLFO2ControlDepth.set_sensitive(false); |
789 |
} |
790 |
} |
791 |
|
792 |
void DimRegionEdit::VCFCutoffController_changed() |
793 |
{ |
794 |
gig::vcf_cutoff_ctrl_t ctrl = eVCFCutoffController.get_value(); |
795 |
bool hasController = ctrl != gig::vcf_cutoff_ctrl_none && ctrl != gig::vcf_cutoff_ctrl_none2; |
796 |
|
797 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
798 |
eVCFCutoff.set_sensitive(!hasController); |
799 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
800 |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
801 |
_("Velocity scale:")); |
802 |
} |
803 |
|
804 |
void DimRegionEdit::VCFResonanceController_changed() |
805 |
{ |
806 |
bool hasController = eVCFResonanceController.get_value() != gig::vcf_res_ctrl_none; |
807 |
eVCFResonance.set_sensitive(!hasController); |
808 |
} |
809 |
|
810 |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
811 |
{ |
812 |
bool infSus = eEG1InfiniteSustain.get_value(); |
813 |
eEG1Decay2.set_sensitive(!infSus); |
814 |
} |
815 |
|
816 |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
817 |
{ |
818 |
bool infSus = eEG2InfiniteSustain.get_value(); |
819 |
eEG2Decay2.set_sensitive(!infSus); |
820 |
} |
821 |
|
822 |
void DimRegionEdit::EG1Controller_changed() |
823 |
{ |
824 |
bool hasController = eEG1Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
825 |
eEG1ControllerInvert.set_sensitive(hasController); |
826 |
} |
827 |
|
828 |
void DimRegionEdit::EG2Controller_changed() |
829 |
{ |
830 |
bool hasController = eEG2Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
831 |
eEG2ControllerInvert.set_sensitive(hasController); |
832 |
} |
833 |
|
834 |
void DimRegionEdit::AttenuationController_changed() |
835 |
{ |
836 |
bool hasController = |
837 |
eAttenuationController.get_value().type != gig::leverage_ctrl_t::type_none; |
838 |
eInvertAttenuationController.set_sensitive(hasController); |
839 |
eAttenuationControllerThreshold.set_sensitive(hasController); |
840 |
eCrossfade_in_start.set_sensitive(hasController); |
841 |
eCrossfade_in_end.set_sensitive(hasController); |
842 |
eCrossfade_out_start.set_sensitive(hasController); |
843 |
eCrossfade_out_end.set_sensitive(hasController); |
844 |
} |
845 |
|
846 |
void DimRegionEdit::LFO1Controller_changed() |
847 |
{ |
848 |
gig::lfo1_ctrl_t ctrl = eLFO1Controller.get_value(); |
849 |
eLFO1ControlDepth.set_sensitive(ctrl != gig::lfo1_ctrl_internal); |
850 |
eLFO1InternalDepth.set_sensitive(ctrl != gig::lfo1_ctrl_modwheel && |
851 |
ctrl != gig::lfo1_ctrl_breath); |
852 |
} |
853 |
|
854 |
void DimRegionEdit::LFO2Controller_changed() |
855 |
{ |
856 |
gig::lfo2_ctrl_t ctrl = eLFO2Controller.get_value(); |
857 |
eLFO2ControlDepth.set_sensitive(ctrl != gig::lfo2_ctrl_internal); |
858 |
eLFO2InternalDepth.set_sensitive(ctrl != gig::lfo2_ctrl_modwheel && |
859 |
ctrl != gig::lfo2_ctrl_foot); |
860 |
} |
861 |
|
862 |
void DimRegionEdit::LFO3Controller_changed() |
863 |
{ |
864 |
gig::lfo3_ctrl_t ctrl = eLFO3Controller.get_value(); |
865 |
eLFO3ControlDepth.set_sensitive(ctrl != gig::lfo3_ctrl_internal); |
866 |
eLFO3InternalDepth.set_sensitive(ctrl != gig::lfo3_ctrl_modwheel && |
867 |
ctrl != gig::lfo3_ctrl_aftertouch); |
868 |
} |
869 |
|
870 |
void DimRegionEdit::crossfade1_changed() |
871 |
{ |
872 |
update_model++; |
873 |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
874 |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
875 |
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
876 |
update_model--; |
877 |
} |
878 |
|
879 |
void DimRegionEdit::crossfade2_changed() |
880 |
{ |
881 |
update_model++; |
882 |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
883 |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
884 |
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
885 |
update_model--; |
886 |
} |
887 |
|
888 |
void DimRegionEdit::crossfade3_changed() |
889 |
{ |
890 |
update_model++; |
891 |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
892 |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
893 |
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
894 |
update_model--; |
895 |
} |
896 |
|
897 |
void DimRegionEdit::crossfade4_changed() |
898 |
{ |
899 |
update_model++; |
900 |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
901 |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
902 |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
903 |
update_model--; |
904 |
} |
905 |
|
906 |
void DimRegionEdit::update_loop_elements() |
907 |
{ |
908 |
update_model++; |
909 |
const bool active = eSampleLoopEnabled.get_value(); |
910 |
eSampleLoopStart.set_sensitive(active); |
911 |
eSampleLoopLength.set_sensitive(active); |
912 |
eSampleLoopType.set_sensitive(active); |
913 |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
914 |
// sample loop shall never be longer than the actual sample size |
915 |
loop_start_changed(); |
916 |
loop_length_changed(); |
917 |
eSampleLoopStart.set_value( |
918 |
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopStart : 0); |
919 |
eSampleLoopLength.set_value( |
920 |
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopLength : 0); |
921 |
|
922 |
eSampleLoopInfinite.set_value( |
923 |
dimregion->pSample && dimregion->pSample->LoopPlayCount == 0); |
924 |
|
925 |
loop_infinite_toggled(); |
926 |
update_model--; |
927 |
} |
928 |
|
929 |
void DimRegionEdit::loop_start_changed() { |
930 |
if (dimregion && dimregion->SampleLoops) { |
931 |
eSampleLoopLength.set_upper(dimregion->pSample ? |
932 |
dimregion->pSample->SamplesTotal - |
933 |
dimregion->pSampleLoops[0].LoopStart : 0); |
934 |
} |
935 |
} |
936 |
|
937 |
void DimRegionEdit::loop_length_changed() { |
938 |
if (dimregion && dimregion->SampleLoops) { |
939 |
eSampleLoopStart.set_upper(dimregion->pSample ? |
940 |
dimregion->pSample->SamplesTotal - |
941 |
dimregion->pSampleLoops[0].LoopLength : 0); |
942 |
} |
943 |
} |
944 |
|
945 |
void DimRegionEdit::loop_infinite_toggled() { |
946 |
eSampleLoopPlayCount.set_sensitive( |
947 |
dimregion && dimregion->pSample && |
948 |
!eSampleLoopInfinite.get_value() && |
949 |
eSampleLoopEnabled.get_value() |
950 |
); |
951 |
update_model++; |
952 |
eSampleLoopPlayCount.set_value( |
953 |
dimregion->pSample ? dimregion->pSample->LoopPlayCount : 0); |
954 |
update_model--; |
955 |
} |
956 |
|
957 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
958 |
{ |
959 |
if (dimregion) { |
960 |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
961 |
|
962 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
963 |
//dimreg_to_be_changed_signal.emit(dimregion); |
964 |
|
965 |
// make sure stereo samples always are the same in both |
966 |
// dimregs in the samplechannel dimension |
967 |
int nbDimregs = 1; |
968 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
969 |
if (sample->Channels == 2) { |
970 |
gig::Region* region = dimregion->GetParent(); |
971 |
|
972 |
int bitcount = 0; |
973 |
int stereo_bit = 0; |
974 |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
975 |
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
976 |
stereo_bit = 1 << bitcount; |
977 |
break; |
978 |
} |
979 |
bitcount += region->pDimensionDefinitions[dim].bits; |
980 |
} |
981 |
|
982 |
if (stereo_bit) { |
983 |
int dimregno; |
984 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
985 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
986 |
break; |
987 |
} |
988 |
} |
989 |
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
990 |
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
991 |
nbDimregs = 2; |
992 |
} |
993 |
} |
994 |
|
995 |
gig::Sample* oldref = dimregion->pSample; |
996 |
|
997 |
for (int i = 0 ; i < nbDimregs ; i++) { |
998 |
d[i]->pSample = sample; |
999 |
|
1000 |
// copy sample information from Sample to DimensionRegion |
1001 |
|
1002 |
d[i]->UnityNote = sample->MIDIUnityNote; |
1003 |
d[i]->FineTune = sample->FineTune; |
1004 |
|
1005 |
int loops = sample->Loops ? 1 : 0; |
1006 |
while (d[i]->SampleLoops > loops) { |
1007 |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1008 |
} |
1009 |
while (d[i]->SampleLoops < sample->Loops) { |
1010 |
DLS::sample_loop_t loop; |
1011 |
d[i]->AddSampleLoop(&loop); |
1012 |
} |
1013 |
if (loops) { |
1014 |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1015 |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1016 |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1017 |
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1018 |
} |
1019 |
} |
1020 |
|
1021 |
// update ui |
1022 |
update_model++; |
1023 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
1024 |
eUnityNote.set_value(dimregion->UnityNote); |
1025 |
eFineTune.set_value(dimregion->FineTune); |
1026 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
1027 |
update_loop_elements(); |
1028 |
update_model--; |
1029 |
|
1030 |
sample_ref_changed_signal.emit(oldref, sample); |
1031 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1032 |
//dimreg_changed_signal.emit(dimregion); |
1033 |
return true; |
1034 |
} |
1035 |
return false; |
1036 |
} |
1037 |
|
1038 |
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_to_be_changed() { |
1039 |
return dimreg_to_be_changed_signal; |
1040 |
} |
1041 |
|
1042 |
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_changed() { |
1043 |
return dimreg_changed_signal; |
1044 |
} |
1045 |
|
1046 |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& DimRegionEdit::signal_sample_ref_changed() { |
1047 |
return sample_ref_changed_signal; |
1048 |
} |
1049 |
|
1050 |
|
1051 |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
1052 |
{ |
1053 |
d->UnityNote = value; |
1054 |
} |
1055 |
|
1056 |
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
1057 |
{ |
1058 |
d->FineTune = value; |
1059 |
} |
1060 |
|
1061 |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
1062 |
uint8_t value) |
1063 |
{ |
1064 |
d->Crossfade.in_start = value; |
1065 |
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1066 |
} |
1067 |
|
1068 |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
1069 |
uint8_t value) |
1070 |
{ |
1071 |
d->Crossfade.in_end = value; |
1072 |
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
1073 |
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1074 |
} |
1075 |
|
1076 |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
1077 |
uint8_t value) |
1078 |
{ |
1079 |
d->Crossfade.out_start = value; |
1080 |
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
1081 |
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
1082 |
} |
1083 |
|
1084 |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
1085 |
uint8_t value) |
1086 |
{ |
1087 |
d->Crossfade.out_end = value; |
1088 |
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1089 |
} |
1090 |
|
1091 |
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
1092 |
{ |
1093 |
d->SetGain(value); |
1094 |
} |
1095 |
|
1096 |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
1097 |
{ |
1098 |
if (value) { |
1099 |
// create a new sample loop in case there is none yet |
1100 |
if (!d->SampleLoops) { |
1101 |
DLS::sample_loop_t loop; |
1102 |
loop.LoopType = gig::loop_type_normal; |
1103 |
// loop the whole sample by default |
1104 |
loop.LoopStart = 0; |
1105 |
loop.LoopLength = |
1106 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
1107 |
dimreg_to_be_changed_signal.emit(d); |
1108 |
d->AddSampleLoop(&loop); |
1109 |
dimreg_changed_signal.emit(d); |
1110 |
} |
1111 |
} else { |
1112 |
if (d->SampleLoops) { |
1113 |
dimreg_to_be_changed_signal.emit(d); |
1114 |
// delete ALL existing sample loops |
1115 |
while (d->SampleLoops) { |
1116 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1117 |
} |
1118 |
dimreg_changed_signal.emit(d); |
1119 |
} |
1120 |
} |
1121 |
} |
1122 |
|
1123 |
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
1124 |
{ |
1125 |
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
1126 |
} |
1127 |
|
1128 |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
1129 |
{ |
1130 |
if (d->SampleLoops) { |
1131 |
d->pSampleLoops[0].LoopStart = |
1132 |
d->pSample ? |
1133 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1134 |
d->pSampleLoops[0].LoopLength)) : |
1135 |
0; |
1136 |
} |
1137 |
} |
1138 |
|
1139 |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
1140 |
{ |
1141 |
if (d->SampleLoops) { |
1142 |
d->pSampleLoops[0].LoopLength = |
1143 |
d->pSample ? |
1144 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1145 |
d->pSampleLoops[0].LoopStart)) : |
1146 |
0; |
1147 |
} |
1148 |
} |
1149 |
|
1150 |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
1151 |
{ |
1152 |
if (d->pSample) { |
1153 |
if (value) d->pSample->LoopPlayCount = 0; |
1154 |
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
1155 |
} |
1156 |
} |
1157 |
|
1158 |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
1159 |
{ |
1160 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
1161 |
} |