1 |
/* |
/* |
2 |
* Copyright (C) 2006, 2007 Andreas Persson |
* Copyright (C) 2006-2009 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
19 |
|
|
20 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
21 |
|
|
22 |
#include <libintl.h> |
#include "global.h" |
|
#define _(String) gettext(String) |
|
23 |
|
|
24 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
25 |
eEG1PreAttack("Pre-attack", 0, 100, 2), |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
26 |
eEG1Attack("Attack", 0, 60, 3), |
eEG1Attack(_("Attack"), 0, 60, 3), |
27 |
eEG1Decay1("Decay 1", 0.005, 60, 3), |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
28 |
eEG1Decay2("Decay 2", 0, 60, 3), |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
29 |
eEG1InfiniteSustain("Infinite sustain"), |
eEG1InfiniteSustain(_("Infinite sustain")), |
30 |
eEG1Sustain("Sustain", 0, 100, 2), |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
31 |
eEG1Release("Release", 0, 60, 3), |
eEG1Release(_("Release"), 0, 60, 3), |
32 |
eEG1Hold("Hold"), |
eEG1Hold(_("Hold")), |
33 |
eEG1Controller("Controller"), |
eEG1Controller(_("Controller")), |
34 |
eEG1ControllerInvert("Controller invert"), |
eEG1ControllerInvert(_("Controller invert")), |
35 |
eEG1ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
36 |
eEG1ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
37 |
eEG1ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
38 |
eLFO1Frequency("Frequency", 0.1, 10, 2), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
39 |
eLFO1InternalDepth("Internal depth", 0, 1200), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
40 |
eLFO1ControlDepth("Control depth", 0, 1200), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
41 |
eLFO1Controller("Controller"), |
eLFO1Controller(_("Controller")), |
42 |
eLFO1FlipPhase("Flip phase"), |
eLFO1FlipPhase(_("Flip phase")), |
43 |
eLFO1Sync("Sync"), |
eLFO1Sync(_("Sync")), |
44 |
eEG2PreAttack("Pre-attack", 0, 100, 2), |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
45 |
eEG2Attack("Attack", 0, 60, 3), |
eEG2Attack(_("Attack"), 0, 60, 3), |
46 |
eEG2Decay1("Decay 1", 0.005, 60, 3), |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
47 |
eEG2Decay2("Decay 2", 0, 60, 3), |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
48 |
eEG2InfiniteSustain("Infinite sustain"), |
eEG2InfiniteSustain(_("Infinite sustain")), |
49 |
eEG2Sustain("Sustain", 0, 100, 2), |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
50 |
eEG2Release("Release", 0, 60, 3), |
eEG2Release(_("Release"), 0, 60, 3), |
51 |
eEG2Controller("Controller"), |
eEG2Controller(_("Controller")), |
52 |
eEG2ControllerInvert("Controller invert"), |
eEG2ControllerInvert(_("Controller invert")), |
53 |
eEG2ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
54 |
eEG2ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
55 |
eEG2ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
56 |
eLFO2Frequency("Frequency", 0.1, 10, 2), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
57 |
eLFO2InternalDepth("Internal depth", 0, 1200), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
58 |
eLFO2ControlDepth("Control depth", 0, 1200), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
59 |
eLFO2Controller("Controller"), |
eLFO2Controller(_("Controller")), |
60 |
eLFO2FlipPhase("Flip phase"), |
eLFO2FlipPhase(_("Flip phase")), |
61 |
eLFO2Sync("Sync"), |
eLFO2Sync(_("Sync")), |
62 |
eEG3Attack("Attack", 0, 10, 3), |
eEG3Attack(_("Attack"), 0, 10, 3), |
63 |
eEG3Depth("Depth", -1200, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
64 |
eLFO3Frequency("Frequency", 0.1, 10, 2), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
65 |
eLFO3InternalDepth("Internal depth", 0, 1200), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
66 |
eLFO3ControlDepth("Control depth", 0, 1200), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
67 |
eLFO3Controller("Controller"), |
eLFO3Controller(_("Controller")), |
68 |
eLFO3Sync("Sync"), |
eLFO3Sync(_("Sync")), |
69 |
eVCFEnabled("Enabled"), |
eVCFEnabled(_("Enabled")), |
70 |
eVCFType("Type"), |
eVCFType(_("Type")), |
71 |
eVCFCutoffController("Cutoff controller"), |
eVCFCutoffController(_("Cutoff controller")), |
72 |
eVCFCutoffControllerInvert("Cutoff controller invert"), |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
73 |
eVCFCutoff("Cutoff"), |
eVCFCutoff(_("Cutoff")), |
74 |
eVCFVelocityCurve("Velocity curve"), |
eVCFVelocityCurve(_("Velocity curve")), |
75 |
eVCFVelocityScale("Velocity scale"), |
eVCFVelocityScale(_("Velocity scale")), |
76 |
eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4), |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
77 |
eVCFResonance("Resonance"), |
eVCFResonance(_("Resonance")), |
78 |
eVCFResonanceDynamic("Resonance dynamic"), |
eVCFResonanceDynamic(_("Resonance dynamic")), |
79 |
eVCFResonanceController("Resonance controller"), |
eVCFResonanceController(_("Resonance controller")), |
80 |
eVCFKeyboardTracking("Keyboard tracking"), |
eVCFKeyboardTracking(_("Keyboard tracking")), |
81 |
eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"), |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
82 |
eVelocityResponseCurve("Velocity response curve"), |
eVelocityResponseCurve(_("Velocity response curve")), |
83 |
eVelocityResponseDepth("Velocity response depth", 0, 4), |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
84 |
eVelocityResponseCurveScaling("Velocity response curve scaling"), |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
85 |
eReleaseVelocityResponseCurve("Release velocity response curve"), |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
86 |
eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4), |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
87 |
eReleaseTriggerDecay("Release trigger decay", 0, 8), |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
88 |
eCrossfade_in_start("Crossfade-in start"), |
eCrossfade_in_start(_("Crossfade-in start")), |
89 |
eCrossfade_in_end("Crossfade-in end"), |
eCrossfade_in_end(_("Crossfade-in end")), |
90 |
eCrossfade_out_start("Crossfade-out start"), |
eCrossfade_out_start(_("Crossfade-out start")), |
91 |
eCrossfade_out_end("Crossfade-out end"), |
eCrossfade_out_end(_("Crossfade-out end")), |
92 |
ePitchTrack("Pitch track"), |
ePitchTrack(_("Pitch track")), |
93 |
eDimensionBypass("Dimension bypass"), |
eDimensionBypass(_("Dimension bypass")), |
94 |
ePan("Pan", -64, 63), |
ePan(_("Pan"), -64, 63), |
95 |
eSelfMask("Self mask"), |
eSelfMask(_("Self mask")), |
96 |
eAttenuationController("Attenuation controller"), |
eAttenuationController(_("Attenuation controller")), |
97 |
eInvertAttenuationController("Invert attenuation controller"), |
eInvertAttenuationController(_("Invert attenuation controller")), |
98 |
eAttenuationControllerThreshold("Attenuation controller threshold"), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
99 |
eChannelOffset("Channel offset", 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
100 |
eSustainDefeat("Sustain defeat"), |
eSustainDefeat(_("Sustain defeat")), |
101 |
eMSDecode("MS decode"), |
eMSDecode(_("MS decode")), |
102 |
eSampleStartOffset("Sample start offset", 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
103 |
eUnityNote("Unity note"), |
eUnityNote(_("Unity note")), |
104 |
eFineTune("Fine tune", -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
105 |
eGain("Gain", -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
106 |
eGainPlus6("Gain +6dB", eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
107 |
eSampleLoopEnabled("Enabled"), |
eSampleLoopEnabled(_("Enabled")), |
108 |
eSampleLoopStart("Loop start positon"), |
eSampleLoopStart(_("Loop start positon")), |
109 |
eSampleLoopLength("Loop size"), |
eSampleLoopLength(_("Loop size")), |
110 |
eSampleLoopType("Loop type"), |
eSampleLoopType(_("Loop type")), |
111 |
eSampleLoopInfinite("Infinite loop"), |
eSampleLoopInfinite(_("Infinite loop")), |
112 |
eSampleLoopPlayCount("Playback count") |
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++) { |
for (int i = 0 ; i < 7 ; i++) { |
224 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
225 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
265 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
266 |
|
|
267 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
268 |
addString("Sample", lSample, wSample); |
addString(_("Sample"), lSample, wSample); |
269 |
//TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false); |
//TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false); |
270 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
271 |
addProp(eUnityNote); |
addProp(eUnityNote); |
272 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
273 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
274 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
275 |
addHeader("Loops"); |
addHeader(_("Loops")); |
276 |
addProp(eSampleLoopEnabled); |
addProp(eSampleLoopEnabled); |
277 |
addProp(eSampleLoopStart); |
addProp(eSampleLoopStart); |
278 |
addProp(eSampleLoopLength); |
addProp(eSampleLoopLength); |
279 |
{ |
{ |
280 |
const char* choices[] = { "normal", "bidirectional", "backward", 0 }; |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
281 |
static const uint32_t values[] = { |
static const uint32_t values[] = { |
282 |
gig::loop_type_normal, |
gig::loop_type_normal, |
283 |
gig::loop_type_bidirectional, |
gig::loop_type_bidirectional, |
317 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
318 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
319 |
{ |
{ |
320 |
const char* choices[] = { "internal", "modwheel", "breath", |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
321 |
"internal+modwheel", "internal+breath", 0 }; |
_("internal+modwheel"), _("internal+breath"), 0 }; |
322 |
static const gig::lfo1_ctrl_t values[] = { |
static const gig::lfo1_ctrl_t values[] = { |
323 |
gig::lfo1_ctrl_internal, |
gig::lfo1_ctrl_internal, |
324 |
gig::lfo1_ctrl_modwheel, |
gig::lfo1_ctrl_modwheel, |
331 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
332 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
333 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
334 |
addHeader("Crossfade"); |
addHeader(_("Crossfade")); |
335 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
336 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
337 |
addProp(eAttenuationControllerThreshold); |
addProp(eAttenuationControllerThreshold); |
345 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
346 |
addProp(eVCFEnabled); |
addProp(eVCFEnabled); |
347 |
{ |
{ |
348 |
const char* choices[] = { "lowpass", "lowpassturbo", "bandpass", |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
349 |
"highpass", "bandreject", 0 }; |
_("highpass"), _("bandreject"), 0 }; |
350 |
static const gig::vcf_type_t values[] = { |
static const gig::vcf_type_t values[] = { |
351 |
gig::vcf_type_lowpass, |
gig::vcf_type_lowpass, |
352 |
gig::vcf_type_lowpassturbo, |
gig::vcf_type_lowpassturbo, |
358 |
} |
} |
359 |
addProp(eVCFType); |
addProp(eVCFType); |
360 |
{ |
{ |
361 |
const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2", |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
362 |
"breath", "foot", "sustainpedal", "softpedal", |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
363 |
"genpurpose7", "genpurpose8", "aftertouch", 0 }; |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
364 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
static const gig::vcf_cutoff_ctrl_t values[] = { |
365 |
gig::vcf_cutoff_ctrl_none, |
gig::vcf_cutoff_ctrl_none, |
366 |
gig::vcf_cutoff_ctrl_none2, |
gig::vcf_cutoff_ctrl_none2, |
380 |
addProp(eVCFCutoffController); |
addProp(eVCFCutoffController); |
381 |
addProp(eVCFCutoffControllerInvert); |
addProp(eVCFCutoffControllerInvert); |
382 |
addProp(eVCFCutoff); |
addProp(eVCFCutoff); |
383 |
const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 }; |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
384 |
static const gig::curve_type_t curve_type_values[] = { |
static const gig::curve_type_t curve_type_values[] = { |
385 |
gig::curve_type_nonlinear, |
gig::curve_type_nonlinear, |
386 |
gig::curve_type_linear, |
gig::curve_type_linear, |
393 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
394 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
395 |
{ |
{ |
396 |
const char* choices[] = { "none", "genpurpose3", "genpurpose4", |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
397 |
"genpurpose5", "genpurpose6", 0 }; |
_("genpurpose5"), _("genpurpose6"), 0 }; |
398 |
static const gig::vcf_res_ctrl_t values[] = { |
static const gig::vcf_res_ctrl_t values[] = { |
399 |
gig::vcf_res_ctrl_none, |
gig::vcf_res_ctrl_none, |
400 |
gig::vcf_res_ctrl_genpurpose3, |
gig::vcf_res_ctrl_genpurpose3, |
410 |
|
|
411 |
nextPage(); |
nextPage(); |
412 |
|
|
413 |
addHeader(_("Filter Cutoff Envelope (EG2)")); |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
414 |
addProp(eEG2PreAttack); |
addProp(eEG2PreAttack); |
415 |
addProp(eEG2Attack); |
addProp(eEG2Attack); |
416 |
addProp(eEG2Decay1); |
addProp(eEG2Decay1); |
423 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
424 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
425 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
426 |
addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
427 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
428 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
429 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
430 |
{ |
{ |
431 |
const char* choices[] = { "internal", "modwheel", "foot", |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
432 |
"internal+modwheel", "internal+foot", 0 }; |
_("internal+modwheel"), _("internal+foot"), 0 }; |
433 |
static const gig::lfo2_ctrl_t values[] = { |
static const gig::lfo2_ctrl_t values[] = { |
434 |
gig::lfo2_ctrl_internal, |
gig::lfo2_ctrl_internal, |
435 |
gig::lfo2_ctrl_modwheel, |
gig::lfo2_ctrl_modwheel, |
456 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
457 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
458 |
{ |
{ |
459 |
const char* choices[] = { "internal", "modwheel", "aftertouch", |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
460 |
"internal+modwheel", "internal+aftertouch", 0 }; |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
461 |
static const gig::lfo3_ctrl_t values[] = { |
static const gig::lfo3_ctrl_t values[] = { |
462 |
gig::lfo3_ctrl_internal, |
gig::lfo3_ctrl_internal, |
463 |
gig::lfo3_ctrl_modwheel, |
gig::lfo3_ctrl_modwheel, |
482 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
483 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
484 |
{ |
{ |
485 |
const char* choices[] = { "none", "effect4depth", "effect5depth", 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
486 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
487 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
488 |
gig::dim_bypass_ctrl_94, |
gig::dim_bypass_ctrl_94, |
498 |
nextPage(); |
nextPage(); |
499 |
|
|
500 |
|
|
501 |
eEG1InfiniteSustain.signal_toggled().connect( |
eEG1InfiniteSustain.signal_value_changed().connect( |
502 |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled)); |
503 |
eEG2InfiniteSustain.signal_toggled().connect( |
eEG2InfiniteSustain.signal_value_changed().connect( |
504 |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled)); |
505 |
eEG1Controller.signal_changed().connect( |
eEG1Controller.signal_value_changed().connect( |
506 |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed)); |
507 |
eEG2Controller.signal_changed().connect( |
eEG2Controller.signal_value_changed().connect( |
508 |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed)); |
509 |
eLFO1Controller.signal_changed().connect( |
eLFO1Controller.signal_value_changed().connect( |
510 |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed)); |
511 |
eLFO2Controller.signal_changed().connect( |
eLFO2Controller.signal_value_changed().connect( |
512 |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed)); |
513 |
eLFO3Controller.signal_changed().connect( |
eLFO3Controller.signal_value_changed().connect( |
514 |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed)); |
515 |
eAttenuationController.signal_changed().connect( |
eAttenuationController.signal_value_changed().connect( |
516 |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed)); |
517 |
eVCFEnabled.signal_toggled().connect( |
eVCFEnabled.signal_value_changed().connect( |
518 |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled)); |
519 |
eVCFCutoffController.signal_changed().connect( |
eVCFCutoffController.signal_value_changed().connect( |
520 |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed)); |
521 |
eVCFResonanceController.signal_changed().connect( |
eVCFResonanceController.signal_value_changed().connect( |
522 |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed)); |
523 |
|
|
524 |
eCrossfade_in_start.signal_changed_by_user().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
525 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
526 |
eCrossfade_in_end.signal_changed_by_user().connect( |
eCrossfade_in_end.signal_value_changed().connect( |
527 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
528 |
eCrossfade_out_start.signal_changed_by_user().connect( |
eCrossfade_out_start.signal_value_changed().connect( |
529 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
530 |
eCrossfade_out_end.signal_changed_by_user().connect( |
eCrossfade_out_end.signal_value_changed().connect( |
531 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
532 |
|
|
533 |
eSampleLoopEnabled.signal_toggled().connect( |
eSampleLoopEnabled.signal_value_changed().connect( |
534 |
sigc::mem_fun(*this, &DimRegionEdit::loop_enabled_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements)); |
535 |
eSampleLoopStart.signal_changed_by_user().connect( |
eSampleLoopStart.signal_value_changed().connect( |
536 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed)); |
537 |
eSampleLoopLength.signal_changed_by_user().connect( |
eSampleLoopLength.signal_value_changed().connect( |
538 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed)); |
539 |
eSampleLoopInfinite.signal_toggled().connect( |
eSampleLoopInfinite.signal_value_changed().connect( |
540 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
541 |
|
|
542 |
append_page(*table[0], "Sample"); |
append_page(*table[0], _("Sample")); |
543 |
append_page(*table[1], "Amplitude (1)"); |
append_page(*table[1], _("Amplitude (1)")); |
544 |
append_page(*table[2], "Amplitude (2)"); |
append_page(*table[2], _("Amplitude (2)")); |
545 |
append_page(*table[3], "Filter (1)"); |
append_page(*table[3], _("Filter (1)")); |
546 |
append_page(*table[4], "Filter (2)"); |
append_page(*table[4], _("Filter (2)")); |
547 |
append_page(*table[5], "Pitch"); |
append_page(*table[5], _("Pitch")); |
548 |
append_page(*table[6], "Misc"); |
append_page(*table[6], _("Misc")); |
549 |
} |
} |
550 |
|
|
551 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
569 |
rowno++; |
rowno++; |
570 |
} |
} |
571 |
|
|
572 |
void DimRegionEdit::addHeader(const char* text) |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
573 |
{ |
{ |
574 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
575 |
{ |
{ |
587 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
588 |
rowno++; |
rowno++; |
589 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
590 |
|
return label; |
591 |
} |
} |
592 |
|
|
593 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
608 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
609 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
610 |
rowno++; |
rowno++; |
|
boolentry.signal_changed_by_user().connect( |
|
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
|
|
); |
|
611 |
} |
} |
612 |
|
|
613 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
615 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
616 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
617 |
rowno++; |
rowno++; |
|
boolentry.signal_changed_by_user().connect( |
|
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
|
|
); |
|
618 |
} |
} |
619 |
|
|
620 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
624 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
625 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
626 |
rowno++; |
rowno++; |
|
prop.signal_changed_by_user().connect( |
|
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
|
|
); |
|
627 |
} |
} |
628 |
|
|
629 |
|
|
634 |
set_sensitive(d); |
set_sensitive(d); |
635 |
if (!d) return; |
if (!d) return; |
636 |
|
|
637 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL"); |
update_model++; |
638 |
eEG1PreAttack.set_ptr(&d->EG1PreAttack); |
eEG1PreAttack.set_value(d->EG1PreAttack); |
639 |
eEG1Attack.set_ptr(&d->EG1Attack); |
eEG1Attack.set_value(d->EG1Attack); |
640 |
eEG1Decay1.set_ptr(&d->EG1Decay1); |
eEG1Decay1.set_value(d->EG1Decay1); |
641 |
eEG1Decay2.set_ptr(&d->EG1Decay2); |
eEG1Decay2.set_value(d->EG1Decay2); |
642 |
eEG1InfiniteSustain.set_ptr(&d->EG1InfiniteSustain); |
eEG1InfiniteSustain.set_value(d->EG1InfiniteSustain); |
643 |
eEG1Sustain.set_ptr(&d->EG1Sustain); |
eEG1Sustain.set_value(d->EG1Sustain); |
644 |
eEG1Release.set_ptr(&d->EG1Release); |
eEG1Release.set_value(d->EG1Release); |
645 |
eEG1Hold.set_ptr(&d->EG1Hold); |
eEG1Hold.set_value(d->EG1Hold); |
646 |
eEG1Controller.set_ptr(&d->EG1Controller); |
eEG1Controller.set_value(d->EG1Controller); |
647 |
eEG1ControllerInvert.set_ptr(&d->EG1ControllerInvert); |
eEG1ControllerInvert.set_value(d->EG1ControllerInvert); |
648 |
eEG1ControllerAttackInfluence.set_ptr(&d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
649 |
eEG1ControllerDecayInfluence.set_ptr(&d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
650 |
eEG1ControllerReleaseInfluence.set_ptr(&d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
651 |
eLFO1Frequency.set_ptr(&d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
652 |
eLFO1InternalDepth.set_ptr(&d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
653 |
eLFO1ControlDepth.set_ptr(&d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
654 |
eLFO1Controller.set_ptr(&d->LFO1Controller); |
eLFO1Controller.set_value(d->LFO1Controller); |
655 |
eLFO1FlipPhase.set_ptr(&d->LFO1FlipPhase); |
eLFO1FlipPhase.set_value(d->LFO1FlipPhase); |
656 |
eLFO1Sync.set_ptr(&d->LFO1Sync); |
eLFO1Sync.set_value(d->LFO1Sync); |
657 |
eEG2PreAttack.set_ptr(&d->EG2PreAttack); |
eEG2PreAttack.set_value(d->EG2PreAttack); |
658 |
eEG2Attack.set_ptr(&d->EG2Attack); |
eEG2Attack.set_value(d->EG2Attack); |
659 |
eEG2Decay1.set_ptr(&d->EG2Decay1); |
eEG2Decay1.set_value(d->EG2Decay1); |
660 |
eEG2Decay2.set_ptr(&d->EG2Decay2); |
eEG2Decay2.set_value(d->EG2Decay2); |
661 |
eEG2InfiniteSustain.set_ptr(&d->EG2InfiniteSustain); |
eEG2InfiniteSustain.set_value(d->EG2InfiniteSustain); |
662 |
eEG2Sustain.set_ptr(&d->EG2Sustain); |
eEG2Sustain.set_value(d->EG2Sustain); |
663 |
eEG2Release.set_ptr(&d->EG2Release); |
eEG2Release.set_value(d->EG2Release); |
664 |
eEG2Controller.set_ptr(&d->EG2Controller); |
eEG2Controller.set_value(d->EG2Controller); |
665 |
eEG2ControllerInvert.set_ptr(&d->EG2ControllerInvert); |
eEG2ControllerInvert.set_value(d->EG2ControllerInvert); |
666 |
eEG2ControllerAttackInfluence.set_ptr(&d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
667 |
eEG2ControllerDecayInfluence.set_ptr(&d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
668 |
eEG2ControllerReleaseInfluence.set_ptr(&d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
669 |
eLFO2Frequency.set_ptr(&d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
670 |
eLFO2InternalDepth.set_ptr(&d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
671 |
eLFO2ControlDepth.set_ptr(&d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
672 |
eLFO2Controller.set_ptr(&d->LFO2Controller); |
eLFO2Controller.set_value(d->LFO2Controller); |
673 |
eLFO2FlipPhase.set_ptr(&d->LFO2FlipPhase); |
eLFO2FlipPhase.set_value(d->LFO2FlipPhase); |
674 |
eLFO2Sync.set_ptr(&d->LFO2Sync); |
eLFO2Sync.set_value(d->LFO2Sync); |
675 |
eEG3Attack.set_ptr(&d->EG3Attack); |
eEG3Attack.set_value(d->EG3Attack); |
676 |
eEG3Depth.set_ptr(&d->EG3Depth); |
eEG3Depth.set_value(d->EG3Depth); |
677 |
eLFO3Frequency.set_ptr(&d->LFO3Frequency); |
eLFO3Frequency.set_value(d->LFO3Frequency); |
678 |
eLFO3InternalDepth.set_ptr(&d->LFO3InternalDepth); |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
679 |
eLFO3ControlDepth.set_ptr(&d->LFO3ControlDepth); |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
680 |
eLFO3Controller.set_ptr(&d->LFO3Controller); |
eLFO3Controller.set_value(d->LFO3Controller); |
681 |
eLFO3Sync.set_ptr(&d->LFO3Sync); |
eLFO3Sync.set_value(d->LFO3Sync); |
682 |
eVCFEnabled.set_ptr(&d->VCFEnabled); |
eVCFEnabled.set_value(d->VCFEnabled); |
683 |
eVCFType.set_ptr(&d->VCFType); |
eVCFType.set_value(d->VCFType); |
684 |
eVCFCutoffController.set_ptr(&d->VCFCutoffController); |
eVCFCutoffController.set_value(d->VCFCutoffController); |
685 |
eVCFCutoffControllerInvert.set_ptr(&d->VCFCutoffControllerInvert); |
eVCFCutoffControllerInvert.set_value(d->VCFCutoffControllerInvert); |
686 |
eVCFCutoff.set_ptr(&d->VCFCutoff); |
eVCFCutoff.set_value(d->VCFCutoff); |
687 |
eVCFVelocityCurve.set_ptr(&d->VCFVelocityCurve); |
eVCFVelocityCurve.set_value(d->VCFVelocityCurve); |
688 |
eVCFVelocityScale.set_ptr(&d->VCFVelocityScale); |
eVCFVelocityScale.set_value(d->VCFVelocityScale); |
689 |
eVCFVelocityDynamicRange.set_ptr(&d->VCFVelocityDynamicRange); |
eVCFVelocityDynamicRange.set_value(d->VCFVelocityDynamicRange); |
690 |
eVCFResonance.set_ptr(&d->VCFResonance); |
eVCFResonance.set_value(d->VCFResonance); |
691 |
eVCFResonanceDynamic.set_ptr(&d->VCFResonanceDynamic); |
eVCFResonanceDynamic.set_value(d->VCFResonanceDynamic); |
692 |
eVCFResonanceController.set_ptr(&d->VCFResonanceController); |
eVCFResonanceController.set_value(d->VCFResonanceController); |
693 |
eVCFKeyboardTracking.set_ptr(&d->VCFKeyboardTracking); |
eVCFKeyboardTracking.set_value(d->VCFKeyboardTracking); |
694 |
eVCFKeyboardTrackingBreakpoint.set_ptr(&d->VCFKeyboardTrackingBreakpoint); |
eVCFKeyboardTrackingBreakpoint.set_value(d->VCFKeyboardTrackingBreakpoint); |
695 |
eVelocityResponseCurve.set_ptr(&d->VelocityResponseCurve); |
eVelocityResponseCurve.set_value(d->VelocityResponseCurve); |
696 |
eVelocityResponseDepth.set_ptr(&d->VelocityResponseDepth); |
eVelocityResponseDepth.set_value(d->VelocityResponseDepth); |
697 |
eVelocityResponseCurveScaling.set_ptr(&d->VelocityResponseCurveScaling); |
eVelocityResponseCurveScaling.set_value(d->VelocityResponseCurveScaling); |
698 |
eReleaseVelocityResponseCurve.set_ptr(&d->ReleaseVelocityResponseCurve); |
eReleaseVelocityResponseCurve.set_value(d->ReleaseVelocityResponseCurve); |
699 |
eReleaseVelocityResponseDepth.set_ptr(&d->ReleaseVelocityResponseDepth); |
eReleaseVelocityResponseDepth.set_value(d->ReleaseVelocityResponseDepth); |
700 |
eReleaseTriggerDecay.set_ptr(&d->ReleaseTriggerDecay); |
eReleaseTriggerDecay.set_value(d->ReleaseTriggerDecay); |
701 |
|
eCrossfade_in_start.set_value(d->Crossfade.in_start); |
702 |
eCrossfade_in_start.set_ptr(0); |
eCrossfade_in_end.set_value(d->Crossfade.in_end); |
703 |
eCrossfade_in_end.set_ptr(0); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
704 |
eCrossfade_out_start.set_ptr(0); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
705 |
eCrossfade_out_end.set_ptr(0); |
ePitchTrack.set_value(d->PitchTrack); |
706 |
eCrossfade_in_start.set_ptr(&d->Crossfade.in_start); |
eDimensionBypass.set_value(d->DimensionBypass); |
707 |
eCrossfade_in_end.set_ptr(&d->Crossfade.in_end); |
ePan.set_value(d->Pan); |
708 |
eCrossfade_out_start.set_ptr(&d->Crossfade.out_start); |
eSelfMask.set_value(d->SelfMask); |
709 |
eCrossfade_out_end.set_ptr(&d->Crossfade.out_end); |
eAttenuationController.set_value(d->AttenuationController); |
710 |
|
eInvertAttenuationController.set_value(d->InvertAttenuationController); |
711 |
ePitchTrack.set_ptr(&d->PitchTrack); |
eAttenuationControllerThreshold.set_value(d->AttenuationControllerThreshold); |
712 |
eDimensionBypass.set_ptr(&d->DimensionBypass); |
eChannelOffset.set_value(d->ChannelOffset); |
713 |
ePan.set_ptr(&d->Pan); |
eSustainDefeat.set_value(d->SustainDefeat); |
714 |
eSelfMask.set_ptr(&d->SelfMask); |
eMSDecode.set_value(d->MSDecode); |
715 |
eAttenuationController.set_ptr(&d->AttenuationController); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
716 |
eInvertAttenuationController.set_ptr(&d->InvertAttenuationController); |
eUnityNote.set_value(d->UnityNote); |
717 |
eAttenuationControllerThreshold.set_ptr(&d->AttenuationControllerThreshold); |
eFineTune.set_value(d->FineTune); |
718 |
eChannelOffset.set_ptr(&d->ChannelOffset); |
eGain.set_value(d->Gain); |
719 |
eSustainDefeat.set_ptr(&d->SustainDefeat); |
eGainPlus6.set_value(d->Gain); |
720 |
eMSDecode.set_ptr(&d->MSDecode); |
eSampleLoopEnabled.set_value(d->SampleLoops); |
721 |
eSampleStartOffset.set_ptr(&d->SampleStartOffset); |
eSampleLoopType.set_value( |
722 |
eUnityNote.set_ptr(&d->UnityNote); |
d->SampleLoops ? d->pSampleLoops[0].LoopType : 0); |
723 |
eFineTune.set_ptr(&d->FineTune); |
eSampleLoopStart.set_value( |
724 |
eGain.set_ptr(&d->Gain); |
d->SampleLoops ? d->pSampleLoops[0].LoopStart : 0); |
725 |
eGainPlus6.set_ptr(&d->Gain); |
eSampleLoopLength.set_value( |
726 |
|
d->SampleLoops ? d->pSampleLoops[0].LoopLength : 0); |
727 |
|
eSampleLoopInfinite.set_value( |
728 |
|
d->pSample && d->pSample->LoopPlayCount == 0); |
729 |
|
eSampleLoopPlayCount.set_value( |
730 |
|
d->pSample ? d->pSample->LoopPlayCount : 0); |
731 |
|
update_model--; |
732 |
|
|
733 |
eSampleLoopEnabled.set_active(d->SampleLoops); |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
|
updateLoopElements(); |
|
734 |
|
|
735 |
|
update_loop_elements(); |
736 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
737 |
} |
} |
738 |
|
|
739 |
|
|
740 |
void DimRegionEdit::VCFEnabled_toggled() |
void DimRegionEdit::VCFEnabled_toggled() |
741 |
{ |
{ |
742 |
bool sensitive = eVCFEnabled.get_active(); |
bool sensitive = eVCFEnabled.get_value(); |
743 |
eVCFType.set_sensitive(sensitive); |
eVCFType.set_sensitive(sensitive); |
744 |
eVCFCutoffController.set_sensitive(sensitive); |
eVCFCutoffController.set_sensitive(sensitive); |
745 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
749 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
750 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
751 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
752 |
|
lEG2->set_sensitive(sensitive); |
753 |
eEG2PreAttack.set_sensitive(sensitive); |
eEG2PreAttack.set_sensitive(sensitive); |
754 |
eEG2Attack.set_sensitive(sensitive); |
eEG2Attack.set_sensitive(sensitive); |
755 |
eEG2Decay1.set_sensitive(sensitive); |
eEG2Decay1.set_sensitive(sensitive); |
760 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
761 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
762 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
763 |
|
lLFO2->set_sensitive(sensitive); |
764 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
765 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
766 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
787 |
|
|
788 |
void DimRegionEdit::VCFCutoffController_changed() |
void DimRegionEdit::VCFCutoffController_changed() |
789 |
{ |
{ |
790 |
int rowno = eVCFCutoffController.get_active_row_number(); |
gig::vcf_cutoff_ctrl_t ctrl = eVCFCutoffController.get_value(); |
791 |
bool hasController = rowno != 0 && rowno != 1; |
bool hasController = ctrl != gig::vcf_cutoff_ctrl_none && ctrl != gig::vcf_cutoff_ctrl_none2; |
792 |
|
|
793 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
794 |
eVCFCutoff.set_sensitive(!hasController); |
eVCFCutoff.set_sensitive(!hasController); |
795 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
eVCFResonanceDynamic.set_sensitive(!hasController); |
796 |
eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" : |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
797 |
"Velocity scale:"); |
_("Velocity scale:")); |
798 |
} |
} |
799 |
|
|
800 |
void DimRegionEdit::VCFResonanceController_changed() |
void DimRegionEdit::VCFResonanceController_changed() |
801 |
{ |
{ |
802 |
bool hasController = eVCFResonanceController.get_active_row_number() != 0; |
bool hasController = eVCFResonanceController.get_value() != gig::vcf_res_ctrl_none; |
803 |
eVCFResonance.set_sensitive(!hasController); |
eVCFResonance.set_sensitive(!hasController); |
804 |
} |
} |
805 |
|
|
806 |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
807 |
{ |
{ |
808 |
bool infSus = eEG1InfiniteSustain.get_active(); |
bool infSus = eEG1InfiniteSustain.get_value(); |
809 |
eEG1Decay2.set_sensitive(!infSus); |
eEG1Decay2.set_sensitive(!infSus); |
810 |
} |
} |
811 |
|
|
812 |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
813 |
{ |
{ |
814 |
bool infSus = eEG2InfiniteSustain.get_active(); |
bool infSus = eEG2InfiniteSustain.get_value(); |
815 |
eEG2Decay2.set_sensitive(!infSus); |
eEG2Decay2.set_sensitive(!infSus); |
816 |
} |
} |
817 |
|
|
818 |
void DimRegionEdit::EG1Controller_changed() |
void DimRegionEdit::EG1Controller_changed() |
819 |
{ |
{ |
820 |
bool hasController = eEG1Controller.get_active_row_number() != 0; |
bool hasController = eEG1Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
821 |
eEG1ControllerInvert.set_sensitive(hasController); |
eEG1ControllerInvert.set_sensitive(hasController); |
822 |
} |
} |
823 |
|
|
824 |
void DimRegionEdit::EG2Controller_changed() |
void DimRegionEdit::EG2Controller_changed() |
825 |
{ |
{ |
826 |
bool hasController = eEG2Controller.get_active_row_number() != 0; |
bool hasController = eEG2Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
827 |
eEG2ControllerInvert.set_sensitive(hasController); |
eEG2ControllerInvert.set_sensitive(hasController); |
828 |
} |
} |
829 |
|
|
830 |
void DimRegionEdit::AttenuationController_changed() |
void DimRegionEdit::AttenuationController_changed() |
831 |
{ |
{ |
832 |
bool hasController = eAttenuationController.get_active_row_number() != 0; |
bool hasController = |
833 |
|
eAttenuationController.get_value().type != gig::leverage_ctrl_t::type_none; |
834 |
eInvertAttenuationController.set_sensitive(hasController); |
eInvertAttenuationController.set_sensitive(hasController); |
835 |
eAttenuationControllerThreshold.set_sensitive(hasController); |
eAttenuationControllerThreshold.set_sensitive(hasController); |
836 |
eCrossfade_in_start.set_sensitive(hasController); |
eCrossfade_in_start.set_sensitive(hasController); |
841 |
|
|
842 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
843 |
{ |
{ |
844 |
int rowno = eLFO1Controller.get_active_row_number(); |
gig::lfo1_ctrl_t ctrl = eLFO1Controller.get_value(); |
845 |
eLFO1ControlDepth.set_sensitive(rowno != 0); |
eLFO1ControlDepth.set_sensitive(ctrl != gig::lfo1_ctrl_internal); |
846 |
eLFO1InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO1InternalDepth.set_sensitive(ctrl != gig::lfo1_ctrl_modwheel && |
847 |
|
ctrl != gig::lfo1_ctrl_breath); |
848 |
} |
} |
849 |
|
|
850 |
void DimRegionEdit::LFO2Controller_changed() |
void DimRegionEdit::LFO2Controller_changed() |
851 |
{ |
{ |
852 |
int rowno = eLFO2Controller.get_active_row_number(); |
gig::lfo2_ctrl_t ctrl = eLFO2Controller.get_value(); |
853 |
eLFO2ControlDepth.set_sensitive(rowno != 0); |
eLFO2ControlDepth.set_sensitive(ctrl != gig::lfo2_ctrl_internal); |
854 |
eLFO2InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO2InternalDepth.set_sensitive(ctrl != gig::lfo2_ctrl_modwheel && |
855 |
|
ctrl != gig::lfo2_ctrl_foot); |
856 |
} |
} |
857 |
|
|
858 |
void DimRegionEdit::LFO3Controller_changed() |
void DimRegionEdit::LFO3Controller_changed() |
859 |
{ |
{ |
860 |
int rowno = eLFO3Controller.get_active_row_number(); |
gig::lfo3_ctrl_t ctrl = eLFO3Controller.get_value(); |
861 |
eLFO3ControlDepth.set_sensitive(rowno != 0); |
eLFO3ControlDepth.set_sensitive(ctrl != gig::lfo3_ctrl_internal); |
862 |
eLFO3InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO3InternalDepth.set_sensitive(ctrl != gig::lfo3_ctrl_modwheel && |
863 |
|
ctrl != gig::lfo3_ctrl_aftertouch); |
864 |
} |
} |
865 |
|
|
866 |
void DimRegionEdit::crossfade1_changed() |
void DimRegionEdit::crossfade1_changed() |
867 |
{ |
{ |
868 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
869 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
870 |
if (c1 > c2) eCrossfade_in_end.set_value(c1); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
871 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
872 |
|
update_model--; |
873 |
} |
} |
874 |
|
|
875 |
void DimRegionEdit::crossfade2_changed() |
void DimRegionEdit::crossfade2_changed() |
876 |
{ |
{ |
877 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
878 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
879 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
880 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
881 |
if (c2 < c1) eCrossfade_in_start.set_value(c2); |
update_model--; |
|
if (c2 > c3) eCrossfade_out_start.set_value(c2); |
|
882 |
} |
} |
883 |
|
|
884 |
void DimRegionEdit::crossfade3_changed() |
void DimRegionEdit::crossfade3_changed() |
885 |
{ |
{ |
886 |
double c2 = eCrossfade_in_end.get_value(); |
update_model++; |
887 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
888 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
889 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
890 |
if (c3 < c2) eCrossfade_in_end.set_value(c3); |
update_model--; |
|
if (c3 > c4) eCrossfade_out_end.set_value(c3); |
|
891 |
} |
} |
892 |
|
|
893 |
void DimRegionEdit::crossfade4_changed() |
void DimRegionEdit::crossfade4_changed() |
894 |
{ |
{ |
895 |
double c3 = eCrossfade_out_start.get_value(); |
update_model++; |
896 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
897 |
|
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
898 |
if (c4 < c3) eCrossfade_out_start.set_value(c4); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
899 |
} |
update_model--; |
|
|
|
|
void DimRegionEdit::loop_enabled_toggled() |
|
|
{ |
|
|
const bool active = eSampleLoopEnabled.get_active(); |
|
|
if (active) { |
|
|
// create a new sample loop in case there is none yet |
|
|
if (!dimregion->SampleLoops) { |
|
|
DLS::sample_loop_t loop; |
|
|
loop.LoopType = gig::loop_type_normal; |
|
|
// loop the whole sample by default |
|
|
loop.LoopStart = 0; |
|
|
loop.LoopLength = |
|
|
(dimregion->pSample) ? dimregion->pSample->GetSize() : 0; |
|
|
dimreg_to_be_changed_signal.emit(dimregion); |
|
|
dimregion->AddSampleLoop(&loop); |
|
|
dimreg_changed_signal.emit(dimregion); |
|
|
} |
|
|
} else { |
|
|
if (dimregion->SampleLoops) { |
|
|
dimreg_to_be_changed_signal.emit(dimregion); |
|
|
// delete ALL existing sample loops |
|
|
while (dimregion->SampleLoops) { |
|
|
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
|
|
} |
|
|
dimreg_changed_signal.emit(dimregion); |
|
|
} |
|
|
} |
|
|
updateLoopElements(); |
|
900 |
} |
} |
901 |
|
|
902 |
void DimRegionEdit::updateLoopElements() |
void DimRegionEdit::update_loop_elements() |
903 |
{ |
{ |
904 |
const bool active = eSampleLoopEnabled.get_active(); |
update_model++; |
905 |
|
const bool active = eSampleLoopEnabled.get_value(); |
906 |
eSampleLoopStart.set_sensitive(active); |
eSampleLoopStart.set_sensitive(active); |
907 |
eSampleLoopLength.set_sensitive(active); |
eSampleLoopLength.set_sensitive(active); |
908 |
eSampleLoopType.set_sensitive(active); |
eSampleLoopType.set_sensitive(active); |
909 |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
910 |
eSampleLoopStart.set_ptr(0); |
// sample loop shall never be longer than the actual sample size |
911 |
eSampleLoopLength.set_ptr(0); |
loop_start_changed(); |
912 |
eSampleLoopPlayCount.set_ptr(0); |
loop_length_changed(); |
913 |
|
eSampleLoopStart.set_value( |
914 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopStart : 0); |
915 |
|
eSampleLoopLength.set_value( |
916 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopLength : 0); |
917 |
|
|
918 |
|
eSampleLoopInfinite.set_value( |
919 |
|
dimregion->pSample && dimregion->pSample->LoopPlayCount == 0); |
920 |
|
|
921 |
|
loop_infinite_toggled(); |
922 |
|
update_model--; |
923 |
|
} |
924 |
|
|
925 |
|
void DimRegionEdit::loop_start_changed() { |
926 |
|
if (dimregion && dimregion->SampleLoops) { |
927 |
|
eSampleLoopLength.set_upper(dimregion->pSample ? |
928 |
|
dimregion->pSample->SamplesTotal - |
929 |
|
dimregion->pSampleLoops[0].LoopStart : 0); |
930 |
|
} |
931 |
|
} |
932 |
|
|
933 |
|
void DimRegionEdit::loop_length_changed() { |
934 |
if (dimregion && dimregion->SampleLoops) { |
if (dimregion && dimregion->SampleLoops) { |
935 |
eSampleLoopStart.set_ptr(&dimregion->pSampleLoops[0].LoopStart); |
eSampleLoopStart.set_upper(dimregion->pSample ? |
936 |
eSampleLoopLength.set_ptr(&dimregion->pSampleLoops[0].LoopLength); |
dimregion->pSample->SamplesTotal - |
937 |
eSampleLoopType.set_ptr(&dimregion->pSampleLoops[0].LoopType); |
dimregion->pSampleLoops[0].LoopLength : 0); |
|
eSampleLoopInfinite.set_active( |
|
|
dimregion->pSample && !dimregion->pSample->LoopPlayCount |
|
|
); |
|
|
// updated enabled state of loop play count widget |
|
|
loop_infinite_toggled(); |
|
|
|
|
|
eSampleLoopPlayCount.set_ptr( |
|
|
(dimregion->pSample) ? &dimregion->pSample->LoopPlayCount : 0 |
|
|
); |
|
|
|
|
|
// sample loop shall never be longer than the actual sample size |
|
|
eSampleLoopStart.set_upper( |
|
|
(dimregion->pSample) |
|
|
? dimregion->pSample->SamplesTotal - |
|
|
dimregion->pSampleLoops[0].LoopLength |
|
|
: 0 |
|
|
); |
|
|
eSampleLoopLength.set_upper( |
|
|
(dimregion->pSample) |
|
|
? dimregion->pSample->SamplesTotal - |
|
|
dimregion->pSampleLoops[0].LoopStart |
|
|
: 0 |
|
|
); |
|
|
} else { // no sample loop(s) |
|
|
eSampleLoopType.set_ptr(0); |
|
|
// updated enabled state of loop play count widget |
|
|
loop_infinite_toggled(); |
|
938 |
} |
} |
939 |
} |
} |
940 |
|
|
941 |
void DimRegionEdit::loop_infinite_toggled() { |
void DimRegionEdit::loop_infinite_toggled() { |
942 |
eSampleLoopPlayCount.set_sensitive( |
eSampleLoopPlayCount.set_sensitive( |
943 |
dimregion && dimregion->pSample && |
dimregion && dimregion->pSample && |
944 |
!eSampleLoopInfinite.get_active() && |
!eSampleLoopInfinite.get_value() && |
945 |
eSampleLoopEnabled.get_active() |
eSampleLoopEnabled.get_value() |
946 |
); |
); |
947 |
if (eSampleLoopInfinite.get_active()) |
update_model++; |
948 |
eSampleLoopPlayCount.set_value(0); |
eSampleLoopPlayCount.set_value( |
949 |
else if (!eSampleLoopPlayCount.get_value()) |
dimregion->pSample ? dimregion->pSample->LoopPlayCount : 0); |
950 |
eSampleLoopPlayCount.set_value(1); |
update_model--; |
951 |
} |
} |
952 |
|
|
953 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
958 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
959 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//dimreg_to_be_changed_signal.emit(dimregion); |
960 |
|
|
961 |
|
// make sure stereo samples always are the same in both |
962 |
|
// dimregs in the samplechannel dimension |
963 |
|
int nbDimregs = 1; |
964 |
|
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
965 |
|
if (sample->Channels == 2) { |
966 |
|
gig::Region* region = dimregion->GetParent(); |
967 |
|
|
968 |
|
int bitcount = 0; |
969 |
|
int stereo_bit = 0; |
970 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
971 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
972 |
|
stereo_bit = 1 << bitcount; |
973 |
|
break; |
974 |
|
} |
975 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
976 |
|
} |
977 |
|
|
978 |
|
if (stereo_bit) { |
979 |
|
int dimregno; |
980 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
981 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
982 |
|
break; |
983 |
|
} |
984 |
|
} |
985 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
986 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
987 |
|
nbDimregs = 2; |
988 |
|
} |
989 |
|
} |
990 |
|
|
991 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimregion->pSample; |
|
dimregion->pSample = sample; |
|
992 |
|
|
993 |
// copy sample information from Sample to DimensionRegion |
for (int i = 0 ; i < nbDimregs ; i++) { |
994 |
|
d[i]->pSample = sample; |
995 |
|
|
996 |
dimregion->UnityNote = sample->MIDIUnityNote; |
// copy sample information from Sample to DimensionRegion |
|
dimregion->FineTune = sample->FineTune; |
|
997 |
|
|
998 |
int loops = sample->Loops ? 1 : 0; |
d[i]->UnityNote = sample->MIDIUnityNote; |
999 |
while (dimregion->SampleLoops > loops) { |
d[i]->FineTune = sample->FineTune; |
1000 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
|
1001 |
} |
int loops = sample->Loops ? 1 : 0; |
1002 |
while (dimregion->SampleLoops < sample->Loops) { |
while (d[i]->SampleLoops > loops) { |
1003 |
DLS::sample_loop_t loop; |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1004 |
dimregion->AddSampleLoop(&loop); |
} |
1005 |
} |
while (d[i]->SampleLoops < sample->Loops) { |
1006 |
if (loops) { |
DLS::sample_loop_t loop; |
1007 |
dimregion->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
d[i]->AddSampleLoop(&loop); |
1008 |
dimregion->pSampleLoops[0].LoopType = sample->LoopType; |
} |
1009 |
dimregion->pSampleLoops[0].LoopStart = sample->LoopStart; |
if (loops) { |
1010 |
dimregion->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1011 |
|
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1012 |
|
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1013 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1014 |
|
} |
1015 |
} |
} |
1016 |
|
|
1017 |
// update ui |
// update ui |
1018 |
|
update_model++; |
1019 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(dimregion->pSample->pInfo->Name); |
1020 |
eUnityNote.set_ptr(&dimregion->UnityNote); |
eUnityNote.set_value(dimregion->UnityNote); |
1021 |
eFineTune.set_ptr(&dimregion->FineTune); |
eFineTune.set_value(dimregion->FineTune); |
1022 |
eSampleLoopEnabled.set_active(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
1023 |
updateLoopElements(); |
update_loop_elements(); |
1024 |
|
update_model--; |
1025 |
|
|
1026 |
sample_ref_changed_signal.emit(oldref, sample); |
sample_ref_changed_signal.emit(oldref, sample); |
1027 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1042 |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& DimRegionEdit::signal_sample_ref_changed() { |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& DimRegionEdit::signal_sample_ref_changed() { |
1043 |
return sample_ref_changed_signal; |
return sample_ref_changed_signal; |
1044 |
} |
} |
1045 |
|
|
1046 |
|
|
1047 |
|
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
1048 |
|
{ |
1049 |
|
d->UnityNote = value; |
1050 |
|
} |
1051 |
|
|
1052 |
|
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
1053 |
|
{ |
1054 |
|
d->FineTune = value; |
1055 |
|
} |
1056 |
|
|
1057 |
|
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
1058 |
|
uint8_t value) |
1059 |
|
{ |
1060 |
|
d->Crossfade.in_start = value; |
1061 |
|
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1062 |
|
} |
1063 |
|
|
1064 |
|
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
1065 |
|
uint8_t value) |
1066 |
|
{ |
1067 |
|
d->Crossfade.in_end = value; |
1068 |
|
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
1069 |
|
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1070 |
|
} |
1071 |
|
|
1072 |
|
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
1073 |
|
uint8_t value) |
1074 |
|
{ |
1075 |
|
d->Crossfade.out_start = value; |
1076 |
|
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
1077 |
|
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
1078 |
|
} |
1079 |
|
|
1080 |
|
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
1081 |
|
uint8_t value) |
1082 |
|
{ |
1083 |
|
d->Crossfade.out_end = value; |
1084 |
|
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1085 |
|
} |
1086 |
|
|
1087 |
|
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
1088 |
|
{ |
1089 |
|
d->SetGain(value); |
1090 |
|
} |
1091 |
|
|
1092 |
|
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
1093 |
|
{ |
1094 |
|
if (value) { |
1095 |
|
// create a new sample loop in case there is none yet |
1096 |
|
if (!d->SampleLoops) { |
1097 |
|
DLS::sample_loop_t loop; |
1098 |
|
loop.LoopType = gig::loop_type_normal; |
1099 |
|
// loop the whole sample by default |
1100 |
|
loop.LoopStart = 0; |
1101 |
|
loop.LoopLength = |
1102 |
|
(d->pSample) ? d->pSample->SamplesTotal : 0; |
1103 |
|
dimreg_to_be_changed_signal.emit(d); |
1104 |
|
d->AddSampleLoop(&loop); |
1105 |
|
dimreg_changed_signal.emit(d); |
1106 |
|
} |
1107 |
|
} else { |
1108 |
|
if (d->SampleLoops) { |
1109 |
|
dimreg_to_be_changed_signal.emit(d); |
1110 |
|
// delete ALL existing sample loops |
1111 |
|
while (d->SampleLoops) { |
1112 |
|
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1113 |
|
} |
1114 |
|
dimreg_changed_signal.emit(d); |
1115 |
|
} |
1116 |
|
} |
1117 |
|
} |
1118 |
|
|
1119 |
|
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
1120 |
|
{ |
1121 |
|
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
1122 |
|
} |
1123 |
|
|
1124 |
|
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
1125 |
|
{ |
1126 |
|
if (d->SampleLoops) { |
1127 |
|
d->pSampleLoops[0].LoopStart = |
1128 |
|
d->pSample ? |
1129 |
|
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1130 |
|
d->pSampleLoops[0].LoopLength)) : |
1131 |
|
0; |
1132 |
|
} |
1133 |
|
} |
1134 |
|
|
1135 |
|
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
1136 |
|
{ |
1137 |
|
if (d->SampleLoops) { |
1138 |
|
d->pSampleLoops[0].LoopLength = |
1139 |
|
d->pSample ? |
1140 |
|
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1141 |
|
d->pSampleLoops[0].LoopStart)) : |
1142 |
|
0; |
1143 |
|
} |
1144 |
|
} |
1145 |
|
|
1146 |
|
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
1147 |
|
{ |
1148 |
|
if (d->pSample) { |
1149 |
|
if (value) d->pSample->LoopPlayCount = 0; |
1150 |
|
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
1151 |
|
} |
1152 |
|
} |
1153 |
|
|
1154 |
|
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
1155 |
|
{ |
1156 |
|
if (d->pSample) d->pSample->LoopPlayCount = value; |
1157 |
|
} |