1 |
/* |
/* |
2 |
* Copyright (C) 2006, 2007 Andreas Persson |
* Copyright (C) 2006-2013 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 |
|
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
26 |
|
getter(getter), dimreg(0) { |
27 |
|
set_size_request(80, 80); |
28 |
|
} |
29 |
|
|
30 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
31 |
|
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
32 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
33 |
|
get_window()->create_cairo_context(); |
34 |
|
#if 0 |
35 |
|
} |
36 |
|
#endif |
37 |
|
#else |
38 |
|
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
39 |
|
#endif |
40 |
|
if (dimreg) { |
41 |
|
int w = get_width(); |
42 |
|
int h = get_height(); |
43 |
|
|
44 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
45 |
|
for (double x = 0 ; x <= w ; x++) { |
46 |
|
int vel = int(x * (127 - 1e-10) / w + 1); |
47 |
|
double y = (1 - (dimreg->*getter)(vel)) * (h - 3) + 1.5; |
48 |
|
|
49 |
|
if (x < 1e-10) { |
50 |
|
cr->move_to(x, y); |
51 |
|
} else { |
52 |
|
cr->line_to(x, y); |
53 |
|
} |
54 |
|
} |
55 |
|
if (pass == 0) { |
56 |
|
cr->line_to(w, h); |
57 |
|
cr->line_to(0, h); |
58 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 0.2 : 0.1); |
59 |
|
cr->fill(); |
60 |
|
} else { |
61 |
|
cr->set_line_width(3); |
62 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 1.0 : 0.3); |
63 |
|
cr->stroke(); |
64 |
|
} |
65 |
|
} |
66 |
|
} |
67 |
|
return true; |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
72 |
|
set_size_request(280, 80); |
73 |
|
} |
74 |
|
|
75 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
76 |
|
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
77 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
78 |
|
get_window()->create_cairo_context(); |
79 |
|
#if 0 |
80 |
|
} |
81 |
|
#endif |
82 |
|
#else |
83 |
|
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
84 |
|
#endif |
85 |
|
if (dimreg) { |
86 |
|
cr->translate(1.5, 0); |
87 |
|
|
88 |
|
// first, draw curves for the other layers |
89 |
|
gig::Region* region = dimreg->GetParent(); |
90 |
|
int dimregno; |
91 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
92 |
|
if (region->pDimensionRegions[dimregno] == dimreg) { |
93 |
|
break; |
94 |
|
} |
95 |
|
} |
96 |
|
int bitcount = 0; |
97 |
|
int layer_bit = 0; |
98 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
99 |
|
if (region->pDimensionDefinitions[dim].dimension == |
100 |
|
gig::dimension_layer) { |
101 |
|
layer_bit = 1 << bitcount; |
102 |
|
|
103 |
|
int mask = |
104 |
|
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
105 |
|
bitcount); |
106 |
|
int c = dimregno & mask; // mask away the layer dimension |
107 |
|
|
108 |
|
for (int i = 0 ; i < region->pDimensionDefinitions[dim].zones ; |
109 |
|
i++) { |
110 |
|
gig::DimensionRegion* d = |
111 |
|
region->pDimensionRegions[c + (i << bitcount)]; |
112 |
|
if (d != dimreg) { |
113 |
|
draw_one_curve(cr, d, false); |
114 |
|
} |
115 |
|
} |
116 |
|
break; |
117 |
|
} |
118 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
119 |
|
} |
120 |
|
|
121 |
|
// then, draw the currently selected layer |
122 |
|
draw_one_curve(cr, dimreg, is_sensitive()); |
123 |
|
} |
124 |
|
return true; |
125 |
|
} |
126 |
|
|
127 |
|
void CrossfadeCurve::draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr, |
128 |
|
const gig::DimensionRegion* d, |
129 |
|
bool sensitive) { |
130 |
|
int w = get_width(); |
131 |
|
int h = get_height(); |
132 |
|
|
133 |
|
if (d->Crossfade.out_end) { |
134 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
135 |
|
cr->move_to(d->Crossfade.in_start / 127.0 * (w - 3), h); |
136 |
|
cr->line_to(d->Crossfade.in_end / 127.0 * (w - 3), 1.5); |
137 |
|
cr->line_to(d->Crossfade.out_start / 127.0 * (w - 3), 1.5); |
138 |
|
cr->line_to(d->Crossfade.out_end / 127.0 * (w - 3), h); |
139 |
|
|
140 |
|
if (pass == 0) { |
141 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 0.2 : 0.1); |
142 |
|
cr->fill(); |
143 |
|
} else { |
144 |
|
cr->set_line_width(3); |
145 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 1.0 : 0.3); |
146 |
|
cr->stroke(); |
147 |
|
} |
148 |
|
} |
149 |
|
} |
150 |
|
} |
151 |
|
|
152 |
|
|
153 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
154 |
eEG1PreAttack("Pre-attack", 0, 100, 2), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
155 |
eEG1Attack("Attack", 0, 60, 3), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
156 |
eEG1Decay1("Decay 1", 0.005, 60, 3), |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
157 |
eEG1Decay2("Decay 2", 0, 60, 3), |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
158 |
eEG1InfiniteSustain("Infinite sustain"), |
eEG1Attack(_("Attack"), 0, 60, 3), |
159 |
eEG1Sustain("Sustain", 0, 100, 2), |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
160 |
eEG1Release("Release", 0, 60, 3), |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
161 |
eEG1Hold("Hold"), |
eEG1InfiniteSustain(_("Infinite sustain")), |
162 |
eEG1Controller("Controller"), |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
163 |
eEG1ControllerInvert("Controller invert"), |
eEG1Release(_("Release"), 0, 60, 3), |
164 |
eEG1ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG1Hold(_("Hold")), |
165 |
eEG1ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG1Controller(_("Controller")), |
166 |
eEG1ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG1ControllerInvert(_("Controller invert")), |
167 |
eLFO1Frequency("Frequency", 0.1, 10, 2), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
168 |
eLFO1InternalDepth("Internal depth", 0, 1200), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
169 |
eLFO1ControlDepth("Control depth", 0, 1200), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
170 |
eLFO1Controller("Controller"), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
171 |
eLFO1FlipPhase("Flip phase"), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
172 |
eLFO1Sync("Sync"), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
173 |
eEG2PreAttack("Pre-attack", 0, 100, 2), |
eLFO1Controller(_("Controller")), |
174 |
eEG2Attack("Attack", 0, 60, 3), |
eLFO1FlipPhase(_("Flip phase")), |
175 |
eEG2Decay1("Decay 1", 0.005, 60, 3), |
eLFO1Sync(_("Sync")), |
176 |
eEG2Decay2("Decay 2", 0, 60, 3), |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
177 |
eEG2InfiniteSustain("Infinite sustain"), |
eEG2Attack(_("Attack"), 0, 60, 3), |
178 |
eEG2Sustain("Sustain", 0, 100, 2), |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
179 |
eEG2Release("Release", 0, 60, 3), |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
180 |
eEG2Controller("Controller"), |
eEG2InfiniteSustain(_("Infinite sustain")), |
181 |
eEG2ControllerInvert("Controller invert"), |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
182 |
eEG2ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG2Release(_("Release"), 0, 60, 3), |
183 |
eEG2ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG2Controller(_("Controller")), |
184 |
eEG2ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG2ControllerInvert(_("Controller invert")), |
185 |
eLFO2Frequency("Frequency", 0.1, 10, 2), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
186 |
eLFO2InternalDepth("Internal depth", 0, 1200), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
187 |
eLFO2ControlDepth("Control depth", 0, 1200), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
188 |
eLFO2Controller("Controller"), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
189 |
eLFO2FlipPhase("Flip phase"), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
190 |
eLFO2Sync("Sync"), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
191 |
eEG3Attack("Attack", 0, 10, 3), |
eLFO2Controller(_("Controller")), |
192 |
eEG3Depth("Depth", -1200, 1200), |
eLFO2FlipPhase(_("Flip phase")), |
193 |
eLFO3Frequency("Frequency", 0.1, 10, 2), |
eLFO2Sync(_("Sync")), |
194 |
eLFO3InternalDepth("Internal depth", 0, 1200), |
eEG3Attack(_("Attack"), 0, 10, 3), |
195 |
eLFO3ControlDepth("Control depth", 0, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
196 |
eLFO3Controller("Controller"), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
197 |
eLFO3Sync("Sync"), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
198 |
eVCFEnabled("Enabled"), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
199 |
eVCFType("Type"), |
eLFO3Controller(_("Controller")), |
200 |
eVCFCutoffController("Cutoff controller"), |
eLFO3Sync(_("Sync")), |
201 |
eVCFCutoffControllerInvert("Cutoff controller invert"), |
eVCFEnabled(_("Enabled")), |
202 |
eVCFCutoff("Cutoff"), |
eVCFType(_("Type")), |
203 |
eVCFVelocityCurve("Velocity curve"), |
eVCFCutoffController(_("Cutoff controller")), |
204 |
eVCFVelocityScale("Velocity scale"), |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
205 |
eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4), |
eVCFCutoff(_("Cutoff")), |
206 |
eVCFResonance("Resonance"), |
eVCFVelocityCurve(_("Velocity curve")), |
207 |
eVCFResonanceDynamic("Resonance dynamic"), |
eVCFVelocityScale(_("Velocity scale")), |
208 |
eVCFResonanceController("Resonance controller"), |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
209 |
eVCFKeyboardTracking("Keyboard tracking"), |
eVCFResonance(_("Resonance")), |
210 |
eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"), |
eVCFResonanceDynamic(_("Resonance dynamic")), |
211 |
eVelocityResponseCurve("Velocity response curve"), |
eVCFResonanceController(_("Resonance controller")), |
212 |
eVelocityResponseDepth("Velocity response depth", 0, 4), |
eVCFKeyboardTracking(_("Keyboard tracking")), |
213 |
eVelocityResponseCurveScaling("Velocity response curve scaling"), |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
214 |
eReleaseVelocityResponseCurve("Release velocity response curve"), |
eVelocityResponseCurve(_("Velocity response curve")), |
215 |
eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4), |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
216 |
eReleaseTriggerDecay("Release trigger decay", 0, 8), |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
217 |
eCrossfade_in_start("Crossfade-in start"), |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
218 |
eCrossfade_in_end("Crossfade-in end"), |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
219 |
eCrossfade_out_start("Crossfade-out start"), |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
220 |
eCrossfade_out_end("Crossfade-out end"), |
eCrossfade_in_start(_("Crossfade-in start")), |
221 |
ePitchTrack("Pitch track"), |
eCrossfade_in_end(_("Crossfade-in end")), |
222 |
eDimensionBypass("Dimension bypass"), |
eCrossfade_out_start(_("Crossfade-out start")), |
223 |
ePan("Pan", -64, 63), |
eCrossfade_out_end(_("Crossfade-out end")), |
224 |
eSelfMask("Self mask"), |
ePitchTrack(_("Pitch track")), |
225 |
eAttenuationController("Attenuation controller"), |
eDimensionBypass(_("Dimension bypass")), |
226 |
eInvertAttenuationController("Invert attenuation controller"), |
ePan(_("Pan"), -64, 63), |
227 |
eAttenuationControllerThreshold("Attenuation controller threshold"), |
eSelfMask(_("Self mask")), |
228 |
eChannelOffset("Channel offset", 0, 9), |
eAttenuationController(_("Attenuation controller")), |
229 |
eSustainDefeat("Sustain defeat"), |
eInvertAttenuationController(_("Invert attenuation controller")), |
230 |
eMSDecode("MS decode"), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
231 |
eSampleStartOffset("Sample start offset", 0, 2000), |
eChannelOffset(_("Channel offset"), 0, 9), |
232 |
eUnityNote("Unity note"), |
eSustainDefeat(_("Sustain defeat")), |
233 |
eFineTune("Fine tune", -49, 50), |
eMSDecode(_("MS decode")), |
234 |
eGain("Gain", -96, 0, 2, -655360), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
235 |
eGainPlus6("Gain +6dB", eGain, 6 * -655360), |
eUnityNote(_("Unity note")), |
236 |
eSampleLoopEnabled("Enabled"), |
eFineTune(_("Fine tune"), -49, 50), |
237 |
eSampleLoopStart("Loop start positon"), |
eGain(_("Gain"), -96, 0, 2, -655360), |
238 |
eSampleLoopLength("Loop size"), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
239 |
eSampleLoopType("Loop type"), |
eSampleLoopEnabled(_("Enabled")), |
240 |
eSampleLoopInfinite("Infinite loop"), |
eSampleLoopStart(_("Loop start positon")), |
241 |
eSampleLoopPlayCount("Playback count") |
eSampleLoopLength(_("Loop size")), |
242 |
{ |
eSampleLoopType(_("Loop type")), |
243 |
|
eSampleLoopInfinite(_("Infinite loop")), |
244 |
|
eSampleLoopPlayCount(_("Playback count"), 1), |
245 |
|
update_model(0) |
246 |
|
{ |
247 |
|
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
248 |
|
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
249 |
|
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
250 |
|
connect(eEG1Decay2, &gig::DimensionRegion::EG1Decay2); |
251 |
|
connect(eEG1InfiniteSustain, &gig::DimensionRegion::EG1InfiniteSustain); |
252 |
|
connect(eEG1Sustain, &gig::DimensionRegion::EG1Sustain); |
253 |
|
connect(eEG1Release, &gig::DimensionRegion::EG1Release); |
254 |
|
connect(eEG1Hold, &gig::DimensionRegion::EG1Hold); |
255 |
|
connect(eEG1Controller, &gig::DimensionRegion::EG1Controller); |
256 |
|
connect(eEG1ControllerInvert, &gig::DimensionRegion::EG1ControllerInvert); |
257 |
|
connect(eEG1ControllerAttackInfluence, |
258 |
|
&gig::DimensionRegion::EG1ControllerAttackInfluence); |
259 |
|
connect(eEG1ControllerDecayInfluence, |
260 |
|
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
261 |
|
connect(eEG1ControllerReleaseInfluence, |
262 |
|
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
263 |
|
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
264 |
|
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
265 |
|
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
266 |
|
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
267 |
|
connect(eLFO1FlipPhase, &gig::DimensionRegion::LFO1FlipPhase); |
268 |
|
connect(eLFO1Sync, &gig::DimensionRegion::LFO1Sync); |
269 |
|
connect(eEG2PreAttack, &gig::DimensionRegion::EG2PreAttack); |
270 |
|
connect(eEG2Attack, &gig::DimensionRegion::EG2Attack); |
271 |
|
connect(eEG2Decay1, &gig::DimensionRegion::EG2Decay1); |
272 |
|
connect(eEG2Decay2, &gig::DimensionRegion::EG2Decay2); |
273 |
|
connect(eEG2InfiniteSustain, &gig::DimensionRegion::EG2InfiniteSustain); |
274 |
|
connect(eEG2Sustain, &gig::DimensionRegion::EG2Sustain); |
275 |
|
connect(eEG2Release, &gig::DimensionRegion::EG2Release); |
276 |
|
connect(eEG2Controller, &gig::DimensionRegion::EG2Controller); |
277 |
|
connect(eEG2ControllerInvert, &gig::DimensionRegion::EG2ControllerInvert); |
278 |
|
connect(eEG2ControllerAttackInfluence, |
279 |
|
&gig::DimensionRegion::EG2ControllerAttackInfluence); |
280 |
|
connect(eEG2ControllerDecayInfluence, |
281 |
|
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
282 |
|
connect(eEG2ControllerReleaseInfluence, |
283 |
|
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
284 |
|
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
285 |
|
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
286 |
|
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
287 |
|
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
288 |
|
connect(eLFO2FlipPhase, &gig::DimensionRegion::LFO2FlipPhase); |
289 |
|
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
290 |
|
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
291 |
|
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
292 |
|
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
293 |
|
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
294 |
|
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
295 |
|
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
296 |
|
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
297 |
|
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
298 |
|
connect(eVCFType, &gig::DimensionRegion::VCFType); |
299 |
|
connect(eVCFCutoffController, |
300 |
|
&gig::DimensionRegion::SetVCFCutoffController); |
301 |
|
connect(eVCFCutoffControllerInvert, |
302 |
|
&gig::DimensionRegion::VCFCutoffControllerInvert); |
303 |
|
connect(eVCFCutoff, &gig::DimensionRegion::VCFCutoff); |
304 |
|
connect(eVCFVelocityCurve, &gig::DimensionRegion::SetVCFVelocityCurve); |
305 |
|
connect(eVCFVelocityScale, &gig::DimensionRegion::SetVCFVelocityScale); |
306 |
|
connect(eVCFVelocityDynamicRange, |
307 |
|
&gig::DimensionRegion::SetVCFVelocityDynamicRange); |
308 |
|
connect(eVCFResonance, &gig::DimensionRegion::VCFResonance); |
309 |
|
connect(eVCFResonanceDynamic, &gig::DimensionRegion::VCFResonanceDynamic); |
310 |
|
connect(eVCFResonanceController, |
311 |
|
&gig::DimensionRegion::VCFResonanceController); |
312 |
|
connect(eVCFKeyboardTracking, &gig::DimensionRegion::VCFKeyboardTracking); |
313 |
|
connect(eVCFKeyboardTrackingBreakpoint, |
314 |
|
&gig::DimensionRegion::VCFKeyboardTrackingBreakpoint); |
315 |
|
connect(eVelocityResponseCurve, |
316 |
|
&gig::DimensionRegion::SetVelocityResponseCurve); |
317 |
|
connect(eVelocityResponseDepth, |
318 |
|
&gig::DimensionRegion::SetVelocityResponseDepth); |
319 |
|
connect(eVelocityResponseCurveScaling, |
320 |
|
&gig::DimensionRegion::SetVelocityResponseCurveScaling); |
321 |
|
connect(eReleaseVelocityResponseCurve, |
322 |
|
&gig::DimensionRegion::SetReleaseVelocityResponseCurve); |
323 |
|
connect(eReleaseVelocityResponseDepth, |
324 |
|
&gig::DimensionRegion::SetReleaseVelocityResponseDepth); |
325 |
|
connect(eReleaseTriggerDecay, &gig::DimensionRegion::ReleaseTriggerDecay); |
326 |
|
connect(eCrossfade_in_start, &DimRegionEdit::set_Crossfade_in_start); |
327 |
|
connect(eCrossfade_in_end, &DimRegionEdit::set_Crossfade_in_end); |
328 |
|
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
329 |
|
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
330 |
|
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
331 |
|
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
332 |
|
connect(ePan, &gig::DimensionRegion::Pan); |
333 |
|
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
334 |
|
connect(eAttenuationController, |
335 |
|
&gig::DimensionRegion::AttenuationController); |
336 |
|
connect(eInvertAttenuationController, |
337 |
|
&gig::DimensionRegion::InvertAttenuationController); |
338 |
|
connect(eAttenuationControllerThreshold, |
339 |
|
&gig::DimensionRegion::AttenuationControllerThreshold); |
340 |
|
connect(eChannelOffset, &gig::DimensionRegion::ChannelOffset); |
341 |
|
connect(eSustainDefeat, &gig::DimensionRegion::SustainDefeat); |
342 |
|
connect(eMSDecode, &gig::DimensionRegion::MSDecode); |
343 |
|
connect(eSampleStartOffset, &gig::DimensionRegion::SampleStartOffset); |
344 |
|
connect(eUnityNote, &DimRegionEdit::set_UnityNote); |
345 |
|
connect(eFineTune, &DimRegionEdit::set_FineTune); |
346 |
|
connect(eGain, &DimRegionEdit::set_Gain); |
347 |
|
connect(eGainPlus6, &DimRegionEdit::set_Gain); |
348 |
|
connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled); |
349 |
|
connect(eSampleLoopType, &DimRegionEdit::set_LoopType); |
350 |
|
connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart); |
351 |
|
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
352 |
|
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
353 |
|
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
354 |
|
|
355 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
356 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
357 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
397 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
398 |
|
|
399 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
400 |
addString("Sample", lSample, wSample); |
addString(_("Sample"), lSample, wSample); |
401 |
//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); |
402 |
|
#ifdef OLD_TOOLTIPS |
403 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
404 |
|
#else |
405 |
|
wSample->set_tooltip_text(_("Drop a sample here")); |
406 |
|
#endif |
407 |
addProp(eUnityNote); |
addProp(eUnityNote); |
408 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
409 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
410 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
411 |
addHeader("Loops"); |
addHeader(_("Loops")); |
412 |
addProp(eSampleLoopEnabled); |
addProp(eSampleLoopEnabled); |
413 |
addProp(eSampleLoopStart); |
addProp(eSampleLoopStart); |
414 |
addProp(eSampleLoopLength); |
addProp(eSampleLoopLength); |
415 |
{ |
{ |
416 |
const char* choices[] = { "normal", "bidirectional", "backward", 0 }; |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
417 |
static const uint32_t values[] = { |
static const uint32_t values[] = { |
418 |
gig::loop_type_normal, |
gig::loop_type_normal, |
419 |
gig::loop_type_bidirectional, |
gig::loop_type_bidirectional, |
453 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
454 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
455 |
{ |
{ |
456 |
const char* choices[] = { "internal", "modwheel", "breath", |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
457 |
"internal+modwheel", "internal+breath", 0 }; |
_("internal+modwheel"), _("internal+breath"), 0 }; |
458 |
static const gig::lfo1_ctrl_t values[] = { |
static const gig::lfo1_ctrl_t values[] = { |
459 |
gig::lfo1_ctrl_internal, |
gig::lfo1_ctrl_internal, |
460 |
gig::lfo1_ctrl_modwheel, |
gig::lfo1_ctrl_modwheel, |
467 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
468 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
469 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
470 |
addHeader("Crossfade"); |
addHeader(_("Crossfade")); |
471 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
472 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
473 |
addProp(eAttenuationControllerThreshold); |
addProp(eAttenuationControllerThreshold); |
476 |
addProp(eCrossfade_out_start); |
addProp(eCrossfade_out_start); |
477 |
addProp(eCrossfade_out_end); |
addProp(eCrossfade_out_end); |
478 |
|
|
479 |
|
Gtk::Frame* frame = new Gtk::Frame; |
480 |
|
frame->add(crossfade_curve); |
481 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
482 |
|
Gtk::SHRINK, Gtk::SHRINK); |
483 |
|
rowno++; |
484 |
|
|
485 |
|
eCrossfade_in_start.signal_value_changed().connect( |
486 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
487 |
|
eCrossfade_in_end.signal_value_changed().connect( |
488 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
489 |
|
eCrossfade_out_start.signal_value_changed().connect( |
490 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
491 |
|
eCrossfade_out_end.signal_value_changed().connect( |
492 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
493 |
|
|
494 |
nextPage(); |
nextPage(); |
495 |
|
|
496 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
497 |
addProp(eVCFEnabled); |
addProp(eVCFEnabled); |
498 |
{ |
{ |
499 |
const char* choices[] = { "lowpass", "lowpassturbo", "bandpass", |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
500 |
"highpass", "bandreject", 0 }; |
_("highpass"), _("bandreject"), 0 }; |
501 |
static const gig::vcf_type_t values[] = { |
static const gig::vcf_type_t values[] = { |
502 |
gig::vcf_type_lowpass, |
gig::vcf_type_lowpass, |
503 |
gig::vcf_type_lowpassturbo, |
gig::vcf_type_lowpassturbo, |
509 |
} |
} |
510 |
addProp(eVCFType); |
addProp(eVCFType); |
511 |
{ |
{ |
512 |
const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2", |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
513 |
"breath", "foot", "sustainpedal", "softpedal", |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
514 |
"genpurpose7", "genpurpose8", "aftertouch", 0 }; |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
515 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
static const gig::vcf_cutoff_ctrl_t values[] = { |
516 |
gig::vcf_cutoff_ctrl_none, |
gig::vcf_cutoff_ctrl_none, |
517 |
gig::vcf_cutoff_ctrl_none2, |
gig::vcf_cutoff_ctrl_none2, |
531 |
addProp(eVCFCutoffController); |
addProp(eVCFCutoffController); |
532 |
addProp(eVCFCutoffControllerInvert); |
addProp(eVCFCutoffControllerInvert); |
533 |
addProp(eVCFCutoff); |
addProp(eVCFCutoff); |
534 |
const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 }; |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
535 |
static const gig::curve_type_t curve_type_values[] = { |
static const gig::curve_type_t curve_type_values[] = { |
536 |
gig::curve_type_nonlinear, |
gig::curve_type_nonlinear, |
537 |
gig::curve_type_linear, |
gig::curve_type_linear, |
541 |
addProp(eVCFVelocityCurve); |
addProp(eVCFVelocityCurve); |
542 |
addProp(eVCFVelocityScale); |
addProp(eVCFVelocityScale); |
543 |
addProp(eVCFVelocityDynamicRange); |
addProp(eVCFVelocityDynamicRange); |
544 |
|
|
545 |
|
eVCFCutoffController.signal_value_changed().connect( |
546 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
547 |
|
eVCFVelocityCurve.signal_value_changed().connect( |
548 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
549 |
|
eVCFVelocityScale.signal_value_changed().connect( |
550 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
551 |
|
eVCFVelocityDynamicRange.signal_value_changed().connect( |
552 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
553 |
|
|
554 |
|
frame = new Gtk::Frame; |
555 |
|
frame->add(cutoff_curve); |
556 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
557 |
|
Gtk::SHRINK, Gtk::SHRINK); |
558 |
|
rowno++; |
559 |
|
|
560 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
561 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
562 |
{ |
{ |
563 |
const char* choices[] = { "none", "genpurpose3", "genpurpose4", |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
564 |
"genpurpose5", "genpurpose6", 0 }; |
_("genpurpose5"), _("genpurpose6"), 0 }; |
565 |
static const gig::vcf_res_ctrl_t values[] = { |
static const gig::vcf_res_ctrl_t values[] = { |
566 |
gig::vcf_res_ctrl_none, |
gig::vcf_res_ctrl_none, |
567 |
gig::vcf_res_ctrl_genpurpose3, |
gig::vcf_res_ctrl_genpurpose3, |
577 |
|
|
578 |
nextPage(); |
nextPage(); |
579 |
|
|
580 |
addHeader(_("Filter Cutoff Envelope (EG2)")); |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
581 |
addProp(eEG2PreAttack); |
addProp(eEG2PreAttack); |
582 |
addProp(eEG2Attack); |
addProp(eEG2Attack); |
583 |
addProp(eEG2Decay1); |
addProp(eEG2Decay1); |
590 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
591 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
592 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
593 |
addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
594 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
595 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
596 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
597 |
{ |
{ |
598 |
const char* choices[] = { "internal", "modwheel", "foot", |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
599 |
"internal+modwheel", "internal+foot", 0 }; |
_("internal+modwheel"), _("internal+foot"), 0 }; |
600 |
static const gig::lfo2_ctrl_t values[] = { |
static const gig::lfo2_ctrl_t values[] = { |
601 |
gig::lfo2_ctrl_internal, |
gig::lfo2_ctrl_internal, |
602 |
gig::lfo2_ctrl_modwheel, |
gig::lfo2_ctrl_modwheel, |
623 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
624 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
625 |
{ |
{ |
626 |
const char* choices[] = { "internal", "modwheel", "aftertouch", |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
627 |
"internal+modwheel", "internal+aftertouch", 0 }; |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
628 |
static const gig::lfo3_ctrl_t values[] = { |
static const gig::lfo3_ctrl_t values[] = { |
629 |
gig::lfo3_ctrl_internal, |
gig::lfo3_ctrl_internal, |
630 |
gig::lfo3_ctrl_modwheel, |
gig::lfo3_ctrl_modwheel, |
639 |
|
|
640 |
nextPage(); |
nextPage(); |
641 |
|
|
642 |
|
addHeader(_("Velocity Reponse")); |
643 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
644 |
addProp(eVelocityResponseCurve); |
addProp(eVelocityResponseCurve); |
645 |
addProp(eVelocityResponseDepth); |
addProp(eVelocityResponseDepth); |
646 |
addProp(eVelocityResponseCurveScaling); |
addProp(eVelocityResponseCurveScaling); |
647 |
|
|
648 |
|
eVelocityResponseCurve.signal_value_changed().connect( |
649 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
650 |
|
eVelocityResponseDepth.signal_value_changed().connect( |
651 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
652 |
|
eVelocityResponseCurveScaling.signal_value_changed().connect( |
653 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
654 |
|
|
655 |
|
frame = new Gtk::Frame; |
656 |
|
frame->add(velocity_curve); |
657 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
658 |
|
Gtk::SHRINK, Gtk::SHRINK); |
659 |
|
rowno++; |
660 |
|
|
661 |
|
addHeader(_("Release Velocity Reponse")); |
662 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
663 |
curve_type_values); |
curve_type_values); |
664 |
addProp(eReleaseVelocityResponseCurve); |
addProp(eReleaseVelocityResponseCurve); |
665 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
666 |
|
|
667 |
|
eReleaseVelocityResponseCurve.signal_value_changed().connect( |
668 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
669 |
|
eReleaseVelocityResponseDepth.signal_value_changed().connect( |
670 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
671 |
|
frame = new Gtk::Frame; |
672 |
|
frame->add(release_curve); |
673 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
674 |
|
Gtk::SHRINK, Gtk::SHRINK); |
675 |
|
rowno++; |
676 |
|
|
677 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
678 |
{ |
{ |
679 |
const char* choices[] = { "none", "effect4depth", "effect5depth", 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
680 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
681 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
682 |
gig::dim_bypass_ctrl_94, |
gig::dim_bypass_ctrl_94, |
692 |
nextPage(); |
nextPage(); |
693 |
|
|
694 |
|
|
695 |
eEG1InfiniteSustain.signal_toggled().connect( |
eEG1InfiniteSustain.signal_value_changed().connect( |
696 |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled)); |
697 |
eEG2InfiniteSustain.signal_toggled().connect( |
eEG2InfiniteSustain.signal_value_changed().connect( |
698 |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled)); |
699 |
eEG1Controller.signal_changed().connect( |
eEG1Controller.signal_value_changed().connect( |
700 |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed)); |
701 |
eEG2Controller.signal_changed().connect( |
eEG2Controller.signal_value_changed().connect( |
702 |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed)); |
703 |
eLFO1Controller.signal_changed().connect( |
eLFO1Controller.signal_value_changed().connect( |
704 |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed)); |
705 |
eLFO2Controller.signal_changed().connect( |
eLFO2Controller.signal_value_changed().connect( |
706 |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed)); |
707 |
eLFO3Controller.signal_changed().connect( |
eLFO3Controller.signal_value_changed().connect( |
708 |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed)); |
709 |
eAttenuationController.signal_changed().connect( |
eAttenuationController.signal_value_changed().connect( |
710 |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed)); |
711 |
eVCFEnabled.signal_toggled().connect( |
eVCFEnabled.signal_value_changed().connect( |
712 |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled)); |
713 |
eVCFCutoffController.signal_changed().connect( |
eVCFCutoffController.signal_value_changed().connect( |
714 |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed)); |
715 |
eVCFResonanceController.signal_changed().connect( |
eVCFResonanceController.signal_value_changed().connect( |
716 |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed)); |
717 |
|
|
718 |
eCrossfade_in_start.signal_changed_by_user().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
719 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
720 |
eCrossfade_in_end.signal_changed_by_user().connect( |
eCrossfade_in_end.signal_value_changed().connect( |
721 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
722 |
eCrossfade_out_start.signal_changed_by_user().connect( |
eCrossfade_out_start.signal_value_changed().connect( |
723 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
724 |
eCrossfade_out_end.signal_changed_by_user().connect( |
eCrossfade_out_end.signal_value_changed().connect( |
725 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
726 |
|
|
727 |
eSampleLoopEnabled.signal_toggled().connect( |
eSampleLoopEnabled.signal_value_changed().connect( |
728 |
sigc::mem_fun(*this, &DimRegionEdit::loop_enabled_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements)); |
729 |
eSampleLoopStart.signal_changed_by_user().connect( |
eSampleLoopStart.signal_value_changed().connect( |
730 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed)); |
731 |
eSampleLoopLength.signal_changed_by_user().connect( |
eSampleLoopLength.signal_value_changed().connect( |
732 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed)); |
733 |
eSampleLoopInfinite.signal_toggled().connect( |
eSampleLoopInfinite.signal_value_changed().connect( |
734 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
735 |
|
|
736 |
append_page(*table[0], "Sample"); |
append_page(*table[0], _("Sample")); |
737 |
append_page(*table[1], "Amplitude (1)"); |
append_page(*table[1], _("Amplitude (1)")); |
738 |
append_page(*table[2], "Amplitude (2)"); |
append_page(*table[2], _("Amplitude (2)")); |
739 |
append_page(*table[3], "Filter (1)"); |
append_page(*table[3], _("Filter (1)")); |
740 |
append_page(*table[4], "Filter (2)"); |
append_page(*table[4], _("Filter (2)")); |
741 |
append_page(*table[5], "Pitch"); |
append_page(*table[5], _("Pitch")); |
742 |
append_page(*table[6], "Misc"); |
append_page(*table[6], _("Misc")); |
743 |
} |
} |
744 |
|
|
745 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
750 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
751 |
{ |
{ |
752 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
753 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
754 |
|
|
755 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
756 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
763 |
rowno++; |
rowno++; |
764 |
} |
} |
765 |
|
|
766 |
void DimRegionEdit::addHeader(const char* text) |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
767 |
{ |
{ |
768 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
769 |
{ |
{ |
776 |
str += "</b>"; |
str += "</b>"; |
777 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
778 |
label->set_use_markup(); |
label->set_use_markup(); |
779 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
780 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
781 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
782 |
rowno++; |
rowno++; |
783 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
784 |
|
return label; |
785 |
} |
} |
786 |
|
|
787 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
802 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
803 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
804 |
rowno++; |
rowno++; |
|
boolentry.signal_changed_by_user().connect( |
|
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
|
|
); |
|
805 |
} |
} |
806 |
|
|
807 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
809 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
810 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
811 |
rowno++; |
rowno++; |
|
boolentry.signal_changed_by_user().connect( |
|
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
|
|
); |
|
812 |
} |
} |
813 |
|
|
814 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
818 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
819 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
820 |
rowno++; |
rowno++; |
|
prop.signal_changed_by_user().connect( |
|
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
|
|
); |
|
821 |
} |
} |
822 |
|
|
823 |
|
|
824 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
825 |
{ |
{ |
826 |
dimregion = d; |
dimregion = d; |
827 |
|
velocity_curve.set_dim_region(d); |
828 |
|
release_curve.set_dim_region(d); |
829 |
|
cutoff_curve.set_dim_region(d); |
830 |
|
crossfade_curve.set_dim_region(d); |
831 |
|
|
832 |
set_sensitive(d); |
set_sensitive(d); |
833 |
if (!d) return; |
if (!d) return; |
834 |
|
|
835 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL"); |
update_model++; |
836 |
eEG1PreAttack.set_ptr(&d->EG1PreAttack); |
eEG1PreAttack.set_value(d->EG1PreAttack); |
837 |
eEG1Attack.set_ptr(&d->EG1Attack); |
eEG1Attack.set_value(d->EG1Attack); |
838 |
eEG1Decay1.set_ptr(&d->EG1Decay1); |
eEG1Decay1.set_value(d->EG1Decay1); |
839 |
eEG1Decay2.set_ptr(&d->EG1Decay2); |
eEG1Decay2.set_value(d->EG1Decay2); |
840 |
eEG1InfiniteSustain.set_ptr(&d->EG1InfiniteSustain); |
eEG1InfiniteSustain.set_value(d->EG1InfiniteSustain); |
841 |
eEG1Sustain.set_ptr(&d->EG1Sustain); |
eEG1Sustain.set_value(d->EG1Sustain); |
842 |
eEG1Release.set_ptr(&d->EG1Release); |
eEG1Release.set_value(d->EG1Release); |
843 |
eEG1Hold.set_ptr(&d->EG1Hold); |
eEG1Hold.set_value(d->EG1Hold); |
844 |
eEG1Controller.set_ptr(&d->EG1Controller); |
eEG1Controller.set_value(d->EG1Controller); |
845 |
eEG1ControllerInvert.set_ptr(&d->EG1ControllerInvert); |
eEG1ControllerInvert.set_value(d->EG1ControllerInvert); |
846 |
eEG1ControllerAttackInfluence.set_ptr(&d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
847 |
eEG1ControllerDecayInfluence.set_ptr(&d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
848 |
eEG1ControllerReleaseInfluence.set_ptr(&d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
849 |
eLFO1Frequency.set_ptr(&d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
850 |
eLFO1InternalDepth.set_ptr(&d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
851 |
eLFO1ControlDepth.set_ptr(&d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
852 |
eLFO1Controller.set_ptr(&d->LFO1Controller); |
eLFO1Controller.set_value(d->LFO1Controller); |
853 |
eLFO1FlipPhase.set_ptr(&d->LFO1FlipPhase); |
eLFO1FlipPhase.set_value(d->LFO1FlipPhase); |
854 |
eLFO1Sync.set_ptr(&d->LFO1Sync); |
eLFO1Sync.set_value(d->LFO1Sync); |
855 |
eEG2PreAttack.set_ptr(&d->EG2PreAttack); |
eEG2PreAttack.set_value(d->EG2PreAttack); |
856 |
eEG2Attack.set_ptr(&d->EG2Attack); |
eEG2Attack.set_value(d->EG2Attack); |
857 |
eEG2Decay1.set_ptr(&d->EG2Decay1); |
eEG2Decay1.set_value(d->EG2Decay1); |
858 |
eEG2Decay2.set_ptr(&d->EG2Decay2); |
eEG2Decay2.set_value(d->EG2Decay2); |
859 |
eEG2InfiniteSustain.set_ptr(&d->EG2InfiniteSustain); |
eEG2InfiniteSustain.set_value(d->EG2InfiniteSustain); |
860 |
eEG2Sustain.set_ptr(&d->EG2Sustain); |
eEG2Sustain.set_value(d->EG2Sustain); |
861 |
eEG2Release.set_ptr(&d->EG2Release); |
eEG2Release.set_value(d->EG2Release); |
862 |
eEG2Controller.set_ptr(&d->EG2Controller); |
eEG2Controller.set_value(d->EG2Controller); |
863 |
eEG2ControllerInvert.set_ptr(&d->EG2ControllerInvert); |
eEG2ControllerInvert.set_value(d->EG2ControllerInvert); |
864 |
eEG2ControllerAttackInfluence.set_ptr(&d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
865 |
eEG2ControllerDecayInfluence.set_ptr(&d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
866 |
eEG2ControllerReleaseInfluence.set_ptr(&d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
867 |
eLFO2Frequency.set_ptr(&d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
868 |
eLFO2InternalDepth.set_ptr(&d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
869 |
eLFO2ControlDepth.set_ptr(&d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
870 |
eLFO2Controller.set_ptr(&d->LFO2Controller); |
eLFO2Controller.set_value(d->LFO2Controller); |
871 |
eLFO2FlipPhase.set_ptr(&d->LFO2FlipPhase); |
eLFO2FlipPhase.set_value(d->LFO2FlipPhase); |
872 |
eLFO2Sync.set_ptr(&d->LFO2Sync); |
eLFO2Sync.set_value(d->LFO2Sync); |
873 |
eEG3Attack.set_ptr(&d->EG3Attack); |
eEG3Attack.set_value(d->EG3Attack); |
874 |
eEG3Depth.set_ptr(&d->EG3Depth); |
eEG3Depth.set_value(d->EG3Depth); |
875 |
eLFO3Frequency.set_ptr(&d->LFO3Frequency); |
eLFO3Frequency.set_value(d->LFO3Frequency); |
876 |
eLFO3InternalDepth.set_ptr(&d->LFO3InternalDepth); |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
877 |
eLFO3ControlDepth.set_ptr(&d->LFO3ControlDepth); |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
878 |
eLFO3Controller.set_ptr(&d->LFO3Controller); |
eLFO3Controller.set_value(d->LFO3Controller); |
879 |
eLFO3Sync.set_ptr(&d->LFO3Sync); |
eLFO3Sync.set_value(d->LFO3Sync); |
880 |
eVCFEnabled.set_ptr(&d->VCFEnabled); |
eVCFEnabled.set_value(d->VCFEnabled); |
881 |
eVCFType.set_ptr(&d->VCFType); |
eVCFType.set_value(d->VCFType); |
882 |
eVCFCutoffController.set_ptr(&d->VCFCutoffController); |
eVCFCutoffController.set_value(d->VCFCutoffController); |
883 |
eVCFCutoffControllerInvert.set_ptr(&d->VCFCutoffControllerInvert); |
eVCFCutoffControllerInvert.set_value(d->VCFCutoffControllerInvert); |
884 |
eVCFCutoff.set_ptr(&d->VCFCutoff); |
eVCFCutoff.set_value(d->VCFCutoff); |
885 |
eVCFVelocityCurve.set_ptr(&d->VCFVelocityCurve); |
eVCFVelocityCurve.set_value(d->VCFVelocityCurve); |
886 |
eVCFVelocityScale.set_ptr(&d->VCFVelocityScale); |
eVCFVelocityScale.set_value(d->VCFVelocityScale); |
887 |
eVCFVelocityDynamicRange.set_ptr(&d->VCFVelocityDynamicRange); |
eVCFVelocityDynamicRange.set_value(d->VCFVelocityDynamicRange); |
888 |
eVCFResonance.set_ptr(&d->VCFResonance); |
eVCFResonance.set_value(d->VCFResonance); |
889 |
eVCFResonanceDynamic.set_ptr(&d->VCFResonanceDynamic); |
eVCFResonanceDynamic.set_value(d->VCFResonanceDynamic); |
890 |
eVCFResonanceController.set_ptr(&d->VCFResonanceController); |
eVCFResonanceController.set_value(d->VCFResonanceController); |
891 |
eVCFKeyboardTracking.set_ptr(&d->VCFKeyboardTracking); |
eVCFKeyboardTracking.set_value(d->VCFKeyboardTracking); |
892 |
eVCFKeyboardTrackingBreakpoint.set_ptr(&d->VCFKeyboardTrackingBreakpoint); |
eVCFKeyboardTrackingBreakpoint.set_value(d->VCFKeyboardTrackingBreakpoint); |
893 |
eVelocityResponseCurve.set_ptr(&d->VelocityResponseCurve); |
eVelocityResponseCurve.set_value(d->VelocityResponseCurve); |
894 |
eVelocityResponseDepth.set_ptr(&d->VelocityResponseDepth); |
eVelocityResponseDepth.set_value(d->VelocityResponseDepth); |
895 |
eVelocityResponseCurveScaling.set_ptr(&d->VelocityResponseCurveScaling); |
eVelocityResponseCurveScaling.set_value(d->VelocityResponseCurveScaling); |
896 |
eReleaseVelocityResponseCurve.set_ptr(&d->ReleaseVelocityResponseCurve); |
eReleaseVelocityResponseCurve.set_value(d->ReleaseVelocityResponseCurve); |
897 |
eReleaseVelocityResponseDepth.set_ptr(&d->ReleaseVelocityResponseDepth); |
eReleaseVelocityResponseDepth.set_value(d->ReleaseVelocityResponseDepth); |
898 |
eReleaseTriggerDecay.set_ptr(&d->ReleaseTriggerDecay); |
eReleaseTriggerDecay.set_value(d->ReleaseTriggerDecay); |
899 |
|
eCrossfade_in_start.set_value(d->Crossfade.in_start); |
900 |
eCrossfade_in_start.set_ptr(0); |
eCrossfade_in_end.set_value(d->Crossfade.in_end); |
901 |
eCrossfade_in_end.set_ptr(0); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
902 |
eCrossfade_out_start.set_ptr(0); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
903 |
eCrossfade_out_end.set_ptr(0); |
ePitchTrack.set_value(d->PitchTrack); |
904 |
eCrossfade_in_start.set_ptr(&d->Crossfade.in_start); |
eDimensionBypass.set_value(d->DimensionBypass); |
905 |
eCrossfade_in_end.set_ptr(&d->Crossfade.in_end); |
ePan.set_value(d->Pan); |
906 |
eCrossfade_out_start.set_ptr(&d->Crossfade.out_start); |
eSelfMask.set_value(d->SelfMask); |
907 |
eCrossfade_out_end.set_ptr(&d->Crossfade.out_end); |
eAttenuationController.set_value(d->AttenuationController); |
908 |
|
eInvertAttenuationController.set_value(d->InvertAttenuationController); |
909 |
ePitchTrack.set_ptr(&d->PitchTrack); |
eAttenuationControllerThreshold.set_value(d->AttenuationControllerThreshold); |
910 |
eDimensionBypass.set_ptr(&d->DimensionBypass); |
eChannelOffset.set_value(d->ChannelOffset); |
911 |
ePan.set_ptr(&d->Pan); |
eSustainDefeat.set_value(d->SustainDefeat); |
912 |
eSelfMask.set_ptr(&d->SelfMask); |
eMSDecode.set_value(d->MSDecode); |
913 |
eAttenuationController.set_ptr(&d->AttenuationController); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
914 |
eInvertAttenuationController.set_ptr(&d->InvertAttenuationController); |
eUnityNote.set_value(d->UnityNote); |
915 |
eAttenuationControllerThreshold.set_ptr(&d->AttenuationControllerThreshold); |
eFineTune.set_value(d->FineTune); |
916 |
eChannelOffset.set_ptr(&d->ChannelOffset); |
eGain.set_value(d->Gain); |
917 |
eSustainDefeat.set_ptr(&d->SustainDefeat); |
eGainPlus6.set_value(d->Gain); |
918 |
eMSDecode.set_ptr(&d->MSDecode); |
eSampleLoopEnabled.set_value(d->SampleLoops); |
919 |
eSampleStartOffset.set_ptr(&d->SampleStartOffset); |
eSampleLoopType.set_value( |
920 |
eUnityNote.set_ptr(&d->UnityNote); |
d->SampleLoops ? d->pSampleLoops[0].LoopType : 0); |
921 |
eFineTune.set_ptr(&d->FineTune); |
eSampleLoopStart.set_value( |
922 |
eGain.set_ptr(&d->Gain); |
d->SampleLoops ? d->pSampleLoops[0].LoopStart : 0); |
923 |
eGainPlus6.set_ptr(&d->Gain); |
eSampleLoopLength.set_value( |
924 |
|
d->SampleLoops ? d->pSampleLoops[0].LoopLength : 0); |
925 |
|
eSampleLoopInfinite.set_value( |
926 |
|
d->pSample && d->pSample->LoopPlayCount == 0); |
927 |
|
eSampleLoopPlayCount.set_value( |
928 |
|
d->pSample ? d->pSample->LoopPlayCount : 0); |
929 |
|
update_model--; |
930 |
|
|
931 |
eSampleLoopEnabled.set_active(d->SampleLoops); |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
|
updateLoopElements(); |
|
932 |
|
|
933 |
|
update_loop_elements(); |
934 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
935 |
} |
} |
936 |
|
|
937 |
|
|
938 |
void DimRegionEdit::VCFEnabled_toggled() |
void DimRegionEdit::VCFEnabled_toggled() |
939 |
{ |
{ |
940 |
bool sensitive = eVCFEnabled.get_active(); |
bool sensitive = eVCFEnabled.get_value(); |
941 |
eVCFType.set_sensitive(sensitive); |
eVCFType.set_sensitive(sensitive); |
942 |
eVCFCutoffController.set_sensitive(sensitive); |
eVCFCutoffController.set_sensitive(sensitive); |
943 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
944 |
eVCFVelocityScale.set_sensitive(sensitive); |
eVCFVelocityScale.set_sensitive(sensitive); |
945 |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
946 |
|
cutoff_curve.set_sensitive(sensitive); |
947 |
eVCFResonance.set_sensitive(sensitive); |
eVCFResonance.set_sensitive(sensitive); |
948 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
949 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
950 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
951 |
|
lEG2->set_sensitive(sensitive); |
952 |
eEG2PreAttack.set_sensitive(sensitive); |
eEG2PreAttack.set_sensitive(sensitive); |
953 |
eEG2Attack.set_sensitive(sensitive); |
eEG2Attack.set_sensitive(sensitive); |
954 |
eEG2Decay1.set_sensitive(sensitive); |
eEG2Decay1.set_sensitive(sensitive); |
959 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
960 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
961 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
962 |
|
lLFO2->set_sensitive(sensitive); |
963 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
964 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
965 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
986 |
|
|
987 |
void DimRegionEdit::VCFCutoffController_changed() |
void DimRegionEdit::VCFCutoffController_changed() |
988 |
{ |
{ |
989 |
int rowno = eVCFCutoffController.get_active_row_number(); |
gig::vcf_cutoff_ctrl_t ctrl = eVCFCutoffController.get_value(); |
990 |
bool hasController = rowno != 0 && rowno != 1; |
bool hasController = ctrl != gig::vcf_cutoff_ctrl_none && ctrl != gig::vcf_cutoff_ctrl_none2; |
991 |
|
|
992 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
993 |
eVCFCutoff.set_sensitive(!hasController); |
eVCFCutoff.set_sensitive(!hasController); |
994 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
eVCFResonanceDynamic.set_sensitive(!hasController); |
995 |
eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" : |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
996 |
"Velocity scale:"); |
_("Velocity scale:")); |
997 |
} |
} |
998 |
|
|
999 |
void DimRegionEdit::VCFResonanceController_changed() |
void DimRegionEdit::VCFResonanceController_changed() |
1000 |
{ |
{ |
1001 |
bool hasController = eVCFResonanceController.get_active_row_number() != 0; |
bool hasController = eVCFResonanceController.get_value() != gig::vcf_res_ctrl_none; |
1002 |
eVCFResonance.set_sensitive(!hasController); |
eVCFResonance.set_sensitive(!hasController); |
1003 |
} |
} |
1004 |
|
|
1005 |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
1006 |
{ |
{ |
1007 |
bool infSus = eEG1InfiniteSustain.get_active(); |
bool infSus = eEG1InfiniteSustain.get_value(); |
1008 |
eEG1Decay2.set_sensitive(!infSus); |
eEG1Decay2.set_sensitive(!infSus); |
1009 |
} |
} |
1010 |
|
|
1011 |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
1012 |
{ |
{ |
1013 |
bool infSus = eEG2InfiniteSustain.get_active(); |
bool infSus = eEG2InfiniteSustain.get_value(); |
1014 |
eEG2Decay2.set_sensitive(!infSus); |
eEG2Decay2.set_sensitive(!infSus); |
1015 |
} |
} |
1016 |
|
|
1017 |
void DimRegionEdit::EG1Controller_changed() |
void DimRegionEdit::EG1Controller_changed() |
1018 |
{ |
{ |
1019 |
bool hasController = eEG1Controller.get_active_row_number() != 0; |
bool hasController = eEG1Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
1020 |
eEG1ControllerInvert.set_sensitive(hasController); |
eEG1ControllerInvert.set_sensitive(hasController); |
1021 |
} |
} |
1022 |
|
|
1023 |
void DimRegionEdit::EG2Controller_changed() |
void DimRegionEdit::EG2Controller_changed() |
1024 |
{ |
{ |
1025 |
bool hasController = eEG2Controller.get_active_row_number() != 0; |
bool hasController = eEG2Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
1026 |
eEG2ControllerInvert.set_sensitive(hasController); |
eEG2ControllerInvert.set_sensitive(hasController); |
1027 |
} |
} |
1028 |
|
|
1029 |
void DimRegionEdit::AttenuationController_changed() |
void DimRegionEdit::AttenuationController_changed() |
1030 |
{ |
{ |
1031 |
bool hasController = eAttenuationController.get_active_row_number() != 0; |
bool hasController = |
1032 |
|
eAttenuationController.get_value().type != gig::leverage_ctrl_t::type_none; |
1033 |
eInvertAttenuationController.set_sensitive(hasController); |
eInvertAttenuationController.set_sensitive(hasController); |
1034 |
eAttenuationControllerThreshold.set_sensitive(hasController); |
eAttenuationControllerThreshold.set_sensitive(hasController); |
1035 |
eCrossfade_in_start.set_sensitive(hasController); |
eCrossfade_in_start.set_sensitive(hasController); |
1036 |
eCrossfade_in_end.set_sensitive(hasController); |
eCrossfade_in_end.set_sensitive(hasController); |
1037 |
eCrossfade_out_start.set_sensitive(hasController); |
eCrossfade_out_start.set_sensitive(hasController); |
1038 |
eCrossfade_out_end.set_sensitive(hasController); |
eCrossfade_out_end.set_sensitive(hasController); |
1039 |
|
crossfade_curve.set_sensitive(hasController); |
1040 |
} |
} |
1041 |
|
|
1042 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
1043 |
{ |
{ |
1044 |
int rowno = eLFO1Controller.get_active_row_number(); |
gig::lfo1_ctrl_t ctrl = eLFO1Controller.get_value(); |
1045 |
eLFO1ControlDepth.set_sensitive(rowno != 0); |
eLFO1ControlDepth.set_sensitive(ctrl != gig::lfo1_ctrl_internal); |
1046 |
eLFO1InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO1InternalDepth.set_sensitive(ctrl != gig::lfo1_ctrl_modwheel && |
1047 |
|
ctrl != gig::lfo1_ctrl_breath); |
1048 |
} |
} |
1049 |
|
|
1050 |
void DimRegionEdit::LFO2Controller_changed() |
void DimRegionEdit::LFO2Controller_changed() |
1051 |
{ |
{ |
1052 |
int rowno = eLFO2Controller.get_active_row_number(); |
gig::lfo2_ctrl_t ctrl = eLFO2Controller.get_value(); |
1053 |
eLFO2ControlDepth.set_sensitive(rowno != 0); |
eLFO2ControlDepth.set_sensitive(ctrl != gig::lfo2_ctrl_internal); |
1054 |
eLFO2InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO2InternalDepth.set_sensitive(ctrl != gig::lfo2_ctrl_modwheel && |
1055 |
|
ctrl != gig::lfo2_ctrl_foot); |
1056 |
} |
} |
1057 |
|
|
1058 |
void DimRegionEdit::LFO3Controller_changed() |
void DimRegionEdit::LFO3Controller_changed() |
1059 |
{ |
{ |
1060 |
int rowno = eLFO3Controller.get_active_row_number(); |
gig::lfo3_ctrl_t ctrl = eLFO3Controller.get_value(); |
1061 |
eLFO3ControlDepth.set_sensitive(rowno != 0); |
eLFO3ControlDepth.set_sensitive(ctrl != gig::lfo3_ctrl_internal); |
1062 |
eLFO3InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO3InternalDepth.set_sensitive(ctrl != gig::lfo3_ctrl_modwheel && |
1063 |
|
ctrl != gig::lfo3_ctrl_aftertouch); |
1064 |
} |
} |
1065 |
|
|
1066 |
void DimRegionEdit::crossfade1_changed() |
void DimRegionEdit::crossfade1_changed() |
1067 |
{ |
{ |
1068 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
1069 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1070 |
if (c1 > c2) eCrossfade_in_end.set_value(c1); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1071 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1072 |
|
update_model--; |
1073 |
} |
} |
1074 |
|
|
1075 |
void DimRegionEdit::crossfade2_changed() |
void DimRegionEdit::crossfade2_changed() |
1076 |
{ |
{ |
1077 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
1078 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1079 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1080 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1081 |
if (c2 < c1) eCrossfade_in_start.set_value(c2); |
update_model--; |
|
if (c2 > c3) eCrossfade_out_start.set_value(c2); |
|
1082 |
} |
} |
1083 |
|
|
1084 |
void DimRegionEdit::crossfade3_changed() |
void DimRegionEdit::crossfade3_changed() |
1085 |
{ |
{ |
1086 |
double c2 = eCrossfade_in_end.get_value(); |
update_model++; |
1087 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1088 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1089 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1090 |
if (c3 < c2) eCrossfade_in_end.set_value(c3); |
update_model--; |
|
if (c3 > c4) eCrossfade_out_end.set_value(c3); |
|
1091 |
} |
} |
1092 |
|
|
1093 |
void DimRegionEdit::crossfade4_changed() |
void DimRegionEdit::crossfade4_changed() |
1094 |
{ |
{ |
1095 |
double c3 = eCrossfade_out_start.get_value(); |
update_model++; |
1096 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1097 |
|
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1098 |
if (c4 < c3) eCrossfade_out_start.set_value(c4); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1099 |
|
update_model--; |
1100 |
} |
} |
1101 |
|
|
1102 |
void DimRegionEdit::loop_enabled_toggled() |
void DimRegionEdit::update_loop_elements() |
1103 |
{ |
{ |
1104 |
const bool active = eSampleLoopEnabled.get_active(); |
update_model++; |
1105 |
if (active) { |
const bool active = eSampleLoopEnabled.get_value(); |
|
// 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(); |
|
|
} |
|
|
|
|
|
void DimRegionEdit::updateLoopElements() |
|
|
{ |
|
|
const bool active = eSampleLoopEnabled.get_active(); |
|
1106 |
eSampleLoopStart.set_sensitive(active); |
eSampleLoopStart.set_sensitive(active); |
1107 |
eSampleLoopLength.set_sensitive(active); |
eSampleLoopLength.set_sensitive(active); |
1108 |
eSampleLoopType.set_sensitive(active); |
eSampleLoopType.set_sensitive(active); |
1109 |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
1110 |
eSampleLoopStart.set_ptr(0); |
// sample loop shall never be longer than the actual sample size |
1111 |
eSampleLoopLength.set_ptr(0); |
loop_start_changed(); |
1112 |
eSampleLoopPlayCount.set_ptr(0); |
loop_length_changed(); |
1113 |
|
eSampleLoopStart.set_value( |
1114 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopStart : 0); |
1115 |
|
eSampleLoopLength.set_value( |
1116 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopLength : 0); |
1117 |
|
|
1118 |
|
eSampleLoopInfinite.set_value( |
1119 |
|
dimregion->pSample && dimregion->pSample->LoopPlayCount == 0); |
1120 |
|
|
1121 |
|
loop_infinite_toggled(); |
1122 |
|
update_model--; |
1123 |
|
} |
1124 |
|
|
1125 |
|
void DimRegionEdit::loop_start_changed() { |
1126 |
|
if (dimregion && dimregion->SampleLoops) { |
1127 |
|
eSampleLoopLength.set_upper(dimregion->pSample ? |
1128 |
|
dimregion->pSample->SamplesTotal - |
1129 |
|
dimregion->pSampleLoops[0].LoopStart : 0); |
1130 |
|
} |
1131 |
|
} |
1132 |
|
|
1133 |
|
void DimRegionEdit::loop_length_changed() { |
1134 |
if (dimregion && dimregion->SampleLoops) { |
if (dimregion && dimregion->SampleLoops) { |
1135 |
eSampleLoopStart.set_ptr(&dimregion->pSampleLoops[0].LoopStart); |
eSampleLoopStart.set_upper(dimregion->pSample ? |
1136 |
eSampleLoopLength.set_ptr(&dimregion->pSampleLoops[0].LoopLength); |
dimregion->pSample->SamplesTotal - |
1137 |
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(); |
|
1138 |
} |
} |
1139 |
} |
} |
1140 |
|
|
1141 |
void DimRegionEdit::loop_infinite_toggled() { |
void DimRegionEdit::loop_infinite_toggled() { |
1142 |
eSampleLoopPlayCount.set_sensitive( |
eSampleLoopPlayCount.set_sensitive( |
1143 |
dimregion && dimregion->pSample && |
dimregion && dimregion->pSample && |
1144 |
!eSampleLoopInfinite.get_active() && |
!eSampleLoopInfinite.get_value() && |
1145 |
eSampleLoopEnabled.get_active() |
eSampleLoopEnabled.get_value() |
1146 |
); |
); |
1147 |
if (eSampleLoopInfinite.get_active()) |
update_model++; |
1148 |
eSampleLoopPlayCount.set_value(0); |
eSampleLoopPlayCount.set_value( |
1149 |
else if (!eSampleLoopPlayCount.get_value()) |
dimregion->pSample ? dimregion->pSample->LoopPlayCount : 0); |
1150 |
eSampleLoopPlayCount.set_value(1); |
update_model--; |
1151 |
} |
} |
1152 |
|
|
1153 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
1158 |
// 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() |
1159 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//dimreg_to_be_changed_signal.emit(dimregion); |
1160 |
|
|
1161 |
|
// make sure stereo samples always are the same in both |
1162 |
|
// dimregs in the samplechannel dimension |
1163 |
|
int nbDimregs = 1; |
1164 |
|
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
1165 |
|
if (sample->Channels == 2) { |
1166 |
|
gig::Region* region = dimregion->GetParent(); |
1167 |
|
|
1168 |
|
int bitcount = 0; |
1169 |
|
int stereo_bit = 0; |
1170 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1171 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1172 |
|
stereo_bit = 1 << bitcount; |
1173 |
|
break; |
1174 |
|
} |
1175 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1176 |
|
} |
1177 |
|
|
1178 |
|
if (stereo_bit) { |
1179 |
|
int dimregno; |
1180 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1181 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
1182 |
|
break; |
1183 |
|
} |
1184 |
|
} |
1185 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1186 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1187 |
|
nbDimregs = 2; |
1188 |
|
} |
1189 |
|
} |
1190 |
|
|
1191 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimregion->pSample; |
|
dimregion->pSample = sample; |
|
1192 |
|
|
1193 |
// copy sample information from Sample to DimensionRegion |
for (int i = 0 ; i < nbDimregs ; i++) { |
1194 |
|
d[i]->pSample = sample; |
1195 |
|
|
1196 |
dimregion->UnityNote = sample->MIDIUnityNote; |
// copy sample information from Sample to DimensionRegion |
|
dimregion->FineTune = sample->FineTune; |
|
1197 |
|
|
1198 |
int loops = sample->Loops ? 1 : 0; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1199 |
while (dimregion->SampleLoops > loops) { |
d[i]->FineTune = sample->FineTune; |
1200 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
|
1201 |
} |
int loops = sample->Loops ? 1 : 0; |
1202 |
while (dimregion->SampleLoops < sample->Loops) { |
while (d[i]->SampleLoops > loops) { |
1203 |
DLS::sample_loop_t loop; |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1204 |
dimregion->AddSampleLoop(&loop); |
} |
1205 |
} |
while (d[i]->SampleLoops < sample->Loops) { |
1206 |
if (loops) { |
DLS::sample_loop_t loop; |
1207 |
dimregion->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
d[i]->AddSampleLoop(&loop); |
1208 |
dimregion->pSampleLoops[0].LoopType = sample->LoopType; |
} |
1209 |
dimregion->pSampleLoops[0].LoopStart = sample->LoopStart; |
if (loops) { |
1210 |
dimregion->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1211 |
|
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1212 |
|
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1213 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1214 |
|
} |
1215 |
} |
} |
1216 |
|
|
1217 |
// update ui |
// update ui |
1218 |
|
update_model++; |
1219 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(dimregion->pSample->pInfo->Name); |
1220 |
eUnityNote.set_ptr(&dimregion->UnityNote); |
eUnityNote.set_value(dimregion->UnityNote); |
1221 |
eFineTune.set_ptr(&dimregion->FineTune); |
eFineTune.set_value(dimregion->FineTune); |
1222 |
eSampleLoopEnabled.set_active(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
1223 |
updateLoopElements(); |
update_loop_elements(); |
1224 |
|
update_model--; |
1225 |
|
|
1226 |
sample_ref_changed_signal.emit(oldref, sample); |
sample_ref_changed_signal.emit(oldref, sample); |
1227 |
// 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() |
1231 |
return false; |
return false; |
1232 |
} |
} |
1233 |
|
|
1234 |
sigc::signal<void, gig::DimensionRegion*> DimRegionEdit::signal_dimreg_to_be_changed() { |
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_to_be_changed() { |
1235 |
return dimreg_to_be_changed_signal; |
return dimreg_to_be_changed_signal; |
1236 |
} |
} |
1237 |
|
|
1238 |
sigc::signal<void, gig::DimensionRegion*> DimRegionEdit::signal_dimreg_changed() { |
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_changed() { |
1239 |
return dimreg_changed_signal; |
return dimreg_changed_signal; |
1240 |
} |
} |
1241 |
|
|
1242 |
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() { |
1243 |
return sample_ref_changed_signal; |
return sample_ref_changed_signal; |
1244 |
} |
} |
1245 |
|
|
1246 |
|
|
1247 |
|
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
1248 |
|
{ |
1249 |
|
d->UnityNote = value; |
1250 |
|
} |
1251 |
|
|
1252 |
|
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
1253 |
|
{ |
1254 |
|
d->FineTune = value; |
1255 |
|
} |
1256 |
|
|
1257 |
|
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
1258 |
|
uint8_t value) |
1259 |
|
{ |
1260 |
|
d->Crossfade.in_start = value; |
1261 |
|
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1262 |
|
} |
1263 |
|
|
1264 |
|
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
1265 |
|
uint8_t value) |
1266 |
|
{ |
1267 |
|
d->Crossfade.in_end = value; |
1268 |
|
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
1269 |
|
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1270 |
|
} |
1271 |
|
|
1272 |
|
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
1273 |
|
uint8_t value) |
1274 |
|
{ |
1275 |
|
d->Crossfade.out_start = value; |
1276 |
|
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
1277 |
|
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
1278 |
|
} |
1279 |
|
|
1280 |
|
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
1281 |
|
uint8_t value) |
1282 |
|
{ |
1283 |
|
d->Crossfade.out_end = value; |
1284 |
|
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1285 |
|
} |
1286 |
|
|
1287 |
|
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
1288 |
|
{ |
1289 |
|
d->SetGain(value); |
1290 |
|
} |
1291 |
|
|
1292 |
|
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
1293 |
|
{ |
1294 |
|
if (value) { |
1295 |
|
// create a new sample loop in case there is none yet |
1296 |
|
if (!d->SampleLoops) { |
1297 |
|
DLS::sample_loop_t loop; |
1298 |
|
loop.LoopType = gig::loop_type_normal; |
1299 |
|
// loop the whole sample by default |
1300 |
|
loop.LoopStart = 0; |
1301 |
|
loop.LoopLength = |
1302 |
|
(d->pSample) ? d->pSample->SamplesTotal : 0; |
1303 |
|
dimreg_to_be_changed_signal.emit(d); |
1304 |
|
d->AddSampleLoop(&loop); |
1305 |
|
dimreg_changed_signal.emit(d); |
1306 |
|
} |
1307 |
|
} else { |
1308 |
|
if (d->SampleLoops) { |
1309 |
|
dimreg_to_be_changed_signal.emit(d); |
1310 |
|
// delete ALL existing sample loops |
1311 |
|
while (d->SampleLoops) { |
1312 |
|
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1313 |
|
} |
1314 |
|
dimreg_changed_signal.emit(d); |
1315 |
|
} |
1316 |
|
} |
1317 |
|
} |
1318 |
|
|
1319 |
|
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
1320 |
|
{ |
1321 |
|
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
1322 |
|
} |
1323 |
|
|
1324 |
|
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
1325 |
|
{ |
1326 |
|
if (d->SampleLoops) { |
1327 |
|
d->pSampleLoops[0].LoopStart = |
1328 |
|
d->pSample ? |
1329 |
|
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1330 |
|
d->pSampleLoops[0].LoopLength)) : |
1331 |
|
0; |
1332 |
|
} |
1333 |
|
} |
1334 |
|
|
1335 |
|
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
1336 |
|
{ |
1337 |
|
if (d->SampleLoops) { |
1338 |
|
d->pSampleLoops[0].LoopLength = |
1339 |
|
d->pSample ? |
1340 |
|
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1341 |
|
d->pSampleLoops[0].LoopStart)) : |
1342 |
|
0; |
1343 |
|
} |
1344 |
|
} |
1345 |
|
|
1346 |
|
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
1347 |
|
{ |
1348 |
|
if (d->pSample) { |
1349 |
|
if (value) d->pSample->LoopPlayCount = 0; |
1350 |
|
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
1351 |
|
} |
1352 |
|
} |
1353 |
|
|
1354 |
|
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
1355 |
|
{ |
1356 |
|
if (d->pSample) d->pSample->LoopPlayCount = value; |
1357 |
|
} |