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, 0.2); |
59 |
|
cr->fill(); |
60 |
|
} else { |
61 |
|
cr->set_line_width(3); |
62 |
|
cr->set_source_rgb(0.5, 0.44, 1.0); |
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 && dimreg->Crossfade.out_end) { |
86 |
|
int w = get_width(); |
87 |
|
int h = get_height(); |
88 |
|
|
89 |
|
cr->translate(1.5, 0); |
90 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
91 |
|
cr->move_to(dimreg->Crossfade.in_start / 127.0 * (w - 3), h); |
92 |
|
cr->line_to(dimreg->Crossfade.in_end / 127.0 * (w - 3), 1.5); |
93 |
|
cr->line_to(dimreg->Crossfade.out_start / 127.0 * (w - 3), 1.5); |
94 |
|
cr->line_to(dimreg->Crossfade.out_end / 127.0 * (w - 3), h); |
95 |
|
|
96 |
|
if (pass == 0) { |
97 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, 0.2); |
98 |
|
cr->fill(); |
99 |
|
} else { |
100 |
|
cr->set_line_width(3); |
101 |
|
cr->set_source_rgb(0.5, 0.44, 1.0); |
102 |
|
cr->stroke(); |
103 |
|
} |
104 |
|
} |
105 |
|
} |
106 |
|
return true; |
107 |
|
} |
108 |
|
|
109 |
|
|
110 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
111 |
eEG1PreAttack("Pre-attack", 0, 100, 2), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
112 |
eEG1Attack("Attack", 0, 60, 3), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
113 |
eEG1Decay1("Decay 1", 0.005, 60, 3), |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
114 |
eEG1Decay2("Decay 2", 0, 60, 3), |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
115 |
eEG1InfiniteSustain("Infinite sustain"), |
eEG1Attack(_("Attack"), 0, 60, 3), |
116 |
eEG1Sustain("Sustain", 0, 100, 2), |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
117 |
eEG1Release("Release", 0, 60, 3), |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
118 |
eEG1Hold("Hold"), |
eEG1InfiniteSustain(_("Infinite sustain")), |
119 |
eEG1Controller("Controller"), |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
120 |
eEG1ControllerInvert("Controller invert"), |
eEG1Release(_("Release"), 0, 60, 3), |
121 |
eEG1ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG1Hold(_("Hold")), |
122 |
eEG1ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG1Controller(_("Controller")), |
123 |
eEG1ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG1ControllerInvert(_("Controller invert")), |
124 |
eLFO1Frequency("Frequency", 0.1, 10, 2), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
125 |
eLFO1InternalDepth("Internal depth", 0, 1200), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
126 |
eLFO1ControlDepth("Control depth", 0, 1200), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
127 |
eLFO1Controller("Controller"), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
128 |
eLFO1FlipPhase("Flip phase"), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
129 |
eLFO1Sync("Sync"), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
130 |
eEG2PreAttack("Pre-attack", 0, 100, 2), |
eLFO1Controller(_("Controller")), |
131 |
eEG2Attack("Attack", 0, 60, 3), |
eLFO1FlipPhase(_("Flip phase")), |
132 |
eEG2Decay1("Decay 1", 0.005, 60, 3), |
eLFO1Sync(_("Sync")), |
133 |
eEG2Decay2("Decay 2", 0, 60, 3), |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
134 |
eEG2InfiniteSustain("Infinite sustain"), |
eEG2Attack(_("Attack"), 0, 60, 3), |
135 |
eEG2Sustain("Sustain", 0, 100, 2), |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
136 |
eEG2Release("Release", 0, 60, 3), |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
137 |
eEG2Controller("Controller"), |
eEG2InfiniteSustain(_("Infinite sustain")), |
138 |
eEG2ControllerInvert("Controller invert"), |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
139 |
eEG2ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG2Release(_("Release"), 0, 60, 3), |
140 |
eEG2ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG2Controller(_("Controller")), |
141 |
eEG2ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG2ControllerInvert(_("Controller invert")), |
142 |
eLFO2Frequency("Frequency", 0.1, 10, 2), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
143 |
eLFO2InternalDepth("Internal depth", 0, 1200), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
144 |
eLFO2ControlDepth("Control depth", 0, 1200), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
145 |
eLFO2Controller("Controller"), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
146 |
eLFO2FlipPhase("Flip phase"), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
147 |
eLFO2Sync("Sync"), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
148 |
eEG3Attack("Attack", 0, 10, 3), |
eLFO2Controller(_("Controller")), |
149 |
eEG3Depth("Depth", -1200, 1200), |
eLFO2FlipPhase(_("Flip phase")), |
150 |
eLFO3Frequency("Frequency", 0.1, 10, 2), |
eLFO2Sync(_("Sync")), |
151 |
eLFO3InternalDepth("Internal depth", 0, 1200), |
eEG3Attack(_("Attack"), 0, 10, 3), |
152 |
eLFO3ControlDepth("Control depth", 0, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
153 |
eLFO3Controller("Controller"), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
154 |
eLFO3Sync("Sync"), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
155 |
eVCFEnabled("Enabled"), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
156 |
eVCFType("Type"), |
eLFO3Controller(_("Controller")), |
157 |
eVCFCutoffController("Cutoff controller"), |
eLFO3Sync(_("Sync")), |
158 |
eVCFCutoffControllerInvert("Cutoff controller invert"), |
eVCFEnabled(_("Enabled")), |
159 |
eVCFCutoff("Cutoff"), |
eVCFType(_("Type")), |
160 |
eVCFVelocityCurve("Velocity curve"), |
eVCFCutoffController(_("Cutoff controller")), |
161 |
eVCFVelocityScale("Velocity scale"), |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
162 |
eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4), |
eVCFCutoff(_("Cutoff")), |
163 |
eVCFResonance("Resonance"), |
eVCFVelocityCurve(_("Velocity curve")), |
164 |
eVCFResonanceDynamic("Resonance dynamic"), |
eVCFVelocityScale(_("Velocity scale")), |
165 |
eVCFResonanceController("Resonance controller"), |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
166 |
eVCFKeyboardTracking("Keyboard tracking"), |
eVCFResonance(_("Resonance")), |
167 |
eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"), |
eVCFResonanceDynamic(_("Resonance dynamic")), |
168 |
eVelocityResponseCurve("Velocity response curve"), |
eVCFResonanceController(_("Resonance controller")), |
169 |
eVelocityResponseDepth("Velocity response depth", 0, 4), |
eVCFKeyboardTracking(_("Keyboard tracking")), |
170 |
eVelocityResponseCurveScaling("Velocity response curve scaling"), |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
171 |
eReleaseVelocityResponseCurve("Release velocity response curve"), |
eVelocityResponseCurve(_("Velocity response curve")), |
172 |
eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4), |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
173 |
eReleaseTriggerDecay("Release trigger decay", 0, 8), |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
174 |
eCrossfade_in_start("Crossfade-in start"), |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
175 |
eCrossfade_in_end("Crossfade-in end"), |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
176 |
eCrossfade_out_start("Crossfade-out start"), |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
177 |
eCrossfade_out_end("Crossfade-out end"), |
eCrossfade_in_start(_("Crossfade-in start")), |
178 |
ePitchTrack("Pitch track"), |
eCrossfade_in_end(_("Crossfade-in end")), |
179 |
eDimensionBypass("Dimension bypass"), |
eCrossfade_out_start(_("Crossfade-out start")), |
180 |
ePan("Pan", -64, 63), |
eCrossfade_out_end(_("Crossfade-out end")), |
181 |
eSelfMask("Self mask"), |
ePitchTrack(_("Pitch track")), |
182 |
eAttenuationController("Attenuation controller"), |
eDimensionBypass(_("Dimension bypass")), |
183 |
eInvertAttenuationController("Invert attenuation controller"), |
ePan(_("Pan"), -64, 63), |
184 |
eAttenuationControllerThreshold("Attenuation controller threshold"), |
eSelfMask(_("Self mask")), |
185 |
eChannelOffset("Channel offset", 0, 9), |
eAttenuationController(_("Attenuation controller")), |
186 |
eSustainDefeat("Sustain defeat"), |
eInvertAttenuationController(_("Invert attenuation controller")), |
187 |
eMSDecode("MS decode"), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
188 |
eSampleStartOffset("Sample start offset", 0, 2000), |
eChannelOffset(_("Channel offset"), 0, 9), |
189 |
eUnityNote("Unity note"), |
eSustainDefeat(_("Sustain defeat")), |
190 |
eFineTune("Fine tune", -49, 50), |
eMSDecode(_("MS decode")), |
191 |
eGain("Gain", -96, 0, 2, -655360), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
192 |
eGainPlus6("Gain +6dB", eGain, 6 * -655360), |
eUnityNote(_("Unity note")), |
193 |
eSampleLoopEnabled("Enabled"), |
eFineTune(_("Fine tune"), -49, 50), |
194 |
eSampleLoopStart("Loop start positon"), |
eGain(_("Gain"), -96, 0, 2, -655360), |
195 |
eSampleLoopLength("Loop size"), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
196 |
eSampleLoopType("Loop type"), |
eSampleLoopEnabled(_("Enabled")), |
197 |
eSampleLoopInfinite("Infinite loop"), |
eSampleLoopStart(_("Loop start positon")), |
198 |
eSampleLoopPlayCount("Playback count") |
eSampleLoopLength(_("Loop size")), |
199 |
{ |
eSampleLoopType(_("Loop type")), |
200 |
|
eSampleLoopInfinite(_("Infinite loop")), |
201 |
|
eSampleLoopPlayCount(_("Playback count"), 1), |
202 |
|
update_model(0) |
203 |
|
{ |
204 |
|
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
205 |
|
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
206 |
|
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
207 |
|
connect(eEG1Decay2, &gig::DimensionRegion::EG1Decay2); |
208 |
|
connect(eEG1InfiniteSustain, &gig::DimensionRegion::EG1InfiniteSustain); |
209 |
|
connect(eEG1Sustain, &gig::DimensionRegion::EG1Sustain); |
210 |
|
connect(eEG1Release, &gig::DimensionRegion::EG1Release); |
211 |
|
connect(eEG1Hold, &gig::DimensionRegion::EG1Hold); |
212 |
|
connect(eEG1Controller, &gig::DimensionRegion::EG1Controller); |
213 |
|
connect(eEG1ControllerInvert, &gig::DimensionRegion::EG1ControllerInvert); |
214 |
|
connect(eEG1ControllerAttackInfluence, |
215 |
|
&gig::DimensionRegion::EG1ControllerAttackInfluence); |
216 |
|
connect(eEG1ControllerDecayInfluence, |
217 |
|
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
218 |
|
connect(eEG1ControllerReleaseInfluence, |
219 |
|
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
220 |
|
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
221 |
|
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
222 |
|
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
223 |
|
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
224 |
|
connect(eLFO1FlipPhase, &gig::DimensionRegion::LFO1FlipPhase); |
225 |
|
connect(eLFO1Sync, &gig::DimensionRegion::LFO1Sync); |
226 |
|
connect(eEG2PreAttack, &gig::DimensionRegion::EG2PreAttack); |
227 |
|
connect(eEG2Attack, &gig::DimensionRegion::EG2Attack); |
228 |
|
connect(eEG2Decay1, &gig::DimensionRegion::EG2Decay1); |
229 |
|
connect(eEG2Decay2, &gig::DimensionRegion::EG2Decay2); |
230 |
|
connect(eEG2InfiniteSustain, &gig::DimensionRegion::EG2InfiniteSustain); |
231 |
|
connect(eEG2Sustain, &gig::DimensionRegion::EG2Sustain); |
232 |
|
connect(eEG2Release, &gig::DimensionRegion::EG2Release); |
233 |
|
connect(eEG2Controller, &gig::DimensionRegion::EG2Controller); |
234 |
|
connect(eEG2ControllerInvert, &gig::DimensionRegion::EG2ControllerInvert); |
235 |
|
connect(eEG2ControllerAttackInfluence, |
236 |
|
&gig::DimensionRegion::EG2ControllerAttackInfluence); |
237 |
|
connect(eEG2ControllerDecayInfluence, |
238 |
|
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
239 |
|
connect(eEG2ControllerReleaseInfluence, |
240 |
|
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
241 |
|
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
242 |
|
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
243 |
|
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
244 |
|
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
245 |
|
connect(eLFO2FlipPhase, &gig::DimensionRegion::LFO2FlipPhase); |
246 |
|
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
247 |
|
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
248 |
|
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
249 |
|
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
250 |
|
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
251 |
|
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
252 |
|
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
253 |
|
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
254 |
|
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
255 |
|
connect(eVCFType, &gig::DimensionRegion::VCFType); |
256 |
|
connect(eVCFCutoffController, |
257 |
|
&gig::DimensionRegion::SetVCFCutoffController); |
258 |
|
connect(eVCFCutoffControllerInvert, |
259 |
|
&gig::DimensionRegion::VCFCutoffControllerInvert); |
260 |
|
connect(eVCFCutoff, &gig::DimensionRegion::VCFCutoff); |
261 |
|
connect(eVCFVelocityCurve, &gig::DimensionRegion::SetVCFVelocityCurve); |
262 |
|
connect(eVCFVelocityScale, &gig::DimensionRegion::SetVCFVelocityScale); |
263 |
|
connect(eVCFVelocityDynamicRange, |
264 |
|
&gig::DimensionRegion::SetVCFVelocityDynamicRange); |
265 |
|
connect(eVCFResonance, &gig::DimensionRegion::VCFResonance); |
266 |
|
connect(eVCFResonanceDynamic, &gig::DimensionRegion::VCFResonanceDynamic); |
267 |
|
connect(eVCFResonanceController, |
268 |
|
&gig::DimensionRegion::VCFResonanceController); |
269 |
|
connect(eVCFKeyboardTracking, &gig::DimensionRegion::VCFKeyboardTracking); |
270 |
|
connect(eVCFKeyboardTrackingBreakpoint, |
271 |
|
&gig::DimensionRegion::VCFKeyboardTrackingBreakpoint); |
272 |
|
connect(eVelocityResponseCurve, |
273 |
|
&gig::DimensionRegion::SetVelocityResponseCurve); |
274 |
|
connect(eVelocityResponseDepth, |
275 |
|
&gig::DimensionRegion::SetVelocityResponseDepth); |
276 |
|
connect(eVelocityResponseCurveScaling, |
277 |
|
&gig::DimensionRegion::SetVelocityResponseCurveScaling); |
278 |
|
connect(eReleaseVelocityResponseCurve, |
279 |
|
&gig::DimensionRegion::SetReleaseVelocityResponseCurve); |
280 |
|
connect(eReleaseVelocityResponseDepth, |
281 |
|
&gig::DimensionRegion::SetReleaseVelocityResponseDepth); |
282 |
|
connect(eReleaseTriggerDecay, &gig::DimensionRegion::ReleaseTriggerDecay); |
283 |
|
connect(eCrossfade_in_start, &DimRegionEdit::set_Crossfade_in_start); |
284 |
|
connect(eCrossfade_in_end, &DimRegionEdit::set_Crossfade_in_end); |
285 |
|
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
286 |
|
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
287 |
|
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
288 |
|
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
289 |
|
connect(ePan, &gig::DimensionRegion::Pan); |
290 |
|
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
291 |
|
connect(eAttenuationController, |
292 |
|
&gig::DimensionRegion::AttenuationController); |
293 |
|
connect(eInvertAttenuationController, |
294 |
|
&gig::DimensionRegion::InvertAttenuationController); |
295 |
|
connect(eAttenuationControllerThreshold, |
296 |
|
&gig::DimensionRegion::AttenuationControllerThreshold); |
297 |
|
connect(eChannelOffset, &gig::DimensionRegion::ChannelOffset); |
298 |
|
connect(eSustainDefeat, &gig::DimensionRegion::SustainDefeat); |
299 |
|
connect(eMSDecode, &gig::DimensionRegion::MSDecode); |
300 |
|
connect(eSampleStartOffset, &gig::DimensionRegion::SampleStartOffset); |
301 |
|
connect(eUnityNote, &DimRegionEdit::set_UnityNote); |
302 |
|
connect(eFineTune, &DimRegionEdit::set_FineTune); |
303 |
|
connect(eGain, &DimRegionEdit::set_Gain); |
304 |
|
connect(eGainPlus6, &DimRegionEdit::set_Gain); |
305 |
|
connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled); |
306 |
|
connect(eSampleLoopType, &DimRegionEdit::set_LoopType); |
307 |
|
connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart); |
308 |
|
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
309 |
|
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
310 |
|
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
311 |
|
|
312 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
313 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
314 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
354 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
355 |
|
|
356 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
357 |
addString("Sample", lSample, wSample); |
addString(_("Sample"), lSample, wSample); |
358 |
//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); |
359 |
|
#ifdef OLD_TOOLTIPS |
360 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
361 |
|
#else |
362 |
|
wSample->set_tooltip_text(_("Drop a sample here")); |
363 |
|
#endif |
364 |
addProp(eUnityNote); |
addProp(eUnityNote); |
365 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
366 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
367 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
368 |
addHeader("Loops"); |
addHeader(_("Loops")); |
369 |
addProp(eSampleLoopEnabled); |
addProp(eSampleLoopEnabled); |
370 |
addProp(eSampleLoopStart); |
addProp(eSampleLoopStart); |
371 |
addProp(eSampleLoopLength); |
addProp(eSampleLoopLength); |
372 |
{ |
{ |
373 |
const char* choices[] = { "normal", "bidirectional", "backward", 0 }; |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
374 |
static const uint32_t values[] = { |
static const uint32_t values[] = { |
375 |
gig::loop_type_normal, |
gig::loop_type_normal, |
376 |
gig::loop_type_bidirectional, |
gig::loop_type_bidirectional, |
410 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
411 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
412 |
{ |
{ |
413 |
const char* choices[] = { "internal", "modwheel", "breath", |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
414 |
"internal+modwheel", "internal+breath", 0 }; |
_("internal+modwheel"), _("internal+breath"), 0 }; |
415 |
static const gig::lfo1_ctrl_t values[] = { |
static const gig::lfo1_ctrl_t values[] = { |
416 |
gig::lfo1_ctrl_internal, |
gig::lfo1_ctrl_internal, |
417 |
gig::lfo1_ctrl_modwheel, |
gig::lfo1_ctrl_modwheel, |
424 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
425 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
426 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
427 |
addHeader("Crossfade"); |
addHeader(_("Crossfade")); |
428 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
429 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
430 |
addProp(eAttenuationControllerThreshold); |
addProp(eAttenuationControllerThreshold); |
433 |
addProp(eCrossfade_out_start); |
addProp(eCrossfade_out_start); |
434 |
addProp(eCrossfade_out_end); |
addProp(eCrossfade_out_end); |
435 |
|
|
436 |
|
Gtk::Frame* frame = new Gtk::Frame; |
437 |
|
frame->add(crossfade_curve); |
438 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
439 |
|
Gtk::SHRINK, Gtk::SHRINK); |
440 |
|
rowno++; |
441 |
|
|
442 |
|
eCrossfade_in_start.signal_value_changed().connect( |
443 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
444 |
|
eCrossfade_in_end.signal_value_changed().connect( |
445 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
446 |
|
eCrossfade_out_start.signal_value_changed().connect( |
447 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
448 |
|
eCrossfade_out_end.signal_value_changed().connect( |
449 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
450 |
|
|
451 |
nextPage(); |
nextPage(); |
452 |
|
|
453 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
454 |
addProp(eVCFEnabled); |
addProp(eVCFEnabled); |
455 |
{ |
{ |
456 |
const char* choices[] = { "lowpass", "lowpassturbo", "bandpass", |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
457 |
"highpass", "bandreject", 0 }; |
_("highpass"), _("bandreject"), 0 }; |
458 |
static const gig::vcf_type_t values[] = { |
static const gig::vcf_type_t values[] = { |
459 |
gig::vcf_type_lowpass, |
gig::vcf_type_lowpass, |
460 |
gig::vcf_type_lowpassturbo, |
gig::vcf_type_lowpassturbo, |
466 |
} |
} |
467 |
addProp(eVCFType); |
addProp(eVCFType); |
468 |
{ |
{ |
469 |
const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2", |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
470 |
"breath", "foot", "sustainpedal", "softpedal", |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
471 |
"genpurpose7", "genpurpose8", "aftertouch", 0 }; |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
472 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
static const gig::vcf_cutoff_ctrl_t values[] = { |
473 |
gig::vcf_cutoff_ctrl_none, |
gig::vcf_cutoff_ctrl_none, |
474 |
gig::vcf_cutoff_ctrl_none2, |
gig::vcf_cutoff_ctrl_none2, |
488 |
addProp(eVCFCutoffController); |
addProp(eVCFCutoffController); |
489 |
addProp(eVCFCutoffControllerInvert); |
addProp(eVCFCutoffControllerInvert); |
490 |
addProp(eVCFCutoff); |
addProp(eVCFCutoff); |
491 |
const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 }; |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
492 |
static const gig::curve_type_t curve_type_values[] = { |
static const gig::curve_type_t curve_type_values[] = { |
493 |
gig::curve_type_nonlinear, |
gig::curve_type_nonlinear, |
494 |
gig::curve_type_linear, |
gig::curve_type_linear, |
498 |
addProp(eVCFVelocityCurve); |
addProp(eVCFVelocityCurve); |
499 |
addProp(eVCFVelocityScale); |
addProp(eVCFVelocityScale); |
500 |
addProp(eVCFVelocityDynamicRange); |
addProp(eVCFVelocityDynamicRange); |
501 |
|
|
502 |
|
eVCFCutoffController.signal_value_changed().connect( |
503 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
504 |
|
eVCFVelocityCurve.signal_value_changed().connect( |
505 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
506 |
|
eVCFVelocityScale.signal_value_changed().connect( |
507 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
508 |
|
eVCFVelocityDynamicRange.signal_value_changed().connect( |
509 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
510 |
|
|
511 |
|
frame = new Gtk::Frame; |
512 |
|
frame->add(cutoff_curve); |
513 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
514 |
|
Gtk::SHRINK, Gtk::SHRINK); |
515 |
|
rowno++; |
516 |
|
|
517 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
518 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
519 |
{ |
{ |
520 |
const char* choices[] = { "none", "genpurpose3", "genpurpose4", |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
521 |
"genpurpose5", "genpurpose6", 0 }; |
_("genpurpose5"), _("genpurpose6"), 0 }; |
522 |
static const gig::vcf_res_ctrl_t values[] = { |
static const gig::vcf_res_ctrl_t values[] = { |
523 |
gig::vcf_res_ctrl_none, |
gig::vcf_res_ctrl_none, |
524 |
gig::vcf_res_ctrl_genpurpose3, |
gig::vcf_res_ctrl_genpurpose3, |
534 |
|
|
535 |
nextPage(); |
nextPage(); |
536 |
|
|
537 |
addHeader(_("Filter Cutoff Envelope (EG2)")); |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
538 |
addProp(eEG2PreAttack); |
addProp(eEG2PreAttack); |
539 |
addProp(eEG2Attack); |
addProp(eEG2Attack); |
540 |
addProp(eEG2Decay1); |
addProp(eEG2Decay1); |
547 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
548 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
549 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
550 |
addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
551 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
552 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
553 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
554 |
{ |
{ |
555 |
const char* choices[] = { "internal", "modwheel", "foot", |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
556 |
"internal+modwheel", "internal+foot", 0 }; |
_("internal+modwheel"), _("internal+foot"), 0 }; |
557 |
static const gig::lfo2_ctrl_t values[] = { |
static const gig::lfo2_ctrl_t values[] = { |
558 |
gig::lfo2_ctrl_internal, |
gig::lfo2_ctrl_internal, |
559 |
gig::lfo2_ctrl_modwheel, |
gig::lfo2_ctrl_modwheel, |
580 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
581 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
582 |
{ |
{ |
583 |
const char* choices[] = { "internal", "modwheel", "aftertouch", |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
584 |
"internal+modwheel", "internal+aftertouch", 0 }; |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
585 |
static const gig::lfo3_ctrl_t values[] = { |
static const gig::lfo3_ctrl_t values[] = { |
586 |
gig::lfo3_ctrl_internal, |
gig::lfo3_ctrl_internal, |
587 |
gig::lfo3_ctrl_modwheel, |
gig::lfo3_ctrl_modwheel, |
596 |
|
|
597 |
nextPage(); |
nextPage(); |
598 |
|
|
599 |
|
addHeader(_("Velocity Reponse")); |
600 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
601 |
addProp(eVelocityResponseCurve); |
addProp(eVelocityResponseCurve); |
602 |
addProp(eVelocityResponseDepth); |
addProp(eVelocityResponseDepth); |
603 |
addProp(eVelocityResponseCurveScaling); |
addProp(eVelocityResponseCurveScaling); |
604 |
|
|
605 |
|
eVelocityResponseCurve.signal_value_changed().connect( |
606 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
607 |
|
eVelocityResponseDepth.signal_value_changed().connect( |
608 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
609 |
|
eVelocityResponseCurveScaling.signal_value_changed().connect( |
610 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
611 |
|
|
612 |
|
frame = new Gtk::Frame; |
613 |
|
frame->add(velocity_curve); |
614 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
615 |
|
Gtk::SHRINK, Gtk::SHRINK); |
616 |
|
rowno++; |
617 |
|
|
618 |
|
addHeader(_("Release Velocity Reponse")); |
619 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
620 |
curve_type_values); |
curve_type_values); |
621 |
addProp(eReleaseVelocityResponseCurve); |
addProp(eReleaseVelocityResponseCurve); |
622 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
623 |
|
|
624 |
|
eReleaseVelocityResponseCurve.signal_value_changed().connect( |
625 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
626 |
|
eReleaseVelocityResponseDepth.signal_value_changed().connect( |
627 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
628 |
|
frame = new Gtk::Frame; |
629 |
|
frame->add(release_curve); |
630 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
631 |
|
Gtk::SHRINK, Gtk::SHRINK); |
632 |
|
rowno++; |
633 |
|
|
634 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
635 |
{ |
{ |
636 |
const char* choices[] = { "none", "effect4depth", "effect5depth", 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
637 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
638 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
639 |
gig::dim_bypass_ctrl_94, |
gig::dim_bypass_ctrl_94, |
649 |
nextPage(); |
nextPage(); |
650 |
|
|
651 |
|
|
652 |
eEG1InfiniteSustain.signal_toggled().connect( |
eEG1InfiniteSustain.signal_value_changed().connect( |
653 |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled)); |
654 |
eEG2InfiniteSustain.signal_toggled().connect( |
eEG2InfiniteSustain.signal_value_changed().connect( |
655 |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled)); |
656 |
eEG1Controller.signal_changed().connect( |
eEG1Controller.signal_value_changed().connect( |
657 |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed)); |
658 |
eEG2Controller.signal_changed().connect( |
eEG2Controller.signal_value_changed().connect( |
659 |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed)); |
660 |
eLFO1Controller.signal_changed().connect( |
eLFO1Controller.signal_value_changed().connect( |
661 |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed)); |
662 |
eLFO2Controller.signal_changed().connect( |
eLFO2Controller.signal_value_changed().connect( |
663 |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed)); |
664 |
eLFO3Controller.signal_changed().connect( |
eLFO3Controller.signal_value_changed().connect( |
665 |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed)); |
666 |
eAttenuationController.signal_changed().connect( |
eAttenuationController.signal_value_changed().connect( |
667 |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed)); |
668 |
eVCFEnabled.signal_toggled().connect( |
eVCFEnabled.signal_value_changed().connect( |
669 |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled)); |
670 |
eVCFCutoffController.signal_changed().connect( |
eVCFCutoffController.signal_value_changed().connect( |
671 |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed)); |
672 |
eVCFResonanceController.signal_changed().connect( |
eVCFResonanceController.signal_value_changed().connect( |
673 |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed) ); |
sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed)); |
674 |
|
|
675 |
eCrossfade_in_start.signal_changed_by_user().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
676 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed)); |
677 |
eCrossfade_in_end.signal_changed_by_user().connect( |
eCrossfade_in_end.signal_value_changed().connect( |
678 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed)); |
679 |
eCrossfade_out_start.signal_changed_by_user().connect( |
eCrossfade_out_start.signal_value_changed().connect( |
680 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed)); |
681 |
eCrossfade_out_end.signal_changed_by_user().connect( |
eCrossfade_out_end.signal_value_changed().connect( |
682 |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed)); |
683 |
|
|
684 |
eSampleLoopEnabled.signal_toggled().connect( |
eSampleLoopEnabled.signal_value_changed().connect( |
685 |
sigc::mem_fun(*this, &DimRegionEdit::loop_enabled_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements)); |
686 |
eSampleLoopStart.signal_changed_by_user().connect( |
eSampleLoopStart.signal_value_changed().connect( |
687 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed)); |
688 |
eSampleLoopLength.signal_changed_by_user().connect( |
eSampleLoopLength.signal_value_changed().connect( |
689 |
sigc::mem_fun(*this, &DimRegionEdit::updateLoopElements)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed)); |
690 |
eSampleLoopInfinite.signal_toggled().connect( |
eSampleLoopInfinite.signal_value_changed().connect( |
691 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
692 |
|
|
693 |
append_page(*table[0], "Sample"); |
append_page(*table[0], _("Sample")); |
694 |
append_page(*table[1], "Amplitude (1)"); |
append_page(*table[1], _("Amplitude (1)")); |
695 |
append_page(*table[2], "Amplitude (2)"); |
append_page(*table[2], _("Amplitude (2)")); |
696 |
append_page(*table[3], "Filter (1)"); |
append_page(*table[3], _("Filter (1)")); |
697 |
append_page(*table[4], "Filter (2)"); |
append_page(*table[4], _("Filter (2)")); |
698 |
append_page(*table[5], "Pitch"); |
append_page(*table[5], _("Pitch")); |
699 |
append_page(*table[6], "Misc"); |
append_page(*table[6], _("Misc")); |
700 |
} |
} |
701 |
|
|
702 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
707 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
708 |
{ |
{ |
709 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
710 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
711 |
|
|
712 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
713 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
720 |
rowno++; |
rowno++; |
721 |
} |
} |
722 |
|
|
723 |
void DimRegionEdit::addHeader(const char* text) |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
724 |
{ |
{ |
725 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
726 |
{ |
{ |
733 |
str += "</b>"; |
str += "</b>"; |
734 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
735 |
label->set_use_markup(); |
label->set_use_markup(); |
736 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
737 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
738 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
739 |
rowno++; |
rowno++; |
740 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
741 |
|
return label; |
742 |
} |
} |
743 |
|
|
744 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
759 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
760 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
761 |
rowno++; |
rowno++; |
|
boolentry.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
|
762 |
} |
} |
763 |
|
|
764 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
766 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
767 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
768 |
rowno++; |
rowno++; |
|
boolentry.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
|
769 |
} |
} |
770 |
|
|
771 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
775 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
776 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
777 |
rowno++; |
rowno++; |
|
prop.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
|
778 |
} |
} |
779 |
|
|
780 |
|
|
781 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
782 |
{ |
{ |
783 |
dimregion = d; |
dimregion = d; |
784 |
|
velocity_curve.set_dim_region(d); |
785 |
|
release_curve.set_dim_region(d); |
786 |
|
cutoff_curve.set_dim_region(d); |
787 |
|
crossfade_curve.set_dim_region(d); |
788 |
|
|
789 |
set_sensitive(d); |
set_sensitive(d); |
790 |
if (!d) return; |
if (!d) return; |
791 |
|
|
792 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL"); |
update_model++; |
793 |
eEG1PreAttack.set_ptr(&d->EG1PreAttack); |
eEG1PreAttack.set_value(d->EG1PreAttack); |
794 |
eEG1Attack.set_ptr(&d->EG1Attack); |
eEG1Attack.set_value(d->EG1Attack); |
795 |
eEG1Decay1.set_ptr(&d->EG1Decay1); |
eEG1Decay1.set_value(d->EG1Decay1); |
796 |
eEG1Decay2.set_ptr(&d->EG1Decay2); |
eEG1Decay2.set_value(d->EG1Decay2); |
797 |
eEG1InfiniteSustain.set_ptr(&d->EG1InfiniteSustain); |
eEG1InfiniteSustain.set_value(d->EG1InfiniteSustain); |
798 |
eEG1Sustain.set_ptr(&d->EG1Sustain); |
eEG1Sustain.set_value(d->EG1Sustain); |
799 |
eEG1Release.set_ptr(&d->EG1Release); |
eEG1Release.set_value(d->EG1Release); |
800 |
eEG1Hold.set_ptr(&d->EG1Hold); |
eEG1Hold.set_value(d->EG1Hold); |
801 |
eEG1Controller.set_ptr(&d->EG1Controller); |
eEG1Controller.set_value(d->EG1Controller); |
802 |
eEG1ControllerInvert.set_ptr(&d->EG1ControllerInvert); |
eEG1ControllerInvert.set_value(d->EG1ControllerInvert); |
803 |
eEG1ControllerAttackInfluence.set_ptr(&d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
804 |
eEG1ControllerDecayInfluence.set_ptr(&d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
805 |
eEG1ControllerReleaseInfluence.set_ptr(&d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
806 |
eLFO1Frequency.set_ptr(&d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
807 |
eLFO1InternalDepth.set_ptr(&d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
808 |
eLFO1ControlDepth.set_ptr(&d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
809 |
eLFO1Controller.set_ptr(&d->LFO1Controller); |
eLFO1Controller.set_value(d->LFO1Controller); |
810 |
eLFO1FlipPhase.set_ptr(&d->LFO1FlipPhase); |
eLFO1FlipPhase.set_value(d->LFO1FlipPhase); |
811 |
eLFO1Sync.set_ptr(&d->LFO1Sync); |
eLFO1Sync.set_value(d->LFO1Sync); |
812 |
eEG2PreAttack.set_ptr(&d->EG2PreAttack); |
eEG2PreAttack.set_value(d->EG2PreAttack); |
813 |
eEG2Attack.set_ptr(&d->EG2Attack); |
eEG2Attack.set_value(d->EG2Attack); |
814 |
eEG2Decay1.set_ptr(&d->EG2Decay1); |
eEG2Decay1.set_value(d->EG2Decay1); |
815 |
eEG2Decay2.set_ptr(&d->EG2Decay2); |
eEG2Decay2.set_value(d->EG2Decay2); |
816 |
eEG2InfiniteSustain.set_ptr(&d->EG2InfiniteSustain); |
eEG2InfiniteSustain.set_value(d->EG2InfiniteSustain); |
817 |
eEG2Sustain.set_ptr(&d->EG2Sustain); |
eEG2Sustain.set_value(d->EG2Sustain); |
818 |
eEG2Release.set_ptr(&d->EG2Release); |
eEG2Release.set_value(d->EG2Release); |
819 |
eEG2Controller.set_ptr(&d->EG2Controller); |
eEG2Controller.set_value(d->EG2Controller); |
820 |
eEG2ControllerInvert.set_ptr(&d->EG2ControllerInvert); |
eEG2ControllerInvert.set_value(d->EG2ControllerInvert); |
821 |
eEG2ControllerAttackInfluence.set_ptr(&d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
822 |
eEG2ControllerDecayInfluence.set_ptr(&d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
823 |
eEG2ControllerReleaseInfluence.set_ptr(&d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
824 |
eLFO2Frequency.set_ptr(&d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
825 |
eLFO2InternalDepth.set_ptr(&d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
826 |
eLFO2ControlDepth.set_ptr(&d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
827 |
eLFO2Controller.set_ptr(&d->LFO2Controller); |
eLFO2Controller.set_value(d->LFO2Controller); |
828 |
eLFO2FlipPhase.set_ptr(&d->LFO2FlipPhase); |
eLFO2FlipPhase.set_value(d->LFO2FlipPhase); |
829 |
eLFO2Sync.set_ptr(&d->LFO2Sync); |
eLFO2Sync.set_value(d->LFO2Sync); |
830 |
eEG3Attack.set_ptr(&d->EG3Attack); |
eEG3Attack.set_value(d->EG3Attack); |
831 |
eEG3Depth.set_ptr(&d->EG3Depth); |
eEG3Depth.set_value(d->EG3Depth); |
832 |
eLFO3Frequency.set_ptr(&d->LFO3Frequency); |
eLFO3Frequency.set_value(d->LFO3Frequency); |
833 |
eLFO3InternalDepth.set_ptr(&d->LFO3InternalDepth); |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
834 |
eLFO3ControlDepth.set_ptr(&d->LFO3ControlDepth); |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
835 |
eLFO3Controller.set_ptr(&d->LFO3Controller); |
eLFO3Controller.set_value(d->LFO3Controller); |
836 |
eLFO3Sync.set_ptr(&d->LFO3Sync); |
eLFO3Sync.set_value(d->LFO3Sync); |
837 |
eVCFEnabled.set_ptr(&d->VCFEnabled); |
eVCFEnabled.set_value(d->VCFEnabled); |
838 |
eVCFType.set_ptr(&d->VCFType); |
eVCFType.set_value(d->VCFType); |
839 |
eVCFCutoffController.set_ptr(&d->VCFCutoffController); |
eVCFCutoffController.set_value(d->VCFCutoffController); |
840 |
eVCFCutoffControllerInvert.set_ptr(&d->VCFCutoffControllerInvert); |
eVCFCutoffControllerInvert.set_value(d->VCFCutoffControllerInvert); |
841 |
eVCFCutoff.set_ptr(&d->VCFCutoff); |
eVCFCutoff.set_value(d->VCFCutoff); |
842 |
eVCFVelocityCurve.set_ptr(&d->VCFVelocityCurve); |
eVCFVelocityCurve.set_value(d->VCFVelocityCurve); |
843 |
eVCFVelocityScale.set_ptr(&d->VCFVelocityScale); |
eVCFVelocityScale.set_value(d->VCFVelocityScale); |
844 |
eVCFVelocityDynamicRange.set_ptr(&d->VCFVelocityDynamicRange); |
eVCFVelocityDynamicRange.set_value(d->VCFVelocityDynamicRange); |
845 |
eVCFResonance.set_ptr(&d->VCFResonance); |
eVCFResonance.set_value(d->VCFResonance); |
846 |
eVCFResonanceDynamic.set_ptr(&d->VCFResonanceDynamic); |
eVCFResonanceDynamic.set_value(d->VCFResonanceDynamic); |
847 |
eVCFResonanceController.set_ptr(&d->VCFResonanceController); |
eVCFResonanceController.set_value(d->VCFResonanceController); |
848 |
eVCFKeyboardTracking.set_ptr(&d->VCFKeyboardTracking); |
eVCFKeyboardTracking.set_value(d->VCFKeyboardTracking); |
849 |
eVCFKeyboardTrackingBreakpoint.set_ptr(&d->VCFKeyboardTrackingBreakpoint); |
eVCFKeyboardTrackingBreakpoint.set_value(d->VCFKeyboardTrackingBreakpoint); |
850 |
eVelocityResponseCurve.set_ptr(&d->VelocityResponseCurve); |
eVelocityResponseCurve.set_value(d->VelocityResponseCurve); |
851 |
eVelocityResponseDepth.set_ptr(&d->VelocityResponseDepth); |
eVelocityResponseDepth.set_value(d->VelocityResponseDepth); |
852 |
eVelocityResponseCurveScaling.set_ptr(&d->VelocityResponseCurveScaling); |
eVelocityResponseCurveScaling.set_value(d->VelocityResponseCurveScaling); |
853 |
eReleaseVelocityResponseCurve.set_ptr(&d->ReleaseVelocityResponseCurve); |
eReleaseVelocityResponseCurve.set_value(d->ReleaseVelocityResponseCurve); |
854 |
eReleaseVelocityResponseDepth.set_ptr(&d->ReleaseVelocityResponseDepth); |
eReleaseVelocityResponseDepth.set_value(d->ReleaseVelocityResponseDepth); |
855 |
eReleaseTriggerDecay.set_ptr(&d->ReleaseTriggerDecay); |
eReleaseTriggerDecay.set_value(d->ReleaseTriggerDecay); |
856 |
|
eCrossfade_in_start.set_value(d->Crossfade.in_start); |
857 |
eCrossfade_in_start.set_ptr(0); |
eCrossfade_in_end.set_value(d->Crossfade.in_end); |
858 |
eCrossfade_in_end.set_ptr(0); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
859 |
eCrossfade_out_start.set_ptr(0); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
860 |
eCrossfade_out_end.set_ptr(0); |
ePitchTrack.set_value(d->PitchTrack); |
861 |
eCrossfade_in_start.set_ptr(&d->Crossfade.in_start); |
eDimensionBypass.set_value(d->DimensionBypass); |
862 |
eCrossfade_in_end.set_ptr(&d->Crossfade.in_end); |
ePan.set_value(d->Pan); |
863 |
eCrossfade_out_start.set_ptr(&d->Crossfade.out_start); |
eSelfMask.set_value(d->SelfMask); |
864 |
eCrossfade_out_end.set_ptr(&d->Crossfade.out_end); |
eAttenuationController.set_value(d->AttenuationController); |
865 |
|
eInvertAttenuationController.set_value(d->InvertAttenuationController); |
866 |
ePitchTrack.set_ptr(&d->PitchTrack); |
eAttenuationControllerThreshold.set_value(d->AttenuationControllerThreshold); |
867 |
eDimensionBypass.set_ptr(&d->DimensionBypass); |
eChannelOffset.set_value(d->ChannelOffset); |
868 |
ePan.set_ptr(&d->Pan); |
eSustainDefeat.set_value(d->SustainDefeat); |
869 |
eSelfMask.set_ptr(&d->SelfMask); |
eMSDecode.set_value(d->MSDecode); |
870 |
eAttenuationController.set_ptr(&d->AttenuationController); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
871 |
eInvertAttenuationController.set_ptr(&d->InvertAttenuationController); |
eUnityNote.set_value(d->UnityNote); |
872 |
eAttenuationControllerThreshold.set_ptr(&d->AttenuationControllerThreshold); |
eFineTune.set_value(d->FineTune); |
873 |
eChannelOffset.set_ptr(&d->ChannelOffset); |
eGain.set_value(d->Gain); |
874 |
eSustainDefeat.set_ptr(&d->SustainDefeat); |
eGainPlus6.set_value(d->Gain); |
875 |
eMSDecode.set_ptr(&d->MSDecode); |
eSampleLoopEnabled.set_value(d->SampleLoops); |
876 |
eSampleStartOffset.set_ptr(&d->SampleStartOffset); |
eSampleLoopType.set_value( |
877 |
eUnityNote.set_ptr(&d->UnityNote); |
d->SampleLoops ? d->pSampleLoops[0].LoopType : 0); |
878 |
eFineTune.set_ptr(&d->FineTune); |
eSampleLoopStart.set_value( |
879 |
eGain.set_ptr(&d->Gain); |
d->SampleLoops ? d->pSampleLoops[0].LoopStart : 0); |
880 |
eGainPlus6.set_ptr(&d->Gain); |
eSampleLoopLength.set_value( |
881 |
|
d->SampleLoops ? d->pSampleLoops[0].LoopLength : 0); |
882 |
|
eSampleLoopInfinite.set_value( |
883 |
|
d->pSample && d->pSample->LoopPlayCount == 0); |
884 |
|
eSampleLoopPlayCount.set_value( |
885 |
|
d->pSample ? d->pSample->LoopPlayCount : 0); |
886 |
|
update_model--; |
887 |
|
|
888 |
eSampleLoopEnabled.set_active(d->SampleLoops); |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
|
updateLoopElements(); |
|
889 |
|
|
890 |
|
update_loop_elements(); |
891 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
892 |
} |
} |
893 |
|
|
894 |
|
|
895 |
void DimRegionEdit::VCFEnabled_toggled() |
void DimRegionEdit::VCFEnabled_toggled() |
896 |
{ |
{ |
897 |
bool sensitive = eVCFEnabled.get_active(); |
bool sensitive = eVCFEnabled.get_value(); |
898 |
eVCFType.set_sensitive(sensitive); |
eVCFType.set_sensitive(sensitive); |
899 |
eVCFCutoffController.set_sensitive(sensitive); |
eVCFCutoffController.set_sensitive(sensitive); |
900 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
904 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
905 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
906 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
907 |
|
lEG2->set_sensitive(sensitive); |
908 |
eEG2PreAttack.set_sensitive(sensitive); |
eEG2PreAttack.set_sensitive(sensitive); |
909 |
eEG2Attack.set_sensitive(sensitive); |
eEG2Attack.set_sensitive(sensitive); |
910 |
eEG2Decay1.set_sensitive(sensitive); |
eEG2Decay1.set_sensitive(sensitive); |
915 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
916 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
917 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
918 |
|
lLFO2->set_sensitive(sensitive); |
919 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
920 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
921 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
942 |
|
|
943 |
void DimRegionEdit::VCFCutoffController_changed() |
void DimRegionEdit::VCFCutoffController_changed() |
944 |
{ |
{ |
945 |
int rowno = eVCFCutoffController.get_active_row_number(); |
gig::vcf_cutoff_ctrl_t ctrl = eVCFCutoffController.get_value(); |
946 |
bool hasController = rowno != 0 && rowno != 1; |
bool hasController = ctrl != gig::vcf_cutoff_ctrl_none && ctrl != gig::vcf_cutoff_ctrl_none2; |
947 |
|
|
948 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
949 |
eVCFCutoff.set_sensitive(!hasController); |
eVCFCutoff.set_sensitive(!hasController); |
950 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
eVCFResonanceDynamic.set_sensitive(!hasController); |
951 |
eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" : |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
952 |
"Velocity scale:"); |
_("Velocity scale:")); |
953 |
} |
} |
954 |
|
|
955 |
void DimRegionEdit::VCFResonanceController_changed() |
void DimRegionEdit::VCFResonanceController_changed() |
956 |
{ |
{ |
957 |
bool hasController = eVCFResonanceController.get_active_row_number() != 0; |
bool hasController = eVCFResonanceController.get_value() != gig::vcf_res_ctrl_none; |
958 |
eVCFResonance.set_sensitive(!hasController); |
eVCFResonance.set_sensitive(!hasController); |
959 |
} |
} |
960 |
|
|
961 |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
void DimRegionEdit::EG1InfiniteSustain_toggled() |
962 |
{ |
{ |
963 |
bool infSus = eEG1InfiniteSustain.get_active(); |
bool infSus = eEG1InfiniteSustain.get_value(); |
964 |
eEG1Decay2.set_sensitive(!infSus); |
eEG1Decay2.set_sensitive(!infSus); |
965 |
} |
} |
966 |
|
|
967 |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
void DimRegionEdit::EG2InfiniteSustain_toggled() |
968 |
{ |
{ |
969 |
bool infSus = eEG2InfiniteSustain.get_active(); |
bool infSus = eEG2InfiniteSustain.get_value(); |
970 |
eEG2Decay2.set_sensitive(!infSus); |
eEG2Decay2.set_sensitive(!infSus); |
971 |
} |
} |
972 |
|
|
973 |
void DimRegionEdit::EG1Controller_changed() |
void DimRegionEdit::EG1Controller_changed() |
974 |
{ |
{ |
975 |
bool hasController = eEG1Controller.get_active_row_number() != 0; |
bool hasController = eEG1Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
976 |
eEG1ControllerInvert.set_sensitive(hasController); |
eEG1ControllerInvert.set_sensitive(hasController); |
977 |
} |
} |
978 |
|
|
979 |
void DimRegionEdit::EG2Controller_changed() |
void DimRegionEdit::EG2Controller_changed() |
980 |
{ |
{ |
981 |
bool hasController = eEG2Controller.get_active_row_number() != 0; |
bool hasController = eEG2Controller.get_value().type != gig::leverage_ctrl_t::type_none; |
982 |
eEG2ControllerInvert.set_sensitive(hasController); |
eEG2ControllerInvert.set_sensitive(hasController); |
983 |
} |
} |
984 |
|
|
985 |
void DimRegionEdit::AttenuationController_changed() |
void DimRegionEdit::AttenuationController_changed() |
986 |
{ |
{ |
987 |
bool hasController = eAttenuationController.get_active_row_number() != 0; |
bool hasController = |
988 |
|
eAttenuationController.get_value().type != gig::leverage_ctrl_t::type_none; |
989 |
eInvertAttenuationController.set_sensitive(hasController); |
eInvertAttenuationController.set_sensitive(hasController); |
990 |
eAttenuationControllerThreshold.set_sensitive(hasController); |
eAttenuationControllerThreshold.set_sensitive(hasController); |
991 |
eCrossfade_in_start.set_sensitive(hasController); |
eCrossfade_in_start.set_sensitive(hasController); |
996 |
|
|
997 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
998 |
{ |
{ |
999 |
int rowno = eLFO1Controller.get_active_row_number(); |
gig::lfo1_ctrl_t ctrl = eLFO1Controller.get_value(); |
1000 |
eLFO1ControlDepth.set_sensitive(rowno != 0); |
eLFO1ControlDepth.set_sensitive(ctrl != gig::lfo1_ctrl_internal); |
1001 |
eLFO1InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO1InternalDepth.set_sensitive(ctrl != gig::lfo1_ctrl_modwheel && |
1002 |
|
ctrl != gig::lfo1_ctrl_breath); |
1003 |
} |
} |
1004 |
|
|
1005 |
void DimRegionEdit::LFO2Controller_changed() |
void DimRegionEdit::LFO2Controller_changed() |
1006 |
{ |
{ |
1007 |
int rowno = eLFO2Controller.get_active_row_number(); |
gig::lfo2_ctrl_t ctrl = eLFO2Controller.get_value(); |
1008 |
eLFO2ControlDepth.set_sensitive(rowno != 0); |
eLFO2ControlDepth.set_sensitive(ctrl != gig::lfo2_ctrl_internal); |
1009 |
eLFO2InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO2InternalDepth.set_sensitive(ctrl != gig::lfo2_ctrl_modwheel && |
1010 |
|
ctrl != gig::lfo2_ctrl_foot); |
1011 |
} |
} |
1012 |
|
|
1013 |
void DimRegionEdit::LFO3Controller_changed() |
void DimRegionEdit::LFO3Controller_changed() |
1014 |
{ |
{ |
1015 |
int rowno = eLFO3Controller.get_active_row_number(); |
gig::lfo3_ctrl_t ctrl = eLFO3Controller.get_value(); |
1016 |
eLFO3ControlDepth.set_sensitive(rowno != 0); |
eLFO3ControlDepth.set_sensitive(ctrl != gig::lfo3_ctrl_internal); |
1017 |
eLFO3InternalDepth.set_sensitive(rowno != 1 && rowno != 2); |
eLFO3InternalDepth.set_sensitive(ctrl != gig::lfo3_ctrl_modwheel && |
1018 |
|
ctrl != gig::lfo3_ctrl_aftertouch); |
1019 |
} |
} |
1020 |
|
|
1021 |
void DimRegionEdit::crossfade1_changed() |
void DimRegionEdit::crossfade1_changed() |
1022 |
{ |
{ |
1023 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
1024 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1025 |
if (c1 > c2) eCrossfade_in_end.set_value(c1); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1026 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1027 |
|
update_model--; |
1028 |
} |
} |
1029 |
|
|
1030 |
void DimRegionEdit::crossfade2_changed() |
void DimRegionEdit::crossfade2_changed() |
1031 |
{ |
{ |
1032 |
double c1 = eCrossfade_in_start.get_value(); |
update_model++; |
1033 |
double c2 = eCrossfade_in_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1034 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1035 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1036 |
if (c2 < c1) eCrossfade_in_start.set_value(c2); |
update_model--; |
|
if (c2 > c3) eCrossfade_out_start.set_value(c2); |
|
1037 |
} |
} |
1038 |
|
|
1039 |
void DimRegionEdit::crossfade3_changed() |
void DimRegionEdit::crossfade3_changed() |
1040 |
{ |
{ |
1041 |
double c2 = eCrossfade_in_end.get_value(); |
update_model++; |
1042 |
double c3 = eCrossfade_out_start.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1043 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1044 |
|
eCrossfade_out_end.set_value(dimregion->Crossfade.out_end); |
1045 |
if (c3 < c2) eCrossfade_in_end.set_value(c3); |
update_model--; |
|
if (c3 > c4) eCrossfade_out_end.set_value(c3); |
|
1046 |
} |
} |
1047 |
|
|
1048 |
void DimRegionEdit::crossfade4_changed() |
void DimRegionEdit::crossfade4_changed() |
1049 |
{ |
{ |
1050 |
double c3 = eCrossfade_out_start.get_value(); |
update_model++; |
1051 |
double c4 = eCrossfade_out_end.get_value(); |
eCrossfade_in_start.set_value(dimregion->Crossfade.in_start); |
1052 |
|
eCrossfade_in_end.set_value(dimregion->Crossfade.in_end); |
1053 |
if (c4 < c3) eCrossfade_out_start.set_value(c4); |
eCrossfade_out_start.set_value(dimregion->Crossfade.out_start); |
1054 |
} |
update_model--; |
|
|
|
|
void DimRegionEdit::loop_enabled_toggled() |
|
|
{ |
|
|
const bool active = eSampleLoopEnabled.get_active(); |
|
|
if (active) { |
|
|
// create a new sample loop in case there is none yet |
|
|
if (!dimregion->SampleLoops) { |
|
|
DLS::sample_loop_t loop; |
|
|
loop.LoopType = gig::loop_type_normal; |
|
|
// loop the whole sample by default |
|
|
loop.LoopStart = 0; |
|
|
loop.LoopLength = |
|
|
(dimregion->pSample) ? dimregion->pSample->GetSize() : 0; |
|
|
dimregion->AddSampleLoop(&loop); |
|
|
dimreg_changed_signal(); |
|
|
} |
|
|
} else { |
|
|
if (dimregion->SampleLoops) { |
|
|
// delete ALL existing sample loops |
|
|
while (dimregion->SampleLoops) { |
|
|
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
|
|
} |
|
|
dimreg_changed_signal(); |
|
|
} |
|
|
} |
|
|
updateLoopElements(); |
|
1055 |
} |
} |
1056 |
|
|
1057 |
void DimRegionEdit::updateLoopElements() |
void DimRegionEdit::update_loop_elements() |
1058 |
{ |
{ |
1059 |
const bool active = eSampleLoopEnabled.get_active(); |
update_model++; |
1060 |
|
const bool active = eSampleLoopEnabled.get_value(); |
1061 |
eSampleLoopStart.set_sensitive(active); |
eSampleLoopStart.set_sensitive(active); |
1062 |
eSampleLoopLength.set_sensitive(active); |
eSampleLoopLength.set_sensitive(active); |
1063 |
eSampleLoopType.set_sensitive(active); |
eSampleLoopType.set_sensitive(active); |
1064 |
eSampleLoopInfinite.set_sensitive(active); |
eSampleLoopInfinite.set_sensitive(active && dimregion && dimregion->pSample); |
1065 |
eSampleLoopStart.set_ptr(0); |
// sample loop shall never be longer than the actual sample size |
1066 |
eSampleLoopLength.set_ptr(0); |
loop_start_changed(); |
1067 |
eSampleLoopPlayCount.set_ptr(0); |
loop_length_changed(); |
1068 |
|
eSampleLoopStart.set_value( |
1069 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopStart : 0); |
1070 |
|
eSampleLoopLength.set_value( |
1071 |
|
dimregion->SampleLoops ? dimregion->pSampleLoops[0].LoopLength : 0); |
1072 |
|
|
1073 |
|
eSampleLoopInfinite.set_value( |
1074 |
|
dimregion->pSample && dimregion->pSample->LoopPlayCount == 0); |
1075 |
|
|
1076 |
|
loop_infinite_toggled(); |
1077 |
|
update_model--; |
1078 |
|
} |
1079 |
|
|
1080 |
|
void DimRegionEdit::loop_start_changed() { |
1081 |
|
if (dimregion && dimregion->SampleLoops) { |
1082 |
|
eSampleLoopLength.set_upper(dimregion->pSample ? |
1083 |
|
dimregion->pSample->SamplesTotal - |
1084 |
|
dimregion->pSampleLoops[0].LoopStart : 0); |
1085 |
|
} |
1086 |
|
} |
1087 |
|
|
1088 |
|
void DimRegionEdit::loop_length_changed() { |
1089 |
if (dimregion && dimregion->SampleLoops) { |
if (dimregion && dimregion->SampleLoops) { |
1090 |
eSampleLoopStart.set_ptr(&dimregion->pSampleLoops[0].LoopStart); |
eSampleLoopStart.set_upper(dimregion->pSample ? |
1091 |
eSampleLoopLength.set_ptr(&dimregion->pSampleLoops[0].LoopLength); |
dimregion->pSample->SamplesTotal - |
1092 |
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(); |
|
1093 |
} |
} |
1094 |
} |
} |
1095 |
|
|
1096 |
void DimRegionEdit::loop_infinite_toggled() { |
void DimRegionEdit::loop_infinite_toggled() { |
1097 |
eSampleLoopPlayCount.set_sensitive( |
eSampleLoopPlayCount.set_sensitive( |
1098 |
!eSampleLoopInfinite.get_active() && |
dimregion && dimregion->pSample && |
1099 |
eSampleLoopEnabled.get_active() |
!eSampleLoopInfinite.get_value() && |
1100 |
|
eSampleLoopEnabled.get_value() |
1101 |
); |
); |
1102 |
if (eSampleLoopInfinite.get_active()) |
update_model++; |
1103 |
eSampleLoopPlayCount.set_value(0); |
eSampleLoopPlayCount.set_value( |
1104 |
else if (!eSampleLoopPlayCount.get_value()) |
dimregion->pSample ? dimregion->pSample->LoopPlayCount : 0); |
1105 |
eSampleLoopPlayCount.set_value(1); |
update_model--; |
1106 |
} |
} |
1107 |
|
|
1108 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
1109 |
{ |
{ |
1110 |
if (dimregion) { |
if (dimregion) { |
1111 |
dimregion->pSample = sample; |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
1112 |
|
|
1113 |
// copy sample information from Sample to DimensionRegion |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1114 |
|
//dimreg_to_be_changed_signal.emit(dimregion); |
1115 |
|
|
1116 |
dimregion->UnityNote = sample->MIDIUnityNote; |
// make sure stereo samples always are the same in both |
1117 |
dimregion->FineTune = sample->FineTune; |
// dimregs in the samplechannel dimension |
1118 |
|
int nbDimregs = 1; |
1119 |
|
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
1120 |
|
if (sample->Channels == 2) { |
1121 |
|
gig::Region* region = dimregion->GetParent(); |
1122 |
|
|
1123 |
|
int bitcount = 0; |
1124 |
|
int stereo_bit = 0; |
1125 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1126 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1127 |
|
stereo_bit = 1 << bitcount; |
1128 |
|
break; |
1129 |
|
} |
1130 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1131 |
|
} |
1132 |
|
|
1133 |
int loops = sample->Loops ? 1 : 0; |
if (stereo_bit) { |
1134 |
while (dimregion->SampleLoops > loops) { |
int dimregno; |
1135 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1136 |
} |
if (region->pDimensionRegions[dimregno] == dimregion) { |
1137 |
while (dimregion->SampleLoops < sample->Loops) { |
break; |
1138 |
DLS::sample_loop_t loop; |
} |
1139 |
dimregion->AddSampleLoop(&loop); |
} |
1140 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1141 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1142 |
|
nbDimregs = 2; |
1143 |
|
} |
1144 |
} |
} |
1145 |
if (loops) { |
|
1146 |
dimregion->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
gig::Sample* oldref = dimregion->pSample; |
1147 |
dimregion->pSampleLoops[0].LoopType = sample->LoopType; |
|
1148 |
dimregion->pSampleLoops[0].LoopStart = sample->LoopStart; |
for (int i = 0 ; i < nbDimregs ; i++) { |
1149 |
dimregion->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSample = sample; |
1150 |
|
|
1151 |
|
// copy sample information from Sample to DimensionRegion |
1152 |
|
|
1153 |
|
d[i]->UnityNote = sample->MIDIUnityNote; |
1154 |
|
d[i]->FineTune = sample->FineTune; |
1155 |
|
|
1156 |
|
int loops = sample->Loops ? 1 : 0; |
1157 |
|
while (d[i]->SampleLoops > loops) { |
1158 |
|
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1159 |
|
} |
1160 |
|
while (d[i]->SampleLoops < sample->Loops) { |
1161 |
|
DLS::sample_loop_t loop; |
1162 |
|
d[i]->AddSampleLoop(&loop); |
1163 |
|
} |
1164 |
|
if (loops) { |
1165 |
|
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1166 |
|
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1167 |
|
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1168 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1169 |
|
} |
1170 |
} |
} |
1171 |
|
|
1172 |
// update ui |
// update ui |
1173 |
|
update_model++; |
1174 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(dimregion->pSample->pInfo->Name); |
1175 |
eUnityNote.set_ptr(&dimregion->UnityNote); |
eUnityNote.set_value(dimregion->UnityNote); |
1176 |
eFineTune.set_ptr(&dimregion->FineTune); |
eFineTune.set_value(dimregion->FineTune); |
1177 |
eSampleLoopEnabled.set_active(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
1178 |
updateLoopElements(); |
update_loop_elements(); |
1179 |
|
update_model--; |
1180 |
dimreg_changed_signal(); |
|
1181 |
|
sample_ref_changed_signal.emit(oldref, sample); |
1182 |
|
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1183 |
|
//dimreg_changed_signal.emit(dimregion); |
1184 |
return true; |
return true; |
1185 |
} |
} |
1186 |
return false; |
return false; |
1187 |
} |
} |
1188 |
|
|
1189 |
|
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_to_be_changed() { |
1190 |
|
return dimreg_to_be_changed_signal; |
1191 |
|
} |
1192 |
|
|
1193 |
|
sigc::signal<void, gig::DimensionRegion*>& DimRegionEdit::signal_dimreg_changed() { |
1194 |
|
return dimreg_changed_signal; |
1195 |
|
} |
1196 |
|
|
1197 |
|
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& DimRegionEdit::signal_sample_ref_changed() { |
1198 |
|
return sample_ref_changed_signal; |
1199 |
|
} |
1200 |
|
|
1201 |
|
|
1202 |
|
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
1203 |
|
{ |
1204 |
|
d->UnityNote = value; |
1205 |
|
} |
1206 |
|
|
1207 |
|
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
1208 |
|
{ |
1209 |
|
d->FineTune = value; |
1210 |
|
} |
1211 |
|
|
1212 |
|
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
1213 |
|
uint8_t value) |
1214 |
|
{ |
1215 |
|
d->Crossfade.in_start = value; |
1216 |
|
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1217 |
|
} |
1218 |
|
|
1219 |
|
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
1220 |
|
uint8_t value) |
1221 |
|
{ |
1222 |
|
d->Crossfade.in_end = value; |
1223 |
|
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
1224 |
|
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1225 |
|
} |
1226 |
|
|
1227 |
|
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
1228 |
|
uint8_t value) |
1229 |
|
{ |
1230 |
|
d->Crossfade.out_start = value; |
1231 |
|
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
1232 |
|
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
1233 |
|
} |
1234 |
|
|
1235 |
|
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
1236 |
|
uint8_t value) |
1237 |
|
{ |
1238 |
|
d->Crossfade.out_end = value; |
1239 |
|
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
1240 |
|
} |
1241 |
|
|
1242 |
|
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
1243 |
|
{ |
1244 |
|
d->SetGain(value); |
1245 |
|
} |
1246 |
|
|
1247 |
|
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
1248 |
|
{ |
1249 |
|
if (value) { |
1250 |
|
// create a new sample loop in case there is none yet |
1251 |
|
if (!d->SampleLoops) { |
1252 |
|
DLS::sample_loop_t loop; |
1253 |
|
loop.LoopType = gig::loop_type_normal; |
1254 |
|
// loop the whole sample by default |
1255 |
|
loop.LoopStart = 0; |
1256 |
|
loop.LoopLength = |
1257 |
|
(d->pSample) ? d->pSample->SamplesTotal : 0; |
1258 |
|
dimreg_to_be_changed_signal.emit(d); |
1259 |
|
d->AddSampleLoop(&loop); |
1260 |
|
dimreg_changed_signal.emit(d); |
1261 |
|
} |
1262 |
|
} else { |
1263 |
|
if (d->SampleLoops) { |
1264 |
|
dimreg_to_be_changed_signal.emit(d); |
1265 |
|
// delete ALL existing sample loops |
1266 |
|
while (d->SampleLoops) { |
1267 |
|
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1268 |
|
} |
1269 |
|
dimreg_changed_signal.emit(d); |
1270 |
|
} |
1271 |
|
} |
1272 |
|
} |
1273 |
|
|
1274 |
|
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
1275 |
|
{ |
1276 |
|
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
1277 |
|
} |
1278 |
|
|
1279 |
|
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
1280 |
|
{ |
1281 |
|
if (d->SampleLoops) { |
1282 |
|
d->pSampleLoops[0].LoopStart = |
1283 |
|
d->pSample ? |
1284 |
|
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1285 |
|
d->pSampleLoops[0].LoopLength)) : |
1286 |
|
0; |
1287 |
|
} |
1288 |
|
} |
1289 |
|
|
1290 |
|
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
1291 |
|
{ |
1292 |
|
if (d->SampleLoops) { |
1293 |
|
d->pSampleLoops[0].LoopLength = |
1294 |
|
d->pSample ? |
1295 |
|
std::min(value, uint32_t(d->pSample->SamplesTotal - |
1296 |
|
d->pSampleLoops[0].LoopStart)) : |
1297 |
|
0; |
1298 |
|
} |
1299 |
|
} |
1300 |
|
|
1301 |
|
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
1302 |
|
{ |
1303 |
|
if (d->pSample) { |
1304 |
|
if (value) d->pSample->LoopPlayCount = 0; |
1305 |
|
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
1306 |
|
} |
1307 |
|
} |
1308 |
|
|
1309 |
|
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
1310 |
|
{ |
1311 |
|
if (d->pSample) d->pSample->LoopPlayCount = value; |
1312 |
|
} |