1 |
/* |
/* |
2 |
* Copyright (C) 2006, 2007 Andreas Persson |
* Copyright (C) 2006-2011 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" |
23 |
#define _(String) gettext(String) |
#include "compat.h" |
24 |
|
|
25 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
26 |
eEG1PreAttack("Pre-attack", 0, 100, 2), |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
27 |
eEG1Attack("Attack", 0, 60, 3), |
eEG1Attack(_("Attack"), 0, 60, 3), |
28 |
eEG1Decay1("Decay 1", 0.005, 60, 3), |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
29 |
eEG1Decay2("Decay 2", 0, 60, 3), |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
30 |
eEG1InfiniteSustain("Infinite sustain"), |
eEG1InfiniteSustain(_("Infinite sustain")), |
31 |
eEG1Sustain("Sustain", 0, 100, 2), |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
32 |
eEG1Release("Release", 0, 60, 3), |
eEG1Release(_("Release"), 0, 60, 3), |
33 |
eEG1Hold("Hold"), |
eEG1Hold(_("Hold")), |
34 |
eEG1Controller("Controller"), |
eEG1Controller(_("Controller")), |
35 |
eEG1ControllerInvert("Controller invert"), |
eEG1ControllerInvert(_("Controller invert")), |
36 |
eEG1ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
37 |
eEG1ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
38 |
eEG1ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
39 |
eLFO1Frequency("Frequency", 0.1, 10, 2), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
40 |
eLFO1InternalDepth("Internal depth", 0, 1200), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
41 |
eLFO1ControlDepth("Control depth", 0, 1200), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
42 |
eLFO1Controller("Controller"), |
eLFO1Controller(_("Controller")), |
43 |
eLFO1FlipPhase("Flip phase"), |
eLFO1FlipPhase(_("Flip phase")), |
44 |
eLFO1Sync("Sync"), |
eLFO1Sync(_("Sync")), |
45 |
eEG2PreAttack("Pre-attack", 0, 100, 2), |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
46 |
eEG2Attack("Attack", 0, 60, 3), |
eEG2Attack(_("Attack"), 0, 60, 3), |
47 |
eEG2Decay1("Decay 1", 0.005, 60, 3), |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
48 |
eEG2Decay2("Decay 2", 0, 60, 3), |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
49 |
eEG2InfiniteSustain("Infinite sustain"), |
eEG2InfiniteSustain(_("Infinite sustain")), |
50 |
eEG2Sustain("Sustain", 0, 100, 2), |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
51 |
eEG2Release("Release", 0, 60, 3), |
eEG2Release(_("Release"), 0, 60, 3), |
52 |
eEG2Controller("Controller"), |
eEG2Controller(_("Controller")), |
53 |
eEG2ControllerInvert("Controller invert"), |
eEG2ControllerInvert(_("Controller invert")), |
54 |
eEG2ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
55 |
eEG2ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
56 |
eEG2ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
57 |
eLFO2Frequency("Frequency", 0.1, 10, 2), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
58 |
eLFO2InternalDepth("Internal depth", 0, 1200), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
59 |
eLFO2ControlDepth("Control depth", 0, 1200), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
60 |
eLFO2Controller("Controller"), |
eLFO2Controller(_("Controller")), |
61 |
eLFO2FlipPhase("Flip phase"), |
eLFO2FlipPhase(_("Flip phase")), |
62 |
eLFO2Sync("Sync"), |
eLFO2Sync(_("Sync")), |
63 |
eEG3Attack("Attack", 0, 10, 3), |
eEG3Attack(_("Attack"), 0, 10, 3), |
64 |
eEG3Depth("Depth", -1200, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
65 |
eLFO3Frequency("Frequency", 0.1, 10, 2), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
66 |
eLFO3InternalDepth("Internal depth", 0, 1200), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
67 |
eLFO3ControlDepth("Control depth", 0, 1200), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
68 |
eLFO3Controller("Controller"), |
eLFO3Controller(_("Controller")), |
69 |
eLFO3Sync("Sync"), |
eLFO3Sync(_("Sync")), |
70 |
eVCFEnabled("Enabled"), |
eVCFEnabled(_("Enabled")), |
71 |
eVCFType("Type"), |
eVCFType(_("Type")), |
72 |
eVCFCutoffController("Cutoff controller"), |
eVCFCutoffController(_("Cutoff controller")), |
73 |
eVCFCutoffControllerInvert("Cutoff controller invert"), |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
74 |
eVCFCutoff("Cutoff"), |
eVCFCutoff(_("Cutoff")), |
75 |
eVCFVelocityCurve("Velocity curve"), |
eVCFVelocityCurve(_("Velocity curve")), |
76 |
eVCFVelocityScale("Velocity scale"), |
eVCFVelocityScale(_("Velocity scale")), |
77 |
eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4), |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
78 |
eVCFResonance("Resonance"), |
eVCFResonance(_("Resonance")), |
79 |
eVCFResonanceDynamic("Resonance dynamic"), |
eVCFResonanceDynamic(_("Resonance dynamic")), |
80 |
eVCFResonanceController("Resonance controller"), |
eVCFResonanceController(_("Resonance controller")), |
81 |
eVCFKeyboardTracking("Keyboard tracking"), |
eVCFKeyboardTracking(_("Keyboard tracking")), |
82 |
eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"), |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
83 |
eVelocityResponseCurve("Velocity response curve"), |
eVelocityResponseCurve(_("Velocity response curve")), |
84 |
eVelocityResponseDepth("Velocity response depth", 0, 4), |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
85 |
eVelocityResponseCurveScaling("Velocity response curve scaling"), |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
86 |
eReleaseVelocityResponseCurve("Release velocity response curve"), |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
87 |
eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4), |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
88 |
eReleaseTriggerDecay("Release trigger decay", 0, 8), |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
89 |
eCrossfade_in_start("Crossfade-in start"), |
eCrossfade_in_start(_("Crossfade-in start")), |
90 |
eCrossfade_in_end("Crossfade-in end"), |
eCrossfade_in_end(_("Crossfade-in end")), |
91 |
eCrossfade_out_start("Crossfade-out start"), |
eCrossfade_out_start(_("Crossfade-out start")), |
92 |
eCrossfade_out_end("Crossfade-out end"), |
eCrossfade_out_end(_("Crossfade-out end")), |
93 |
ePitchTrack("Pitch track"), |
ePitchTrack(_("Pitch track")), |
94 |
eDimensionBypass("Dimension bypass"), |
eDimensionBypass(_("Dimension bypass")), |
95 |
ePan("Pan", -64, 63), |
ePan(_("Pan"), -64, 63), |
96 |
eSelfMask("Self mask"), |
eSelfMask(_("Self mask")), |
97 |
eAttenuationController("Attenuation controller"), |
eAttenuationController(_("Attenuation controller")), |
98 |
eInvertAttenuationController("Invert attenuation controller"), |
eInvertAttenuationController(_("Invert attenuation controller")), |
99 |
eAttenuationControllerThreshold("Attenuation controller threshold"), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
100 |
eChannelOffset("Channel offset", 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
101 |
eSustainDefeat("Sustain defeat"), |
eSustainDefeat(_("Sustain defeat")), |
102 |
eMSDecode("MS decode"), |
eMSDecode(_("MS decode")), |
103 |
eSampleStartOffset("Sample start offset", 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
104 |
eUnityNote("Unity note"), |
eUnityNote(_("Unity note")), |
105 |
eFineTune("Fine tune", -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
106 |
eGain("Gain", -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
107 |
eGainPlus6("Gain +6dB", eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
108 |
eSampleLoopEnabled("Enabled"), |
eSampleLoopEnabled(_("Enabled")), |
109 |
eSampleLoopStart("Loop start positon"), |
eSampleLoopStart(_("Loop start positon")), |
110 |
eSampleLoopLength("Loop size"), |
eSampleLoopLength(_("Loop size")), |
111 |
eSampleLoopType("Loop type"), |
eSampleLoopType(_("Loop type")), |
112 |
eSampleLoopInfinite("Infinite loop"), |
eSampleLoopInfinite(_("Infinite loop")), |
113 |
eSampleLoopPlayCount("Playback count") |
eSampleLoopPlayCount(_("Playback count"), 1), |
114 |
{ |
update_model(0) |
115 |
|
{ |
116 |
|
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
117 |
|
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
118 |
|
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
119 |
|
connect(eEG1Decay2, &gig::DimensionRegion::EG1Decay2); |
120 |
|
connect(eEG1InfiniteSustain, &gig::DimensionRegion::EG1InfiniteSustain); |
121 |
|
connect(eEG1Sustain, &gig::DimensionRegion::EG1Sustain); |
122 |
|
connect(eEG1Release, &gig::DimensionRegion::EG1Release); |
123 |
|
connect(eEG1Hold, &gig::DimensionRegion::EG1Hold); |
124 |
|
connect(eEG1Controller, &gig::DimensionRegion::EG1Controller); |
125 |
|
connect(eEG1ControllerInvert, &gig::DimensionRegion::EG1ControllerInvert); |
126 |
|
connect(eEG1ControllerAttackInfluence, |
127 |
|
&gig::DimensionRegion::EG1ControllerAttackInfluence); |
128 |
|
connect(eEG1ControllerDecayInfluence, |
129 |
|
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
130 |
|
connect(eEG1ControllerReleaseInfluence, |
131 |
|
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
132 |
|
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
133 |
|
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
134 |
|
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
135 |
|
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
136 |
|
connect(eLFO1FlipPhase, &gig::DimensionRegion::LFO1FlipPhase); |
137 |
|
connect(eLFO1Sync, &gig::DimensionRegion::LFO1Sync); |
138 |
|
connect(eEG2PreAttack, &gig::DimensionRegion::EG2PreAttack); |
139 |
|
connect(eEG2Attack, &gig::DimensionRegion::EG2Attack); |
140 |
|
connect(eEG2Decay1, &gig::DimensionRegion::EG2Decay1); |
141 |
|
connect(eEG2Decay2, &gig::DimensionRegion::EG2Decay2); |
142 |
|
connect(eEG2InfiniteSustain, &gig::DimensionRegion::EG2InfiniteSustain); |
143 |
|
connect(eEG2Sustain, &gig::DimensionRegion::EG2Sustain); |
144 |
|
connect(eEG2Release, &gig::DimensionRegion::EG2Release); |
145 |
|
connect(eEG2Controller, &gig::DimensionRegion::EG2Controller); |
146 |
|
connect(eEG2ControllerInvert, &gig::DimensionRegion::EG2ControllerInvert); |
147 |
|
connect(eEG2ControllerAttackInfluence, |
148 |
|
&gig::DimensionRegion::EG2ControllerAttackInfluence); |
149 |
|
connect(eEG2ControllerDecayInfluence, |
150 |
|
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
151 |
|
connect(eEG2ControllerReleaseInfluence, |
152 |
|
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
153 |
|
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
154 |
|
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
155 |
|
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
156 |
|
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
157 |
|
connect(eLFO2FlipPhase, &gig::DimensionRegion::LFO2FlipPhase); |
158 |
|
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
159 |
|
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
160 |
|
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
161 |
|
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
162 |
|
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
163 |
|
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
164 |
|
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
165 |
|
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
166 |
|
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
167 |
|
connect(eVCFType, &gig::DimensionRegion::VCFType); |
168 |
|
connect(eVCFCutoffController, |
169 |
|
&gig::DimensionRegion::SetVCFCutoffController); |
170 |
|
connect(eVCFCutoffControllerInvert, |
171 |
|
&gig::DimensionRegion::VCFCutoffControllerInvert); |
172 |
|
connect(eVCFCutoff, &gig::DimensionRegion::VCFCutoff); |
173 |
|
connect(eVCFVelocityCurve, &gig::DimensionRegion::SetVCFVelocityCurve); |
174 |
|
connect(eVCFVelocityScale, &gig::DimensionRegion::SetVCFVelocityScale); |
175 |
|
connect(eVCFVelocityDynamicRange, |
176 |
|
&gig::DimensionRegion::SetVCFVelocityDynamicRange); |
177 |
|
connect(eVCFResonance, &gig::DimensionRegion::VCFResonance); |
178 |
|
connect(eVCFResonanceDynamic, &gig::DimensionRegion::VCFResonanceDynamic); |
179 |
|
connect(eVCFResonanceController, |
180 |
|
&gig::DimensionRegion::VCFResonanceController); |
181 |
|
connect(eVCFKeyboardTracking, &gig::DimensionRegion::VCFKeyboardTracking); |
182 |
|
connect(eVCFKeyboardTrackingBreakpoint, |
183 |
|
&gig::DimensionRegion::VCFKeyboardTrackingBreakpoint); |
184 |
|
connect(eVelocityResponseCurve, |
185 |
|
&gig::DimensionRegion::SetVelocityResponseCurve); |
186 |
|
connect(eVelocityResponseDepth, |
187 |
|
&gig::DimensionRegion::SetVelocityResponseDepth); |
188 |
|
connect(eVelocityResponseCurveScaling, |
189 |
|
&gig::DimensionRegion::SetVelocityResponseCurveScaling); |
190 |
|
connect(eReleaseVelocityResponseCurve, |
191 |
|
&gig::DimensionRegion::SetReleaseVelocityResponseCurve); |
192 |
|
connect(eReleaseVelocityResponseDepth, |
193 |
|
&gig::DimensionRegion::SetReleaseVelocityResponseDepth); |
194 |
|
connect(eReleaseTriggerDecay, &gig::DimensionRegion::ReleaseTriggerDecay); |
195 |
|
connect(eCrossfade_in_start, &DimRegionEdit::set_Crossfade_in_start); |
196 |
|
connect(eCrossfade_in_end, &DimRegionEdit::set_Crossfade_in_end); |
197 |
|
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
198 |
|
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
199 |
|
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
200 |
|
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
201 |
|
connect(ePan, &gig::DimensionRegion::Pan); |
202 |
|
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
203 |
|
connect(eAttenuationController, |
204 |
|
&gig::DimensionRegion::AttenuationController); |
205 |
|
connect(eInvertAttenuationController, |
206 |
|
&gig::DimensionRegion::InvertAttenuationController); |
207 |
|
connect(eAttenuationControllerThreshold, |
208 |
|
&gig::DimensionRegion::AttenuationControllerThreshold); |
209 |
|
connect(eChannelOffset, &gig::DimensionRegion::ChannelOffset); |
210 |
|
connect(eSustainDefeat, &gig::DimensionRegion::SustainDefeat); |
211 |
|
connect(eMSDecode, &gig::DimensionRegion::MSDecode); |
212 |
|
connect(eSampleStartOffset, &gig::DimensionRegion::SampleStartOffset); |
213 |
|
connect(eUnityNote, &DimRegionEdit::set_UnityNote); |
214 |
|
connect(eFineTune, &DimRegionEdit::set_FineTune); |
215 |
|
connect(eGain, &DimRegionEdit::set_Gain); |
216 |
|
connect(eGainPlus6, &DimRegionEdit::set_Gain); |
217 |
|
connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled); |
218 |
|
connect(eSampleLoopType, &DimRegionEdit::set_LoopType); |
219 |
|
connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart); |
220 |
|
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
221 |
|
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
222 |
|
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
223 |
|
|
224 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
225 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
226 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
266 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
267 |
|
|
268 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
269 |
addString("Sample", lSample, wSample); |
addString(_("Sample"), lSample, wSample); |
270 |
//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); |
271 |
|
#ifdef OLD_TOOLTIPS |
272 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
273 |
|
#else |
274 |
|
wSample->set_tooltip_text(_("Drop a sample here")); |
275 |
|
#endif |
276 |
addProp(eUnityNote); |
addProp(eUnityNote); |
277 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
278 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
279 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
280 |
addHeader("Loops"); |
addHeader(_("Loops")); |
281 |
addProp(eSampleLoopEnabled); |
addProp(eSampleLoopEnabled); |
282 |
addProp(eSampleLoopStart); |
addProp(eSampleLoopStart); |
283 |
addProp(eSampleLoopLength); |
addProp(eSampleLoopLength); |
284 |
{ |
{ |
285 |
const char* choices[] = { "normal", "bidirectional", "backward", 0 }; |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
286 |
static const uint32_t values[] = { |
static const uint32_t values[] = { |
287 |
gig::loop_type_normal, |
gig::loop_type_normal, |
288 |
gig::loop_type_bidirectional, |
gig::loop_type_bidirectional, |
322 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
323 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
324 |
{ |
{ |
325 |
const char* choices[] = { "internal", "modwheel", "breath", |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
326 |
"internal+modwheel", "internal+breath", 0 }; |
_("internal+modwheel"), _("internal+breath"), 0 }; |
327 |
static const gig::lfo1_ctrl_t values[] = { |
static const gig::lfo1_ctrl_t values[] = { |
328 |
gig::lfo1_ctrl_internal, |
gig::lfo1_ctrl_internal, |
329 |
gig::lfo1_ctrl_modwheel, |
gig::lfo1_ctrl_modwheel, |
336 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
337 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
338 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
339 |
addHeader("Crossfade"); |
addHeader(_("Crossfade")); |
340 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
341 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
342 |
addProp(eAttenuationControllerThreshold); |
addProp(eAttenuationControllerThreshold); |
350 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
351 |
addProp(eVCFEnabled); |
addProp(eVCFEnabled); |
352 |
{ |
{ |
353 |
const char* choices[] = { "lowpass", "lowpassturbo", "bandpass", |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
354 |
"highpass", "bandreject", 0 }; |
_("highpass"), _("bandreject"), 0 }; |
355 |
static const gig::vcf_type_t values[] = { |
static const gig::vcf_type_t values[] = { |
356 |
gig::vcf_type_lowpass, |
gig::vcf_type_lowpass, |
357 |
gig::vcf_type_lowpassturbo, |
gig::vcf_type_lowpassturbo, |
363 |
} |
} |
364 |
addProp(eVCFType); |
addProp(eVCFType); |
365 |
{ |
{ |
366 |
const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2", |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
367 |
"breath", "foot", "sustainpedal", "softpedal", |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
368 |
"genpurpose7", "genpurpose8", "aftertouch", 0 }; |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
369 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
static const gig::vcf_cutoff_ctrl_t values[] = { |
370 |
gig::vcf_cutoff_ctrl_none, |
gig::vcf_cutoff_ctrl_none, |
371 |
gig::vcf_cutoff_ctrl_none2, |
gig::vcf_cutoff_ctrl_none2, |
385 |
addProp(eVCFCutoffController); |
addProp(eVCFCutoffController); |
386 |
addProp(eVCFCutoffControllerInvert); |
addProp(eVCFCutoffControllerInvert); |
387 |
addProp(eVCFCutoff); |
addProp(eVCFCutoff); |
388 |
const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 }; |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
389 |
static const gig::curve_type_t curve_type_values[] = { |
static const gig::curve_type_t curve_type_values[] = { |
390 |
gig::curve_type_nonlinear, |
gig::curve_type_nonlinear, |
391 |
gig::curve_type_linear, |
gig::curve_type_linear, |
398 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
399 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
400 |
{ |
{ |
401 |
const char* choices[] = { "none", "genpurpose3", "genpurpose4", |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
402 |
"genpurpose5", "genpurpose6", 0 }; |
_("genpurpose5"), _("genpurpose6"), 0 }; |
403 |
static const gig::vcf_res_ctrl_t values[] = { |
static const gig::vcf_res_ctrl_t values[] = { |
404 |
gig::vcf_res_ctrl_none, |
gig::vcf_res_ctrl_none, |
405 |
gig::vcf_res_ctrl_genpurpose3, |
gig::vcf_res_ctrl_genpurpose3, |
415 |
|
|
416 |
nextPage(); |
nextPage(); |
417 |
|
|
418 |
addHeader(_("Filter Cutoff Envelope (EG2)")); |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
419 |
addProp(eEG2PreAttack); |
addProp(eEG2PreAttack); |
420 |
addProp(eEG2Attack); |
addProp(eEG2Attack); |
421 |
addProp(eEG2Decay1); |
addProp(eEG2Decay1); |
428 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
429 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
430 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
431 |
addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
432 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
433 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
434 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
435 |
{ |
{ |
436 |
const char* choices[] = { "internal", "modwheel", "foot", |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
437 |
"internal+modwheel", "internal+foot", 0 }; |
_("internal+modwheel"), _("internal+foot"), 0 }; |
438 |
static const gig::lfo2_ctrl_t values[] = { |
static const gig::lfo2_ctrl_t values[] = { |
439 |
gig::lfo2_ctrl_internal, |
gig::lfo2_ctrl_internal, |
440 |
gig::lfo2_ctrl_modwheel, |
gig::lfo2_ctrl_modwheel, |
461 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
462 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
463 |
{ |
{ |
464 |
const char* choices[] = { "internal", "modwheel", "aftertouch", |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
465 |
"internal+modwheel", "internal+aftertouch", 0 }; |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
466 |
static const gig::lfo3_ctrl_t values[] = { |
static const gig::lfo3_ctrl_t values[] = { |
467 |
gig::lfo3_ctrl_internal, |
gig::lfo3_ctrl_internal, |
468 |
gig::lfo3_ctrl_modwheel, |
gig::lfo3_ctrl_modwheel, |
487 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
488 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
489 |
{ |
{ |
490 |
const char* choices[] = { "none", "effect4depth", "effect5depth", 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
491 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
492 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
493 |
gig::dim_bypass_ctrl_94, |
gig::dim_bypass_ctrl_94, |
503 |
nextPage(); |
nextPage(); |
504 |
|
|
505 |
|
|
506 |
eEG1InfiniteSustain.signal_toggled().connect( |
eEG1InfiniteSustain.signal_value_changed().connect( |
507 |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled)); |
508 |
eEG2InfiniteSustain.signal_toggled().connect( |
eEG2InfiniteSustain.signal_value_changed().connect( |
509 |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled)); |
510 |
eEG1Controller.signal_changed().connect( |
eEG1Controller.signal_value_changed().connect( |
511 |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed)); |
512 |
eEG2Controller.signal_changed().connect( |
eEG2Controller.signal_value_changed().connect( |
513 |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed)); |
514 |
eLFO1Controller.signal_changed().connect( |
eLFO1Controller.signal_value_changed().connect( |
515 |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed)); |
516 |
eLFO2Controller.signal_changed().connect( |
eLFO2Controller.signal_value_changed().connect( |
517 |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed)); |
518 |
eLFO3Controller.signal_changed().connect( |
eLFO3Controller.signal_value_changed().connect( |
519 |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed)); |
520 |
eAttenuationController.signal_changed().connect( |
eAttenuationController.signal_value_changed().connect( |
521 |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed)); |
522 |
eVCFEnabled.signal_toggled().connect( |
eVCFEnabled.signal_value_changed().connect( |
523 |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled)); |
524 |
eVCFCutoffController.signal_changed().connect( |
eVCFCutoffController.signal_value_changed().connect( |
525 |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed)); |
526 |
eVCFResonanceController.signal_changed().connect( |
eVCFResonanceController.signal_value_changed().connect( |
527 |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed)); |
528 |
|
|
529 |
eCrossfade_in_start.signal_changed_by_user().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
530 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
531 |
eCrossfade_in_end.signal_changed_by_user().connect( |
eCrossfade_in_end.signal_value_changed().connect( |
532 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
533 |
eCrossfade_out_start.signal_changed_by_user().connect( |
eCrossfade_out_start.signal_value_changed().connect( |
534 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
535 |
eCrossfade_out_end.signal_changed_by_user().connect( |
eCrossfade_out_end.signal_value_changed().connect( |
536 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
537 |
|
|
538 |
eSampleLoopEnabled.signal_toggled().connect( |
eSampleLoopEnabled.signal_value_changed().connect( |
539 |
sigc::mem_fun(*this, &DimRegionEdit::loop_enabled_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements)); |
540 |
eSampleLoopStart.signal_changed_by_user().connect( |
eSampleLoopStart.signal_value_changed().connect( |
541 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed)); |
542 |
eSampleLoopLength.signal_changed_by_user().connect( |
eSampleLoopLength.signal_value_changed().connect( |
543 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed)); |
544 |
eSampleLoopInfinite.signal_toggled().connect( |
eSampleLoopInfinite.signal_value_changed().connect( |
545 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
546 |
|
|
547 |
append_page(*table[0], "Sample"); |
append_page(*table[0], _("Sample")); |
548 |
append_page(*table[1], "Amplitude (1)"); |
append_page(*table[1], _("Amplitude (1)")); |
549 |
append_page(*table[2], "Amplitude (2)"); |
append_page(*table[2], _("Amplitude (2)")); |
550 |
append_page(*table[3], "Filter (1)"); |
append_page(*table[3], _("Filter (1)")); |
551 |
append_page(*table[4], "Filter (2)"); |
append_page(*table[4], _("Filter (2)")); |
552 |
append_page(*table[5], "Pitch"); |
append_page(*table[5], _("Pitch")); |
553 |
append_page(*table[6], "Misc"); |
append_page(*table[6], _("Misc")); |
554 |
} |
} |
555 |
|
|
556 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
561 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
562 |
{ |
{ |
563 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
564 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
565 |
|
|
566 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
567 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
574 |
rowno++; |
rowno++; |
575 |
} |
} |
576 |
|
|
577 |
void DimRegionEdit::addHeader(const char* text) |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
578 |
{ |
{ |
579 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
580 |
{ |
{ |
587 |
str += "</b>"; |
str += "</b>"; |
588 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
589 |
label->set_use_markup(); |
label->set_use_markup(); |
590 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
591 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
592 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
593 |
rowno++; |
rowno++; |
594 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
595 |
|
return label; |
596 |
} |
} |
597 |
|
|
598 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
613 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
614 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
615 |
rowno++; |
rowno++; |
616 |
boolentry.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
} |
617 |
|
|
618 |
|
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
619 |
|
{ |
620 |
|
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
621 |
|
Gtk::FILL, Gtk::SHRINK); |
622 |
|
rowno++; |
623 |
} |
} |
624 |
|
|
625 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
629 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
630 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
631 |
rowno++; |
rowno++; |
|
prop.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
|
632 |
} |
} |
633 |
|
|
634 |
|
|
639 |
set_sensitive(d); |
set_sensitive(d); |
640 |
if (!d) return; |
if (!d) return; |
641 |
|
|
642 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL"); |
update_model++; |
643 |
eEG1PreAttack.set_ptr(&d->EG1PreAttack); |
eEG1PreAttack.set_value(d->EG1PreAttack); |
644 |
eEG1Attack.set_ptr(&d->EG1Attack); |
eEG1Attack.set_value(d->EG1Attack); |
645 |
eEG1Decay1.set_ptr(&d->EG1Decay1); |
eEG1Decay1.set_value(d->EG1Decay1); |
646 |
eEG1Decay2.set_ptr(&d->EG1Decay2); |
eEG1Decay2.set_value(d->EG1Decay2); |
647 |
eEG1InfiniteSustain.set_ptr(&d->EG1InfiniteSustain); |
eEG1InfiniteSustain.set_value(d->EG1InfiniteSustain); |
648 |
eEG1Sustain.set_ptr(&d->EG1Sustain); |
eEG1Sustain.set_value(d->EG1Sustain); |
649 |
eEG1Release.set_ptr(&d->EG1Release); |
eEG1Release.set_value(d->EG1Release); |
650 |
eEG1Hold.set_ptr(&d->EG1Hold); |
eEG1Hold.set_value(d->EG1Hold); |
651 |
eEG1Controller.set_ptr(&d->EG1Controller); |
eEG1Controller.set_value(d->EG1Controller); |
652 |
eEG1ControllerInvert.set_ptr(&d->EG1ControllerInvert); |
eEG1ControllerInvert.set_value(d->EG1ControllerInvert); |
653 |
eEG1ControllerAttackInfluence.set_ptr(&d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
654 |
eEG1ControllerDecayInfluence.set_ptr(&d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
655 |
eEG1ControllerReleaseInfluence.set_ptr(&d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
656 |
eLFO1Frequency.set_ptr(&d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
657 |
eLFO1InternalDepth.set_ptr(&d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
658 |
eLFO1ControlDepth.set_ptr(&d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
659 |
eLFO1Controller.set_ptr(&d->LFO1Controller); |
eLFO1Controller.set_value(d->LFO1Controller); |
660 |
eLFO1FlipPhase.set_ptr(&d->LFO1FlipPhase); |
eLFO1FlipPhase.set_value(d->LFO1FlipPhase); |
661 |
eLFO1Sync.set_ptr(&d->LFO1Sync); |
eLFO1Sync.set_value(d->LFO1Sync); |
662 |
eEG2PreAttack.set_ptr(&d->EG2PreAttack); |
eEG2PreAttack.set_value(d->EG2PreAttack); |
663 |
eEG2Attack.set_ptr(&d->EG2Attack); |
eEG2Attack.set_value(d->EG2Attack); |
664 |
eEG2Decay1.set_ptr(&d->EG2Decay1); |
eEG2Decay1.set_value(d->EG2Decay1); |
665 |
eEG2Decay2.set_ptr(&d->EG2Decay2); |
eEG2Decay2.set_value(d->EG2Decay2); |
666 |
eEG2InfiniteSustain.set_ptr(&d->EG2InfiniteSustain); |
eEG2InfiniteSustain.set_value(d->EG2InfiniteSustain); |
667 |
eEG2Sustain.set_ptr(&d->EG2Sustain); |
eEG2Sustain.set_value(d->EG2Sustain); |
668 |
eEG2Release.set_ptr(&d->EG2Release); |
eEG2Release.set_value(d->EG2Release); |
669 |
eEG2Controller.set_ptr(&d->EG2Controller); |
eEG2Controller.set_value(d->EG2Controller); |
670 |
eEG2ControllerInvert.set_ptr(&d->EG2ControllerInvert); |
eEG2ControllerInvert.set_value(d->EG2ControllerInvert); |
671 |
eEG2ControllerAttackInfluence.set_ptr(&d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
672 |
eEG2ControllerDecayInfluence.set_ptr(&d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
673 |
eEG2ControllerReleaseInfluence.set_ptr(&d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
674 |
eLFO2Frequency.set_ptr(&d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
675 |
eLFO2InternalDepth.set_ptr(&d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
676 |
eLFO2ControlDepth.set_ptr(&d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
677 |
eLFO2Controller.set_ptr(&d->LFO2Controller); |
eLFO2Controller.set_value(d->LFO2Controller); |
678 |
eLFO2FlipPhase.set_ptr(&d->LFO2FlipPhase); |
eLFO2FlipPhase.set_value(d->LFO2FlipPhase); |
679 |
eLFO2Sync.set_ptr(&d->LFO2Sync); |
eLFO2Sync.set_value(d->LFO2Sync); |
680 |
eEG3Attack.set_ptr(&d->EG3Attack); |
eEG3Attack.set_value(d->EG3Attack); |
681 |
eEG3Depth.set_ptr(&d->EG3Depth); |
eEG3Depth.set_value(d->EG3Depth); |
682 |
eLFO3Frequency.set_ptr(&d->LFO3Frequency); |
eLFO3Frequency.set_value(d->LFO3Frequency); |
683 |
eLFO3InternalDepth.set_ptr(&d->LFO3InternalDepth); |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
684 |
eLFO3ControlDepth.set_ptr(&d->LFO3ControlDepth); |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
685 |
eLFO3Controller.set_ptr(&d->LFO3Controller); |
eLFO3Controller.set_value(d->LFO3Controller); |
686 |
eLFO3Sync.set_ptr(&d->LFO3Sync); |
eLFO3Sync.set_value(d->LFO3Sync); |
687 |
eVCFEnabled.set_ptr(&d->VCFEnabled); |
eVCFEnabled.set_value(d->VCFEnabled); |
688 |
eVCFType.set_ptr(&d->VCFType); |
eVCFType.set_value(d->VCFType); |
689 |
eVCFCutoffController.set_ptr(&d->VCFCutoffController); |
eVCFCutoffController.set_value(d->VCFCutoffController); |
690 |
eVCFCutoffControllerInvert.set_ptr(&d->VCFCutoffControllerInvert); |
eVCFCutoffControllerInvert.set_value(d->VCFCutoffControllerInvert); |
691 |
eVCFCutoff.set_ptr(&d->VCFCutoff); |
eVCFCutoff.set_value(d->VCFCutoff); |
692 |
eVCFVelocityCurve.set_ptr(&d->VCFVelocityCurve); |
eVCFVelocityCurve.set_value(d->VCFVelocityCurve); |
693 |
eVCFVelocityScale.set_ptr(&d->VCFVelocityScale); |
eVCFVelocityScale.set_value(d->VCFVelocityScale); |
694 |
eVCFVelocityDynamicRange.set_ptr(&d->VCFVelocityDynamicRange); |
eVCFVelocityDynamicRange.set_value(d->VCFVelocityDynamicRange); |
695 |
eVCFResonance.set_ptr(&d->VCFResonance); |
eVCFResonance.set_value(d->VCFResonance); |
696 |
eVCFResonanceDynamic.set_ptr(&d->VCFResonanceDynamic); |
eVCFResonanceDynamic.set_value(d->VCFResonanceDynamic); |
697 |
eVCFResonanceController.set_ptr(&d->VCFResonanceController); |
eVCFResonanceController.set_value(d->VCFResonanceController); |
698 |
eVCFKeyboardTracking.set_ptr(&d->VCFKeyboardTracking); |
eVCFKeyboardTracking.set_value(d->VCFKeyboardTracking); |
699 |
eVCFKeyboardTrackingBreakpoint.set_ptr(&d->VCFKeyboardTrackingBreakpoint); |
eVCFKeyboardTrackingBreakpoint.set_value(d->VCFKeyboardTrackingBreakpoint); |
700 |
eVelocityResponseCurve.set_ptr(&d->VelocityResponseCurve); |
eVelocityResponseCurve.set_value(d->VelocityResponseCurve); |
701 |
eVelocityResponseDepth.set_ptr(&d->VelocityResponseDepth); |
eVelocityResponseDepth.set_value(d->VelocityResponseDepth); |
702 |
eVelocityResponseCurveScaling.set_ptr(&d->VelocityResponseCurveScaling); |
eVelocityResponseCurveScaling.set_value(d->VelocityResponseCurveScaling); |
703 |
eReleaseVelocityResponseCurve.set_ptr(&d->ReleaseVelocityResponseCurve); |
eReleaseVelocityResponseCurve.set_value(d->ReleaseVelocityResponseCurve); |
704 |
eReleaseVelocityResponseDepth.set_ptr(&d->ReleaseVelocityResponseDepth); |
eReleaseVelocityResponseDepth.set_value(d->ReleaseVelocityResponseDepth); |
705 |
eReleaseTriggerDecay.set_ptr(&d->ReleaseTriggerDecay); |
eReleaseTriggerDecay.set_value(d->ReleaseTriggerDecay); |
706 |
|
eCrossfade_in_start.set_value(d->Crossfade.in_start); |
707 |
eCrossfade_in_start.set_ptr(0); |
eCrossfade_in_end.set_value(d->Crossfade.in_end); |
708 |
eCrossfade_in_end.set_ptr(0); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
709 |
eCrossfade_out_start.set_ptr(0); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
710 |
eCrossfade_out_end.set_ptr(0); |
ePitchTrack.set_value(d->PitchTrack); |
711 |
eCrossfade_in_start.set_ptr(&d->Crossfade.in_start); |
eDimensionBypass.set_value(d->DimensionBypass); |
712 |
eCrossfade_in_end.set_ptr(&d->Crossfade.in_end); |
ePan.set_value(d->Pan); |
713 |
eCrossfade_out_start.set_ptr(&d->Crossfade.out_start); |
eSelfMask.set_value(d->SelfMask); |
714 |
eCrossfade_out_end.set_ptr(&d->Crossfade.out_end); |
eAttenuationController.set_value(d->AttenuationController); |
715 |
|
eInvertAttenuationController.set_value(d->InvertAttenuationController); |
716 |
ePitchTrack.set_ptr(&d->PitchTrack); |
eAttenuationControllerThreshold.set_value(d->AttenuationControllerThreshold); |
717 |
eDimensionBypass.set_ptr(&d->DimensionBypass); |
eChannelOffset.set_value(d->ChannelOffset); |
718 |
ePan.set_ptr(&d->Pan); |
eSustainDefeat.set_value(d->SustainDefeat); |
719 |
eSelfMask.set_ptr(&d->SelfMask); |
eMSDecode.set_value(d->MSDecode); |
720 |
eAttenuationController.set_ptr(&d->AttenuationController); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
721 |
eInvertAttenuationController.set_ptr(&d->InvertAttenuationController); |
eUnityNote.set_value(d->UnityNote); |
722 |
eAttenuationControllerThreshold.set_ptr(&d->AttenuationControllerThreshold); |
eFineTune.set_value(d->FineTune); |
723 |
eChannelOffset.set_ptr(&d->ChannelOffset); |
eGain.set_value(d->Gain); |
724 |
eSustainDefeat.set_ptr(&d->SustainDefeat); |
eGainPlus6.set_value(d->Gain); |
725 |
eMSDecode.set_ptr(&d->MSDecode); |
eSampleLoopEnabled.set_value(d->SampleLoops); |
726 |
eSampleStartOffset.set_ptr(&d->SampleStartOffset); |
eSampleLoopType.set_value( |
727 |
eUnityNote.set_ptr(&d->UnityNote); |
d->SampleLoops ? d->pSampleLoops[0].LoopType : 0); |
728 |
eFineTune.set_ptr(&d->FineTune); |
eSampleLoopStart.set_value( |
729 |
eGain.set_ptr(&d->Gain); |
d->SampleLoops ? d->pSampleLoops[0].LoopStart : 0); |
730 |
eGainPlus6.set_ptr(&d->Gain); |
eSampleLoopLength.set_value( |
731 |
|
d->SampleLoops ? d->pSampleLoops[0].LoopLength : 0); |
732 |
|
eSampleLoopInfinite.set_value( |
733 |
|
d->pSample && d->pSample->LoopPlayCount == 0); |
734 |
|
eSampleLoopPlayCount.set_value( |
735 |
|
d->pSample ? d->pSample->LoopPlayCount : 0); |
736 |
|
update_model--; |
737 |
|
|
738 |
eSampleLoopEnabled.set_active(d->SampleLoops); |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
|
updateLoopElements(); |
|
739 |
|
|
740 |
|
update_loop_elements(); |
741 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
742 |
} |
} |
743 |
|
|
744 |
|
|
745 |
void DimRegionEdit::VCFEnabled_toggled() |
void DimRegionEdit::VCFEnabled_toggled() |
746 |
{ |
{ |
747 |
bool sensitive = eVCFEnabled.get_active(); |
bool sensitive = eVCFEnabled.get_value(); |
748 |
eVCFType.set_sensitive(sensitive); |
eVCFType.set_sensitive(sensitive); |
749 |
eVCFCutoffController.set_sensitive(sensitive); |
eVCFCutoffController.set_sensitive(sensitive); |
750 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
754 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
755 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
756 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
757 |
|
lEG2->set_sensitive(sensitive); |
758 |
eEG2PreAttack.set_sensitive(sensitive); |
eEG2PreAttack.set_sensitive(sensitive); |
759 |
eEG2Attack.set_sensitive(sensitive); |
eEG2Attack.set_sensitive(sensitive); |
760 |
eEG2Decay1.set_sensitive(sensitive); |
eEG2Decay1.set_sensitive(sensitive); |
765 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
766 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
767 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
768 |
|
lLFO2->set_sensitive(sensitive); |
769 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
770 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
771 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
792 |
|
|
793 |
void DimRegionEdit::VCFCutoffController_changed() |
void DimRegionEdit::VCFCutoffController_changed() |
794 |
{ |
{ |
795 |
int rowno = eVCFCutoffController.get_active_row_number(); |
gig::vcf_cutoff_ctrl_t ctrl = eVCFCutoffController.get_value(); |
796 |
bool hasController = rowno != 0 && rowno != 1; |
bool hasController = ctrl != gig::vcf_cutoff_ctrl_none && ctrl != gig::vcf_cutoff_ctrl_none2; |
797 |
|
|
798 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
799 |
eVCFCutoff.set_sensitive(!hasController); |
eVCFCutoff.set_sensitive(!hasController); |
800 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
eVCFResonanceDynamic.set_sensitive(!hasController); |
801 |
eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" : |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
802 |
"Velocity scale:"); |
_("Velocity scale:")); |
803 |
} |
} |
804 |
|
|
805 |
void DimRegionEdit::VCFResonanceController_changed() |
void DimRegionEdit::VCFResonanceController_changed() |
806 |
{ |
{ |
807 |
bool hasController = eVCFResonanceController.get_active_row_number() != 0; |
bool hasController = eVCFResonanceController.get_value() != gig::vcf_res_ctrl_none; |
808 |
eVCFResonance.set_sensitive(!hasController); |
eVCFResonance.set_sensitive(!hasController); |
809 |
} |
} |
810 |
|
|
811 |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
812 |
{ |
{ |
813 |
bool infSus = eEG1InfiniteSustain.get_active(); |
bool infSus = eEG1InfiniteSustain.get_value(); |
814 |
eEG1Decay2.set_sensitive(!infSus); |
eEG1Decay2.set_sensitive(!infSus); |
815 |
} |
} |
816 |
|
|
817 |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
818 |
{ |
{ |
819 |
bool infSus = eEG2InfiniteSustain.get_active(); |
bool infSus = eEG2InfiniteSustain.get_value(); |
820 |
eEG2Decay2.set_sensitive(!infSus); |
eEG2Decay2.set_sensitive(!infSus); |
821 |
} |
} |
822 |
|
|
823 |
void DimRegionEdit::EG1Controller_changed() |
void DimRegionEdit::EG1Controller_changed() |
824 |
{ |
{ |
825 |
bool hasController = eEG1Controller.get_active_row_number() != 0; |
bool hasController = eEG1Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
826 |
eEG1ControllerInvert.set_sensitive(hasController); |
eEG1ControllerInvert.set_sensitive(hasController); |
827 |
} |
} |
828 |
|
|
829 |
void DimRegionEdit::EG2Controller_changed() |
void DimRegionEdit::EG2Controller_changed() |
830 |
{ |
{ |
831 |
bool hasController = eEG2Controller.get_active_row_number() != 0; |
bool hasController = eEG2Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
832 |
eEG2ControllerInvert.set_sensitive(hasController); |
eEG2ControllerInvert.set_sensitive(hasController); |
833 |
} |
} |
834 |
|
|
835 |
void DimRegionEdit::AttenuationController_changed() |
void DimRegionEdit::AttenuationController_changed() |
836 |
{ |
{ |
837 |
bool hasController = eAttenuationController.get_active_row_number() != 0; |
bool hasController = |
838 |
|
eAttenuationController.get_value().type != gig::leverage_ctrl_t::type_none; |
839 |
eInvertAttenuationController.set_sensitive(hasController); |
eInvertAttenuationController.set_sensitive(hasController); |
840 |
eAttenuationControllerThreshold.set_sensitive(hasController); |
eAttenuationControllerThreshold.set_sensitive(hasController); |
841 |
eCrossfade_in_start.set_sensitive(hasController); |
eCrossfade_in_start.set_sensitive(hasController); |
846 |
|
|
847 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
848 |
{ |
{ |
849 |
int rowno = eLFO1Controller.get_active_row_number(); |
gig::lfo1_ctrl_t ctrl = eLFO1Controller.get_value(); |
850 |
eLFO1ControlDepth.set_sensitive(rowno != 0); |
eLFO1ControlDepth.set_sensitive(ctrl != gig::lfo1_ctrl_internal); |
851 |
eLFO1InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO1InternalDepth.set_sensitive(ctrl != gig::lfo1_ctrl_modwheel && |
852 |
|
ctrl != gig::lfo1_ctrl_breath); |
853 |
} |
} |
854 |
|
|
855 |
void DimRegionEdit::LFO2Controller_changed() |
void DimRegionEdit::LFO2Controller_changed() |
856 |
{ |
{ |
857 |
int rowno = eLFO2Controller.get_active_row_number(); |
gig::lfo2_ctrl_t ctrl = eLFO2Controller.get_value(); |
858 |
eLFO2ControlDepth.set_sensitive(rowno != 0); |
eLFO2ControlDepth.set_sensitive(ctrl != gig::lfo2_ctrl_internal); |
859 |
eLFO2InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO2InternalDepth.set_sensitive(ctrl != gig::lfo2_ctrl_modwheel && |
860 |
|
ctrl != gig::lfo2_ctrl_foot); |
861 |
} |
} |
862 |
|
|
863 |
void DimRegionEdit::LFO3Controller_changed() |
void DimRegionEdit::LFO3Controller_changed() |
864 |
{ |
{ |
865 |
int rowno = eLFO3Controller.get_active_row_number(); |
gig::lfo3_ctrl_t ctrl = eLFO3Controller.get_value(); |
866 |
eLFO3ControlDepth.set_sensitive(rowno != 0); |
eLFO3ControlDepth.set_sensitive(ctrl != gig::lfo3_ctrl_internal); |
867 |
eLFO3InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO3InternalDepth.set_sensitive(ctrl != gig::lfo3_ctrl_modwheel && |
868 |
|
ctrl != gig::lfo3_ctrl_aftertouch); |
869 |
} |
} |
870 |
|
|
871 |
void DimRegionEdit::crossfade1_changed() |
void DimRegionEdit::crossfade1_changed() |
872 |
{ |
{ |
873 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
874 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
875 |
if (c1 > c2) eCrossfade_in_end.set_value(c1); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
876 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
877 |
|
update_model--; |
878 |
} |
} |
879 |
|
|
880 |
void DimRegionEdit::crossfade2_changed() |
void DimRegionEdit::crossfade2_changed() |
881 |
{ |
{ |
882 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
883 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
884 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
885 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
886 |
if (c2 < c1) eCrossfade_in_start.set_value(c2); |
update_model--; |
|
if (c2 > c3) eCrossfade_out_start.set_value(c2); |
|
887 |
} |
} |
888 |
|
|
889 |
void DimRegionEdit::crossfade3_changed() |
void DimRegionEdit::crossfade3_changed() |
890 |
{ |
{ |
891 |
double c2 = eCrossfade_in_end.get_value(); |
update_model++; |
892 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
893 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
894 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
895 |
if (c3 < c2) eCrossfade_in_end.set_value(c3); |
update_model--; |
|
if (c3 > c4) eCrossfade_out_end.set_value(c3); |
|
896 |
} |
} |
897 |
|
|
898 |
void DimRegionEdit::crossfade4_changed() |
void DimRegionEdit::crossfade4_changed() |
899 |
{ |
{ |
900 |
double c3 = eCrossfade_out_start.get_value(); |
update_model++; |
901 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
902 |
|
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
903 |
|
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
904 |
|
update_model--; |
905 |
|
} |
906 |
|
|
907 |
|
void DimRegionEdit::update_loop_elements() |
908 |
|
{ |
909 |
|
update_model++; |
910 |
|
const bool active = eSampleLoopEnabled.get_value(); |
911 |
|
eSampleLoopStart.set_sensitive(active); |
912 |
|
eSampleLoopLength.set_sensitive(active); |
913 |
|
eSampleLoopType.set_sensitive(active); |
914 |
|
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
915 |
|
// sample loop shall never be longer than the actual sample size |
916 |
|
loop_start_changed(); |
917 |
|
loop_length_changed(); |
918 |
|
eSampleLoopStart.set_value( |
919 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopStart : 0); |
920 |
|
eSampleLoopLength.set_value( |
921 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopLength : 0); |
922 |
|
|
923 |
|
eSampleLoopInfinite.set_value( |
924 |
|
dimregion->pSample && dimregion->pSample->LoopPlayCount == 0); |
925 |
|
|
926 |
|
loop_infinite_toggled(); |
927 |
|
update_model--; |
928 |
|
} |
929 |
|
|
930 |
|
void DimRegionEdit::loop_start_changed() { |
931 |
|
if (dimregion && dimregion->SampleLoops) { |
932 |
|
eSampleLoopLength.set_upper(dimregion->pSample ? |
933 |
|
dimregion->pSample->SamplesTotal - |
934 |
|
dimregion->pSampleLoops[0].LoopStart : 0); |
935 |
|
} |
936 |
|
} |
937 |
|
|
938 |
|
void DimRegionEdit::loop_length_changed() { |
939 |
|
if (dimregion && dimregion->SampleLoops) { |
940 |
|
eSampleLoopStart.set_upper(dimregion->pSample ? |
941 |
|
dimregion->pSample->SamplesTotal - |
942 |
|
dimregion->pSampleLoops[0].LoopLength : 0); |
943 |
|
} |
944 |
|
} |
945 |
|
|
946 |
|
void DimRegionEdit::loop_infinite_toggled() { |
947 |
|
eSampleLoopPlayCount.set_sensitive( |
948 |
|
dimregion && dimregion->pSample && |
949 |
|
!eSampleLoopInfinite.get_value() && |
950 |
|
eSampleLoopEnabled.get_value() |
951 |
|
); |
952 |
|
update_model++; |
953 |
|
eSampleLoopPlayCount.set_value( |
954 |
|
dimregion->pSample ? dimregion->pSample->LoopPlayCount : 0); |
955 |
|
update_model--; |
956 |
|
} |
957 |
|
|
958 |
|
bool DimRegionEdit::set_sample(gig::Sample* sample) |
959 |
|
{ |
960 |
|
if (dimregion) { |
961 |
|
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
962 |
|
|
963 |
|
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
964 |
|
//dimreg_to_be_changed_signal.emit(dimregion); |
965 |
|
|
966 |
|
// make sure stereo samples always are the same in both |
967 |
|
// dimregs in the samplechannel dimension |
968 |
|
int nbDimregs = 1; |
969 |
|
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
970 |
|
if (sample->Channels == 2) { |
971 |
|
gig::Region* region = dimregion->GetParent(); |
972 |
|
|
973 |
|
int bitcount = 0; |
974 |
|
int stereo_bit = 0; |
975 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
976 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
977 |
|
stereo_bit = 1 << bitcount; |
978 |
|
break; |
979 |
|
} |
980 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
981 |
|
} |
982 |
|
|
983 |
|
if (stereo_bit) { |
984 |
|
int dimregno; |
985 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
986 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
987 |
|
break; |
988 |
|
} |
989 |
|
} |
990 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
991 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
992 |
|
nbDimregs = 2; |
993 |
|
} |
994 |
|
} |
995 |
|
|
996 |
|
gig::Sample* oldref = dimregion->pSample; |
997 |
|
|
998 |
|
for (int i = 0 ; i < nbDimregs ; i++) { |
999 |
|
d[i]->pSample = sample; |
1000 |
|
|
1001 |
|
// copy sample information from Sample to DimensionRegion |
1002 |
|
|
1003 |
|
d[i]->UnityNote = sample->MIDIUnityNote; |
1004 |
|
d[i]->FineTune = sample->FineTune; |
1005 |
|
|
1006 |
|
int loops = sample->Loops ? 1 : 0; |
1007 |
|
while (d[i]->SampleLoops > loops) { |
1008 |
|
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1009 |
|
} |
1010 |
|
while (d[i]->SampleLoops < sample->Loops) { |
1011 |
|
DLS::sample_loop_t loop; |
1012 |
|
d[i]->AddSampleLoop(&loop); |
1013 |
|
} |
1014 |
|
if (loops) { |
1015 |
|
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1016 |
|
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1017 |
|
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1018 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1019 |
|
} |
1020 |
|
} |
1021 |
|
|
1022 |
|
// update ui |
1023 |
|
update_model++; |
1024 |
|
wSample->set_text(dimregion->pSample->pInfo->Name); |
1025 |
|
eUnityNote.set_value(dimregion->UnityNote); |
1026 |
|
eFineTune.set_value(dimregion->FineTune); |
1027 |
|
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
1028 |
|
update_loop_elements(); |
1029 |
|
update_model--; |
1030 |
|
|
1031 |
|
sample_ref_changed_signal.emit(oldref, sample); |
1032 |
|
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1033 |
|
//dimreg_changed_signal.emit(dimregion); |
1034 |
|
return true; |
1035 |
|
} |
1036 |
|
return false; |
1037 |
|
} |
1038 |
|
|
1039 |
|
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_to_be_changed() { |
1040 |
|
return dimreg_to_be_changed_signal; |
1041 |
|
} |
1042 |
|
|
1043 |
|
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_changed() { |
1044 |
|
return dimreg_changed_signal; |
1045 |
|
} |
1046 |
|
|
1047 |
|
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& DimRegionEdit::signal_sample_ref_changed() { |
1048 |
|
return sample_ref_changed_signal; |
1049 |
|
} |
1050 |
|
|
1051 |
|
|
1052 |
|
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
1053 |
|
{ |
1054 |
|
d->UnityNote = value; |
1055 |
|
} |
1056 |
|
|
1057 |
|
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
1058 |
|
{ |
1059 |
|
d->FineTune = value; |
1060 |
|
} |
1061 |
|
|
1062 |
|
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
1063 |
|
uint8_t value) |
1064 |
|
{ |
1065 |
|
d->Crossfade.in_start = value; |
1066 |
|
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1067 |
|
} |
1068 |
|
|
1069 |
|
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
1070 |
|
uint8_t value) |
1071 |
|
{ |
1072 |
|
d->Crossfade.in_end = value; |
1073 |
|
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
1074 |
|
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1075 |
|
} |
1076 |
|
|
1077 |
|
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
1078 |
|
uint8_t value) |
1079 |
|
{ |
1080 |
|
d->Crossfade.out_start = value; |
1081 |
|
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
1082 |
|
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
1083 |
|
} |
1084 |
|
|
1085 |
|
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
1086 |
|
uint8_t value) |
1087 |
|
{ |
1088 |
|
d->Crossfade.out_end = value; |
1089 |
|
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1090 |
|
} |
1091 |
|
|
1092 |
if (c4 < c3) eCrossfade_out_start.set_value(c4); |
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
1093 |
|
{ |
1094 |
|
d->SetGain(value); |
1095 |
} |
} |
1096 |
|
|
1097 |
void DimRegionEdit::loop_enabled_toggled() |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
1098 |
{ |
{ |
1099 |
const bool active = eSampleLoopEnabled.get_active(); |
if (value) { |
|
if (active) { |
|
1100 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1101 |
if (!dimregion->SampleLoops) { |
if (!d->SampleLoops) { |
1102 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1103 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1104 |
// loop the whole sample by default |
// loop the whole sample by default |
1105 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1106 |
loop.LoopLength = |
loop.LoopLength = |
1107 |
(dimregion->pSample) ? dimregion->pSample->GetSize() : 0; |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
1108 |
dimregion->AddSampleLoop(&loop); |
dimreg_to_be_changed_signal.emit(d); |
1109 |
dimreg_changed_signal(); |
d->AddSampleLoop(&loop); |
1110 |
|
dimreg_changed_signal.emit(d); |
1111 |
} |
} |
1112 |
} else { |
} else { |
1113 |
if (dimregion->SampleLoops) { |
if (d->SampleLoops) { |
1114 |
|
dimreg_to_be_changed_signal.emit(d); |
1115 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1116 |
while (dimregion->SampleLoops) { |
while (d->SampleLoops) { |
1117 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1118 |
} |
} |
1119 |
dimreg_changed_signal(); |
dimreg_changed_signal.emit(d); |
1120 |
} |
} |
1121 |
} |
} |
|
updateLoopElements(); |
|
1122 |
} |
} |
1123 |
|
|
1124 |
void DimRegionEdit::updateLoopElements() |
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
1125 |
{ |
{ |
1126 |
const bool active = eSampleLoopEnabled.get_active(); |
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
1127 |
eSampleLoopStart.set_sensitive(active); |
} |
|
eSampleLoopLength.set_sensitive(active); |
|
|
eSampleLoopType.set_sensitive(active); |
|
|
eSampleLoopInfinite.set_sensitive(active); |
|
|
eSampleLoopStart.set_ptr(0); |
|
|
eSampleLoopLength.set_ptr(0); |
|
|
eSampleLoopPlayCount.set_ptr(0); |
|
1128 |
|
|
1129 |
if (dimregion && dimregion->SampleLoops) { |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
1130 |
eSampleLoopStart.set_ptr(&dimregion->pSampleLoops[0].LoopStart); |
{ |
1131 |
eSampleLoopLength.set_ptr(&dimregion->pSampleLoops[0].LoopLength); |
if (d->SampleLoops) { |
1132 |
eSampleLoopType.set_ptr(&dimregion->pSampleLoops[0].LoopType); |
d->pSampleLoops[0].LoopStart = |
1133 |
eSampleLoopInfinite.set_active( |
d->pSample ? |
1134 |
dimregion->pSample && !dimregion->pSample->LoopPlayCount |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1135 |
); |
d->pSampleLoops[0].LoopLength)) : |
1136 |
// updated enabled state of loop play count widget |
0; |
|
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->GetSize() - |
|
|
dimregion->pSampleLoops[0].LoopLength |
|
|
: 0 |
|
|
); |
|
|
eSampleLoopLength.set_upper( |
|
|
(dimregion->pSample) |
|
|
? dimregion->pSample->GetSize() - |
|
|
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(); |
|
1137 |
} |
} |
1138 |
} |
} |
1139 |
|
|
1140 |
void DimRegionEdit::loop_infinite_toggled() { |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
1141 |
eSampleLoopPlayCount.set_sensitive( |
{ |
1142 |
!eSampleLoopInfinite.get_active() && |
if (d->SampleLoops) { |
1143 |
eSampleLoopEnabled.get_active() |
d->pSampleLoops[0].LoopLength = |
1144 |
); |
d->pSample ? |
1145 |
if (eSampleLoopInfinite.get_active()) |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1146 |
eSampleLoopPlayCount.set_value(0); |
d->pSampleLoops[0].LoopStart)) : |
1147 |
else if (!eSampleLoopPlayCount.get_value()) |
0; |
1148 |
eSampleLoopPlayCount.set_value(1); |
} |
1149 |
|
} |
1150 |
|
|
1151 |
|
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
1152 |
|
{ |
1153 |
|
if (d->pSample) { |
1154 |
|
if (value) d->pSample->LoopPlayCount = 0; |
1155 |
|
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
1156 |
|
} |
1157 |
|
} |
1158 |
|
|
1159 |
|
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
1160 |
|
{ |
1161 |
|
if (d->pSample) d->pSample->LoopPlayCount = value; |
1162 |
} |
} |