1 |
/* |
/* |
2 |
* Copyright (C) 2006, 2007 Andreas Persson |
* Copyright (C) 2006-2017 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 |
17 |
* 02110-1301 USA. |
* 02110-1301 USA. |
18 |
*/ |
*/ |
19 |
|
|
20 |
|
#include "global.h" |
21 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
22 |
|
|
23 |
#include "global.h" |
#include "compat.h" |
24 |
|
|
25 |
|
#if USE_GTKMM_GRID |
26 |
|
# include <gtkmm/grid.h> |
27 |
|
#else |
28 |
|
# include <gtkmm/table.h> |
29 |
|
#endif |
30 |
|
|
31 |
|
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
32 |
|
getter(getter), dimreg(0) { |
33 |
|
set_size_request(80, 80); |
34 |
|
} |
35 |
|
|
36 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
37 |
|
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
38 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
39 |
|
get_window()->create_cairo_context(); |
40 |
|
#if 0 |
41 |
|
} |
42 |
|
#endif |
43 |
|
#else |
44 |
|
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
45 |
|
#endif |
46 |
|
if (dimreg) { |
47 |
|
int w = get_width(); |
48 |
|
int h = get_height(); |
49 |
|
|
50 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
51 |
|
for (double x = 0 ; x <= w ; x++) { |
52 |
|
int vel = int(x * (127 - 1e-10) / w + 1); |
53 |
|
double y = (1 - (dimreg->*getter)(vel)) * (h - 3) + 1.5; |
54 |
|
|
55 |
|
if (x < 1e-10) { |
56 |
|
cr->move_to(x, y); |
57 |
|
} else { |
58 |
|
cr->line_to(x, y); |
59 |
|
} |
60 |
|
} |
61 |
|
if (pass == 0) { |
62 |
|
cr->line_to(w, h); |
63 |
|
cr->line_to(0, h); |
64 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 0.2 : 0.1); |
65 |
|
cr->fill(); |
66 |
|
} else { |
67 |
|
cr->set_line_width(3); |
68 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 1.0 : 0.3); |
69 |
|
cr->stroke(); |
70 |
|
} |
71 |
|
} |
72 |
|
} |
73 |
|
return true; |
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
|
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
78 |
|
set_size_request(280, 80); |
79 |
|
} |
80 |
|
|
81 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
82 |
|
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
83 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
84 |
|
get_window()->create_cairo_context(); |
85 |
|
#if 0 |
86 |
|
} |
87 |
|
#endif |
88 |
|
#else |
89 |
|
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
90 |
|
#endif |
91 |
|
if (dimreg) { |
92 |
|
cr->translate(1.5, 0); |
93 |
|
|
94 |
|
// first, draw curves for the other layers |
95 |
|
gig::Region* region = dimreg->GetParent(); |
96 |
|
int dimregno; |
97 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
98 |
|
if (region->pDimensionRegions[dimregno] == dimreg) { |
99 |
|
break; |
100 |
|
} |
101 |
|
} |
102 |
|
int bitcount = 0; |
103 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
104 |
|
if (region->pDimensionDefinitions[dim].dimension == |
105 |
|
gig::dimension_layer) { |
106 |
|
int mask = |
107 |
|
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
108 |
|
bitcount); |
109 |
|
int c = dimregno & mask; // mask away the layer dimension |
110 |
|
|
111 |
|
for (int i = 0 ; i < region->pDimensionDefinitions[dim].zones ; |
112 |
|
i++) { |
113 |
|
gig::DimensionRegion* d = |
114 |
|
region->pDimensionRegions[c + (i << bitcount)]; |
115 |
|
if (d != dimreg) { |
116 |
|
draw_one_curve(cr, d, false); |
117 |
|
} |
118 |
|
} |
119 |
|
break; |
120 |
|
} |
121 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
122 |
|
} |
123 |
|
|
124 |
|
// then, draw the currently selected layer |
125 |
|
draw_one_curve(cr, dimreg, is_sensitive()); |
126 |
|
} |
127 |
|
return true; |
128 |
|
} |
129 |
|
|
130 |
|
void CrossfadeCurve::draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr, |
131 |
|
const gig::DimensionRegion* d, |
132 |
|
bool sensitive) { |
133 |
|
int w = get_width(); |
134 |
|
int h = get_height(); |
135 |
|
|
136 |
|
if (d->Crossfade.out_end) { |
137 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
138 |
|
cr->move_to(d->Crossfade.in_start / 127.0 * (w - 3), h); |
139 |
|
cr->line_to(d->Crossfade.in_end / 127.0 * (w - 3), 1.5); |
140 |
|
cr->line_to(d->Crossfade.out_start / 127.0 * (w - 3), 1.5); |
141 |
|
cr->line_to(d->Crossfade.out_end / 127.0 * (w - 3), h); |
142 |
|
|
143 |
|
if (pass == 0) { |
144 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 0.2 : 0.1); |
145 |
|
cr->fill(); |
146 |
|
} else { |
147 |
|
cr->set_line_width(3); |
148 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 1.0 : 0.3); |
149 |
|
cr->stroke(); |
150 |
|
} |
151 |
|
} |
152 |
|
} |
153 |
|
} |
154 |
|
|
155 |
|
|
156 |
|
EGStateOptions::EGStateOptions() : HBox(), |
157 |
|
label(_("May be cancelled: ")), |
158 |
|
checkBoxAttack(_("Attack")), |
159 |
|
checkBoxAttackHold(_("Attack Hold")), |
160 |
|
checkBoxDecay1(_("Decay 1")), |
161 |
|
checkBoxDecay2(_("Decay 2")), |
162 |
|
checkBoxRelease(_("Release")) |
163 |
|
{ |
164 |
|
set_spacing(6); |
165 |
|
|
166 |
|
pack_start(label); |
167 |
|
pack_start(checkBoxAttack, Gtk::PACK_SHRINK); |
168 |
|
pack_start(checkBoxAttackHold, Gtk::PACK_SHRINK); |
169 |
|
pack_start(checkBoxDecay1, Gtk::PACK_SHRINK); |
170 |
|
pack_start(checkBoxDecay2, Gtk::PACK_SHRINK); |
171 |
|
pack_start(checkBoxRelease, Gtk::PACK_SHRINK); |
172 |
|
|
173 |
|
checkBoxAttack.set_tooltip_text(_( |
174 |
|
"If checked: a note-off aborts the 'attack' stage." |
175 |
|
)); |
176 |
|
checkBoxAttackHold.set_tooltip_text(_( |
177 |
|
"If checked: a note-off aborts the 'attack hold' stage." |
178 |
|
)); |
179 |
|
checkBoxDecay1.set_tooltip_text(_( |
180 |
|
"If checked: a note-off aborts the 'decay 1' stage." |
181 |
|
)); |
182 |
|
checkBoxDecay2.set_tooltip_text(_( |
183 |
|
"If checked: a note-off aborts the 'decay 2' stage." |
184 |
|
)); |
185 |
|
checkBoxRelease.set_tooltip_text(_( |
186 |
|
"If checked: a note-on reverts back from the 'release' stage." |
187 |
|
)); |
188 |
|
} |
189 |
|
|
190 |
|
|
191 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
192 |
eEG1PreAttack("Pre-attack", 0, 100, 2), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
193 |
eEG1Attack("Attack", 0, 60, 3), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
194 |
eEG1Decay1("Decay 1", 0.005, 60, 3), |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
195 |
eEG1Decay2("Decay 2", 0, 60, 3), |
eEG1PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
196 |
eEG1InfiniteSustain("Infinite sustain"), |
eEG1Attack(_("Attack Time (seconds)"), 0, 60, 3), |
197 |
eEG1Sustain("Sustain", 0, 100, 2), |
eEG1Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
198 |
eEG1Release("Release", 0, 60, 3), |
eEG1Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
199 |
eEG1Hold("Hold"), |
eEG1InfiniteSustain(_("Infinite sustain")), |
200 |
eEG1Controller("Controller"), |
eEG1Sustain(_("Sustain Level (%)"), 0, 100, 2), |
201 |
eEG1ControllerInvert("Controller invert"), |
eEG1Release(_("Release Time (seconds)"), 0, 60, 3), |
202 |
eEG1ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG1Hold(_("Hold Attack Stage until Loop End")), |
203 |
eEG1ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG1Controller(_("Controller")), |
204 |
eEG1ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG1ControllerInvert(_("Controller invert")), |
205 |
eLFO1Frequency("Frequency", 0.1, 10, 2), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
206 |
eLFO1InternalDepth("Internal depth", 0, 1200), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
207 |
eLFO1ControlDepth("Control depth", 0, 1200), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
208 |
eLFO1Controller("Controller"), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
209 |
eLFO1FlipPhase("Flip phase"), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
210 |
eLFO1Sync("Sync"), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
211 |
eEG2PreAttack("Pre-attack", 0, 100, 2), |
eLFO1Controller(_("Controller")), |
212 |
eEG2Attack("Attack", 0, 60, 3), |
eLFO1FlipPhase(_("Flip phase")), |
213 |
eEG2Decay1("Decay 1", 0.005, 60, 3), |
eLFO1Sync(_("Sync")), |
214 |
eEG2Decay2("Decay 2", 0, 60, 3), |
eEG2PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
215 |
eEG2InfiniteSustain("Infinite sustain"), |
eEG2Attack(_("Attack Time (seconds)"), 0, 60, 3), |
216 |
eEG2Sustain("Sustain", 0, 100, 2), |
eEG2Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
217 |
eEG2Release("Release", 0, 60, 3), |
eEG2Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
218 |
eEG2Controller("Controller"), |
eEG2InfiniteSustain(_("Infinite sustain")), |
219 |
eEG2ControllerInvert("Controller invert"), |
eEG2Sustain(_("Sustain Level (%)"), 0, 100, 2), |
220 |
eEG2ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG2Release(_("Release Time (seconds)"), 0, 60, 3), |
221 |
eEG2ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG2Controller(_("Controller")), |
222 |
eEG2ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG2ControllerInvert(_("Controller invert")), |
223 |
eLFO2Frequency("Frequency", 0.1, 10, 2), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
224 |
eLFO2InternalDepth("Internal depth", 0, 1200), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
225 |
eLFO2ControlDepth("Control depth", 0, 1200), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
226 |
eLFO2Controller("Controller"), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
227 |
eLFO2FlipPhase("Flip phase"), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
228 |
eLFO2Sync("Sync"), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
229 |
eEG3Attack("Attack", 0, 10, 3), |
eLFO2Controller(_("Controller")), |
230 |
eEG3Depth("Depth", -1200, 1200), |
eLFO2FlipPhase(_("Flip phase")), |
231 |
eLFO3Frequency("Frequency", 0.1, 10, 2), |
eLFO2Sync(_("Sync")), |
232 |
eLFO3InternalDepth("Internal depth", 0, 1200), |
eEG3Attack(_("Attack"), 0, 10, 3), |
233 |
eLFO3ControlDepth("Control depth", 0, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
234 |
eLFO3Controller("Controller"), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
235 |
eLFO3Sync("Sync"), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
236 |
eVCFEnabled("Enabled"), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
237 |
eVCFType("Type"), |
eLFO3Controller(_("Controller")), |
238 |
eVCFCutoffController("Cutoff controller"), |
eLFO3Sync(_("Sync")), |
239 |
eVCFCutoffControllerInvert("Cutoff controller invert"), |
eVCFEnabled(_("Enabled")), |
240 |
eVCFCutoff("Cutoff"), |
eVCFType(_("Type")), |
241 |
eVCFVelocityCurve("Velocity curve"), |
eVCFCutoffController(_("Cutoff controller")), |
242 |
eVCFVelocityScale("Velocity scale"), |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
243 |
eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4), |
eVCFCutoff(_("Cutoff")), |
244 |
eVCFResonance("Resonance"), |
eVCFVelocityCurve(_("Velocity curve")), |
245 |
eVCFResonanceDynamic("Resonance dynamic"), |
eVCFVelocityScale(_("Velocity scale")), |
246 |
eVCFResonanceController("Resonance controller"), |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
247 |
eVCFKeyboardTracking("Keyboard tracking"), |
eVCFResonance(_("Resonance")), |
248 |
eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"), |
eVCFResonanceDynamic(_("Resonance dynamic")), |
249 |
eVelocityResponseCurve("Velocity response curve"), |
eVCFResonanceController(_("Resonance controller")), |
250 |
eVelocityResponseDepth("Velocity response depth", 0, 4), |
eVCFKeyboardTracking(_("Keyboard tracking")), |
251 |
eVelocityResponseCurveScaling("Velocity response curve scaling"), |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
252 |
eReleaseVelocityResponseCurve("Release velocity response curve"), |
eVelocityResponseCurve(_("Velocity response curve")), |
253 |
eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4), |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
254 |
eReleaseTriggerDecay("Release trigger decay", 0, 8), |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
255 |
eCrossfade_in_start("Crossfade-in start"), |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
256 |
eCrossfade_in_end("Crossfade-in end"), |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
257 |
eCrossfade_out_start("Crossfade-out start"), |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
258 |
eCrossfade_out_end("Crossfade-out end"), |
eCrossfade_in_start(_("Crossfade-in start")), |
259 |
ePitchTrack("Pitch track"), |
eCrossfade_in_end(_("Crossfade-in end")), |
260 |
eDimensionBypass("Dimension bypass"), |
eCrossfade_out_start(_("Crossfade-out start")), |
261 |
ePan("Pan", -64, 63), |
eCrossfade_out_end(_("Crossfade-out end")), |
262 |
eSelfMask("Self mask"), |
ePitchTrack(_("Pitch track")), |
263 |
eAttenuationController("Attenuation controller"), |
eDimensionBypass(_("Dimension bypass")), |
264 |
eInvertAttenuationController("Invert attenuation controller"), |
ePan(_("Pan"), -64, 63), |
265 |
eAttenuationControllerThreshold("Attenuation controller threshold"), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
266 |
eChannelOffset("Channel offset", 0, 9), |
eAttenuationController(_("Attenuation controller")), |
267 |
eSustainDefeat("Sustain defeat"), |
eInvertAttenuationController(_("Invert attenuation controller")), |
268 |
eMSDecode("MS decode"), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
269 |
eSampleStartOffset("Sample start offset", 0, 2000), |
eChannelOffset(_("Channel offset"), 0, 9), |
270 |
eUnityNote("Unity note"), |
eSustainDefeat(_("Ignore Hold Pedal (a.k.a. \"Sustain defeat\")")), |
271 |
eFineTune("Fine tune", -49, 50), |
eMSDecode(_("Decode Mid/Side Recordings")), |
272 |
eGain("Gain", -96, 0, 2, -655360), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
273 |
eGainPlus6("Gain +6dB", eGain, 6 * -655360), |
eUnityNote(_("Unity note")), |
274 |
eSampleLoopEnabled("Enabled"), |
eSampleGroup(_("Sample Group")), |
275 |
eSampleLoopStart("Loop start positon"), |
eSampleFormatInfo(_("Sample Format")), |
276 |
eSampleLoopLength("Loop size"), |
eSampleID("Sample ID"), |
277 |
eSampleLoopType("Loop type"), |
eChecksum("Wave Data CRC-32"), |
278 |
eSampleLoopInfinite("Infinite loop"), |
eFineTune(_("Fine tune"), -49, 50), |
279 |
eSampleLoopPlayCount("Playback count", 1), |
eGain(_("Gain"), -96, 0, 2, -655360), |
280 |
|
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
281 |
|
eSampleLoopEnabled(_("Enabled")), |
282 |
|
eSampleLoopStart(_("Loop start positon")), |
283 |
|
eSampleLoopLength(_("Loop size")), |
284 |
|
eSampleLoopType(_("Loop type")), |
285 |
|
eSampleLoopInfinite(_("Infinite loop")), |
286 |
|
eSampleLoopPlayCount(_("Playback count"), 1), |
287 |
|
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
288 |
update_model(0) |
update_model(0) |
289 |
{ |
{ |
290 |
|
// make synthesis parameter page tabs scrollable |
291 |
|
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
292 |
|
set_scrollable(); |
293 |
|
|
294 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
295 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
296 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
307 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
308 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
309 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
310 |
|
{ |
311 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackCancel)); |
312 |
|
connect(eEG1StateOptions.checkBoxAttack, mp.pmember); |
313 |
|
} |
314 |
|
{ |
315 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackHoldCancel)); |
316 |
|
connect(eEG1StateOptions.checkBoxAttackHold, mp.pmember); |
317 |
|
} |
318 |
|
{ |
319 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay1Cancel)); |
320 |
|
connect(eEG1StateOptions.checkBoxDecay1, mp.pmember); |
321 |
|
} |
322 |
|
{ |
323 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay2Cancel)); |
324 |
|
connect(eEG1StateOptions.checkBoxDecay2, mp.pmember); |
325 |
|
} |
326 |
|
{ |
327 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.ReleaseCancel)); |
328 |
|
connect(eEG1StateOptions.checkBoxRelease, mp.pmember); |
329 |
|
} |
330 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
331 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
332 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
348 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
349 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
350 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
351 |
|
{ |
352 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackCancel)); |
353 |
|
connect(eEG2StateOptions.checkBoxAttack, mp.pmember); |
354 |
|
} |
355 |
|
{ |
356 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackHoldCancel)); |
357 |
|
connect(eEG2StateOptions.checkBoxAttackHold, mp.pmember); |
358 |
|
} |
359 |
|
{ |
360 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay1Cancel)); |
361 |
|
connect(eEG2StateOptions.checkBoxDecay1, mp.pmember); |
362 |
|
} |
363 |
|
{ |
364 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay2Cancel)); |
365 |
|
connect(eEG2StateOptions.checkBoxDecay2, mp.pmember); |
366 |
|
} |
367 |
|
{ |
368 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.ReleaseCancel)); |
369 |
|
connect(eEG2StateOptions.checkBoxRelease, mp.pmember); |
370 |
|
} |
371 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
372 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
373 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
438 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
439 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
440 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
441 |
|
buttonSelectSample.signal_clicked().connect( |
442 |
|
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
443 |
|
); |
444 |
|
|
445 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
446 |
|
#if USE_GTKMM_GRID |
447 |
|
table[i] = new Gtk::Grid; |
448 |
|
table[i]->set_column_spacing(7); |
449 |
|
#else |
450 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
451 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
452 |
|
#endif |
453 |
|
|
454 |
} |
} |
455 |
|
|
456 |
// set tooltips |
// set tooltips |
457 |
eUnityNote.set_tip( |
eUnityNote.set_tip( |
458 |
_("Note this sample is associated with (a.k.a. 'root note')") |
_("Note this sample is associated with (a.k.a. 'root note')") |
459 |
); |
); |
460 |
|
buttonSelectSample.set_tooltip_text( |
461 |
|
_("Selects the sample of this dimension region on the left hand side's sample tree view.") |
462 |
|
); |
463 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
464 |
ePan.set_tip(_("Stereo balance (left/right)")); |
ePan.set_tip(_("Stereo balance (left/right)")); |
465 |
eChannelOffset.set_tip( |
eChannelOffset.set_tip( |
490 |
"Caution: this setting is stored on Sample side, thus is shared " |
"Caution: this setting is stored on Sample side, thus is shared " |
491 |
"among all dimension regions that use this sample!") |
"among all dimension regions that use this sample!") |
492 |
); |
); |
493 |
|
|
494 |
|
eEG1PreAttack.set_tip( |
495 |
|
"Very first level this EG starts with. It rises then in Attack Time " |
496 |
|
"seconds from this initial level to 100%." |
497 |
|
); |
498 |
|
eEG1Attack.set_tip( |
499 |
|
"Duration of the EG's Attack stage, which raises its level from " |
500 |
|
"Pre-Attack Level to 100%." |
501 |
|
); |
502 |
|
eEG1Hold.set_tip( |
503 |
|
"On looped sounds, enabling this will cause the Decay 1 stage not to " |
504 |
|
"enter before the loop has been passed one time." |
505 |
|
); |
506 |
|
eAttenuationController.set_tip(_( |
507 |
|
"If you are not using the 'Layer' dimension, then this controller " |
508 |
|
"simply alters the volume. If you are using the 'Layer' dimension, " |
509 |
|
"then this controller is controlling the crossfade between Layers in " |
510 |
|
"real-time." |
511 |
|
)); |
512 |
|
|
513 |
|
eLFO1Sync.set_tip( |
514 |
|
"If not checked, every voice will use its own LFO instance, which " |
515 |
|
"causes voices triggered at different points in time to have different " |
516 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
517 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
518 |
|
"no matter when the individual notes have been triggered." |
519 |
|
); |
520 |
|
eLFO2Sync.set_tip( |
521 |
|
"If not checked, every voice will use its own LFO instance, which " |
522 |
|
"causes voices triggered at different points in time to have different " |
523 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
524 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
525 |
|
"no matter when the individual notes have been triggered." |
526 |
|
); |
527 |
|
eLFO3Sync.set_tip( |
528 |
|
"If not checked, every voice will use its own LFO instance, which " |
529 |
|
"causes voices triggered at different points in time to have different " |
530 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
531 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
532 |
|
"no matter when the individual notes have been triggered." |
533 |
|
); |
534 |
|
eLFO1FlipPhase.set_tip( |
535 |
|
"Inverts the LFO's generated wave vertically." |
536 |
|
); |
537 |
|
eLFO2FlipPhase.set_tip( |
538 |
|
"Inverts the LFO's generated wave vertically." |
539 |
|
); |
540 |
|
|
541 |
pageno = 0; |
pageno = 0; |
542 |
rowno = 0; |
rowno = 0; |
543 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
544 |
|
|
545 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
546 |
addString("Sample", lSample, wSample); |
addString(_("Sample"), lSample, wSample, buttonNullSampleReference); |
547 |
|
buttonNullSampleReference->set_label("X"); |
548 |
|
buttonNullSampleReference->set_tooltip_text(_("Remove current sample reference (NULL reference). This can be used to define a \"silent\" case where no sample shall be played.")); |
549 |
|
buttonNullSampleReference->signal_clicked().connect( |
550 |
|
sigc::mem_fun(*this, &DimRegionEdit::nullOutSampleReference) |
551 |
|
); |
552 |
//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); |
553 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
#ifdef OLD_TOOLTIPS |
554 |
|
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
555 |
|
#else |
556 |
|
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
557 |
|
#endif |
558 |
addProp(eUnityNote); |
addProp(eUnityNote); |
559 |
|
addProp(eSampleGroup); |
560 |
|
addProp(eSampleFormatInfo); |
561 |
|
addProp(eSampleID); |
562 |
|
addProp(eChecksum); |
563 |
|
addRightHandSide(buttonSelectSample); |
564 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
565 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
566 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
567 |
addHeader("Loops"); |
addHeader(_("Loops")); |
568 |
addProp(eSampleLoopEnabled); |
addProp(eSampleLoopEnabled); |
569 |
addProp(eSampleLoopStart); |
addProp(eSampleLoopStart); |
570 |
addProp(eSampleLoopLength); |
addProp(eSampleLoopLength); |
571 |
{ |
{ |
572 |
const char* choices[] = { "normal", "bidirectional", "backward", 0 }; |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
573 |
static const uint32_t values[] = { |
static const uint32_t values[] = { |
574 |
gig::loop_type_normal, |
gig::loop_type_normal, |
575 |
gig::loop_type_bidirectional, |
gig::loop_type_bidirectional, |
590 |
addHeader(_("Amplitude Envelope (EG1)")); |
addHeader(_("Amplitude Envelope (EG1)")); |
591 |
addProp(eEG1PreAttack); |
addProp(eEG1PreAttack); |
592 |
addProp(eEG1Attack); |
addProp(eEG1Attack); |
593 |
|
addProp(eEG1Hold); |
594 |
addProp(eEG1Decay1); |
addProp(eEG1Decay1); |
595 |
addProp(eEG1Decay2); |
addProp(eEG1Decay2); |
596 |
addProp(eEG1InfiniteSustain); |
addProp(eEG1InfiniteSustain); |
597 |
addProp(eEG1Sustain); |
addProp(eEG1Sustain); |
598 |
addProp(eEG1Release); |
addProp(eEG1Release); |
|
addProp(eEG1Hold); |
|
599 |
addProp(eEG1Controller); |
addProp(eEG1Controller); |
600 |
addProp(eEG1ControllerInvert); |
addProp(eEG1ControllerInvert); |
601 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
602 |
addProp(eEG1ControllerDecayInfluence); |
addProp(eEG1ControllerDecayInfluence); |
603 |
addProp(eEG1ControllerReleaseInfluence); |
addProp(eEG1ControllerReleaseInfluence); |
604 |
|
addLine(eEG1StateOptions); |
605 |
|
|
606 |
nextPage(); |
nextPage(); |
607 |
|
|
610 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
611 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
612 |
{ |
{ |
613 |
const char* choices[] = { "internal", "modwheel", "breath", |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
614 |
"internal+modwheel", "internal+breath", 0 }; |
_("internal+modwheel"), _("internal+breath"), 0 }; |
615 |
static const gig::lfo1_ctrl_t values[] = { |
static const gig::lfo1_ctrl_t values[] = { |
616 |
gig::lfo1_ctrl_internal, |
gig::lfo1_ctrl_internal, |
617 |
gig::lfo1_ctrl_modwheel, |
gig::lfo1_ctrl_modwheel, |
624 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
625 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
626 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
627 |
addHeader("Crossfade"); |
addHeader(_("Crossfade")); |
628 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
629 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
630 |
addProp(eAttenuationControllerThreshold); |
addProp(eAttenuationControllerThreshold); |
633 |
addProp(eCrossfade_out_start); |
addProp(eCrossfade_out_start); |
634 |
addProp(eCrossfade_out_end); |
addProp(eCrossfade_out_end); |
635 |
|
|
636 |
|
Gtk::Frame* frame = new Gtk::Frame; |
637 |
|
frame->add(crossfade_curve); |
638 |
|
#if USE_GTKMM_GRID |
639 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
640 |
|
#else |
641 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
642 |
|
Gtk::SHRINK, Gtk::SHRINK); |
643 |
|
#endif |
644 |
|
rowno++; |
645 |
|
|
646 |
|
eCrossfade_in_start.signal_value_changed().connect( |
647 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
648 |
|
eCrossfade_in_end.signal_value_changed().connect( |
649 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
650 |
|
eCrossfade_out_start.signal_value_changed().connect( |
651 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
652 |
|
eCrossfade_out_end.signal_value_changed().connect( |
653 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
654 |
|
|
655 |
nextPage(); |
nextPage(); |
656 |
|
|
657 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
658 |
addProp(eVCFEnabled); |
addProp(eVCFEnabled); |
659 |
{ |
{ |
660 |
const char* choices[] = { "lowpass", "lowpassturbo", "bandpass", |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
661 |
"highpass", "bandreject", 0 }; |
_("highpass"), _("bandreject"), 0 }; |
662 |
static const gig::vcf_type_t values[] = { |
static const gig::vcf_type_t values[] = { |
663 |
gig::vcf_type_lowpass, |
gig::vcf_type_lowpass, |
664 |
gig::vcf_type_lowpassturbo, |
gig::vcf_type_lowpassturbo, |
670 |
} |
} |
671 |
addProp(eVCFType); |
addProp(eVCFType); |
672 |
{ |
{ |
673 |
const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2", |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
674 |
"breath", "foot", "sustainpedal", "softpedal", |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
675 |
"genpurpose7", "genpurpose8", "aftertouch", 0 }; |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
676 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
static const gig::vcf_cutoff_ctrl_t values[] = { |
677 |
gig::vcf_cutoff_ctrl_none, |
gig::vcf_cutoff_ctrl_none, |
678 |
gig::vcf_cutoff_ctrl_none2, |
gig::vcf_cutoff_ctrl_none2, |
692 |
addProp(eVCFCutoffController); |
addProp(eVCFCutoffController); |
693 |
addProp(eVCFCutoffControllerInvert); |
addProp(eVCFCutoffControllerInvert); |
694 |
addProp(eVCFCutoff); |
addProp(eVCFCutoff); |
695 |
const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 }; |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
696 |
static const gig::curve_type_t curve_type_values[] = { |
static const gig::curve_type_t curve_type_values[] = { |
697 |
gig::curve_type_nonlinear, |
gig::curve_type_nonlinear, |
698 |
gig::curve_type_linear, |
gig::curve_type_linear, |
702 |
addProp(eVCFVelocityCurve); |
addProp(eVCFVelocityCurve); |
703 |
addProp(eVCFVelocityScale); |
addProp(eVCFVelocityScale); |
704 |
addProp(eVCFVelocityDynamicRange); |
addProp(eVCFVelocityDynamicRange); |
705 |
|
|
706 |
|
eVCFCutoffController.signal_value_changed().connect( |
707 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
708 |
|
eVCFVelocityCurve.signal_value_changed().connect( |
709 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
710 |
|
eVCFVelocityScale.signal_value_changed().connect( |
711 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
712 |
|
eVCFVelocityDynamicRange.signal_value_changed().connect( |
713 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
714 |
|
|
715 |
|
frame = new Gtk::Frame; |
716 |
|
frame->add(cutoff_curve); |
717 |
|
#if USE_GTKMM_GRID |
718 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
719 |
|
#else |
720 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
721 |
|
Gtk::SHRINK, Gtk::SHRINK); |
722 |
|
#endif |
723 |
|
rowno++; |
724 |
|
|
725 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
726 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
727 |
{ |
{ |
728 |
const char* choices[] = { "none", "genpurpose3", "genpurpose4", |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
729 |
"genpurpose5", "genpurpose6", 0 }; |
_("genpurpose5"), _("genpurpose6"), 0 }; |
730 |
static const gig::vcf_res_ctrl_t values[] = { |
static const gig::vcf_res_ctrl_t values[] = { |
731 |
gig::vcf_res_ctrl_none, |
gig::vcf_res_ctrl_none, |
732 |
gig::vcf_res_ctrl_genpurpose3, |
gig::vcf_res_ctrl_genpurpose3, |
742 |
|
|
743 |
nextPage(); |
nextPage(); |
744 |
|
|
745 |
addHeader(_("Filter Cutoff Envelope (EG2)")); |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
746 |
addProp(eEG2PreAttack); |
addProp(eEG2PreAttack); |
747 |
addProp(eEG2Attack); |
addProp(eEG2Attack); |
748 |
addProp(eEG2Decay1); |
addProp(eEG2Decay1); |
755 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
756 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
757 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
758 |
addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
addLine(eEG2StateOptions); |
759 |
|
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
760 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
761 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
762 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
763 |
{ |
{ |
764 |
const char* choices[] = { "internal", "modwheel", "foot", |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
765 |
"internal+modwheel", "internal+foot", 0 }; |
_("internal+modwheel"), _("internal+foot"), 0 }; |
766 |
static const gig::lfo2_ctrl_t values[] = { |
static const gig::lfo2_ctrl_t values[] = { |
767 |
gig::lfo2_ctrl_internal, |
gig::lfo2_ctrl_internal, |
768 |
gig::lfo2_ctrl_modwheel, |
gig::lfo2_ctrl_modwheel, |
789 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
790 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
791 |
{ |
{ |
792 |
const char* choices[] = { "internal", "modwheel", "aftertouch", |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
793 |
"internal+modwheel", "internal+aftertouch", 0 }; |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
794 |
static const gig::lfo3_ctrl_t values[] = { |
static const gig::lfo3_ctrl_t values[] = { |
795 |
gig::lfo3_ctrl_internal, |
gig::lfo3_ctrl_internal, |
796 |
gig::lfo3_ctrl_modwheel, |
gig::lfo3_ctrl_modwheel, |
805 |
|
|
806 |
nextPage(); |
nextPage(); |
807 |
|
|
808 |
|
addHeader(_("Velocity Response")); |
809 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
810 |
addProp(eVelocityResponseCurve); |
addProp(eVelocityResponseCurve); |
811 |
addProp(eVelocityResponseDepth); |
addProp(eVelocityResponseDepth); |
812 |
addProp(eVelocityResponseCurveScaling); |
addProp(eVelocityResponseCurveScaling); |
813 |
|
|
814 |
|
eVelocityResponseCurve.signal_value_changed().connect( |
815 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
816 |
|
eVelocityResponseDepth.signal_value_changed().connect( |
817 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
818 |
|
eVelocityResponseCurveScaling.signal_value_changed().connect( |
819 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
820 |
|
|
821 |
|
frame = new Gtk::Frame; |
822 |
|
frame->add(velocity_curve); |
823 |
|
#if USE_GTKMM_GRID |
824 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
825 |
|
#else |
826 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
827 |
|
Gtk::SHRINK, Gtk::SHRINK); |
828 |
|
#endif |
829 |
|
rowno++; |
830 |
|
|
831 |
|
addHeader(_("Release Velocity Response")); |
832 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
833 |
curve_type_values); |
curve_type_values); |
834 |
addProp(eReleaseVelocityResponseCurve); |
addProp(eReleaseVelocityResponseCurve); |
835 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
836 |
|
|
837 |
|
eReleaseVelocityResponseCurve.signal_value_changed().connect( |
838 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
839 |
|
eReleaseVelocityResponseDepth.signal_value_changed().connect( |
840 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
841 |
|
frame = new Gtk::Frame; |
842 |
|
frame->add(release_curve); |
843 |
|
#if USE_GTKMM_GRID |
844 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
845 |
|
#else |
846 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
847 |
|
Gtk::SHRINK, Gtk::SHRINK); |
848 |
|
#endif |
849 |
|
rowno++; |
850 |
|
|
851 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
852 |
{ |
{ |
853 |
const char* choices[] = { "none", "effect4depth", "effect5depth", 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
854 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
855 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
856 |
gig::dim_bypass_ctrl_94, |
gig::dim_bypass_ctrl_94, |
859 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
860 |
} |
} |
861 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
862 |
|
eSelfMask.widget.set_tooltip_text(_( |
863 |
|
"If enabled: new notes with higher velocity value will stop older " |
864 |
|
"notes with lower velocity values, that way you can save voices that " |
865 |
|
"would barely be audible. This is also useful for certain drum sounds." |
866 |
|
)); |
867 |
addProp(eSelfMask); |
addProp(eSelfMask); |
868 |
|
eSustainDefeat.widget.set_tooltip_text(_( |
869 |
|
"If enabled: sustain pedal will not hold a note. This way you can use " |
870 |
|
"the sustain pedal for other purposes, for example to switch among " |
871 |
|
"dimension regions." |
872 |
|
)); |
873 |
addProp(eSustainDefeat); |
addProp(eSustainDefeat); |
874 |
|
eMSDecode.widget.set_tooltip_text(_( |
875 |
|
"Defines if Mid/Side Recordings should be decoded. Mid/Side Recordings " |
876 |
|
"are an alternative way to record sounds in stereo. The sampler needs " |
877 |
|
"to decode such samples to actually make use of them. Note: this " |
878 |
|
"feature is currently not supported by LinuxSampler." |
879 |
|
)); |
880 |
addProp(eMSDecode); |
addProp(eMSDecode); |
881 |
|
|
882 |
nextPage(); |
nextPage(); |
923 |
eSampleLoopInfinite.signal_value_changed().connect( |
eSampleLoopInfinite.signal_value_changed().connect( |
924 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
925 |
|
|
926 |
append_page(*table[0], "Sample"); |
append_page(*table[0], _("Sample")); |
927 |
append_page(*table[1], "Amplitude (1)"); |
append_page(*table[1], _("Amplitude (1)")); |
928 |
append_page(*table[2], "Amplitude (2)"); |
append_page(*table[2], _("Amplitude (2)")); |
929 |
append_page(*table[3], "Filter (1)"); |
append_page(*table[3], _("Filter (1)")); |
930 |
append_page(*table[4], "Filter (2)"); |
append_page(*table[4], _("Filter (2)")); |
931 |
append_page(*table[5], "Pitch"); |
append_page(*table[5], _("Pitch")); |
932 |
append_page(*table[6], "Misc"); |
append_page(*table[6], _("Misc")); |
933 |
} |
} |
934 |
|
|
935 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
940 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
941 |
{ |
{ |
942 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
943 |
label->set_alignment(Gtk::ALIGN_LEFT); |
#if HAS_GTKMM_ALIGNMENT |
944 |
|
label->set_alignment(Gtk::ALIGN_START); |
945 |
|
#else |
946 |
|
label->set_halign(Gtk::Align::START); |
947 |
|
#endif |
948 |
|
|
949 |
|
#if USE_GTKMM_GRID |
950 |
|
table[pageno]->attach(*label, 1, rowno); |
951 |
|
#else |
952 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
953 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
954 |
|
#endif |
955 |
|
|
956 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
957 |
|
|
958 |
|
#if USE_GTKMM_GRID |
959 |
|
table[pageno]->attach(*widget, 2, rowno); |
960 |
|
#else |
961 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
962 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
963 |
|
#endif |
964 |
|
|
965 |
rowno++; |
rowno++; |
966 |
} |
} |
967 |
|
|
968 |
void DimRegionEdit::addHeader(const char* text) |
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
969 |
|
Gtk::Entry*& widget, Gtk::Button*& button) |
970 |
|
{ |
971 |
|
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
972 |
|
#if HAS_GTKMM_ALIGNMENT |
973 |
|
label->set_alignment(Gtk::ALIGN_START); |
974 |
|
#else |
975 |
|
label->set_halign(Gtk::Align::START); |
976 |
|
#endif |
977 |
|
|
978 |
|
#if USE_GTKMM_GRID |
979 |
|
table[pageno]->attach(*label, 1, rowno); |
980 |
|
#else |
981 |
|
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
982 |
|
Gtk::FILL, Gtk::SHRINK); |
983 |
|
#endif |
984 |
|
|
985 |
|
widget = new Gtk::Entry(); |
986 |
|
button = new Gtk::Button(); |
987 |
|
|
988 |
|
HBox* hbox = new HBox; |
989 |
|
hbox->pack_start(*widget); |
990 |
|
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
991 |
|
|
992 |
|
#if USE_GTKMM_GRID |
993 |
|
table[pageno]->attach(*hbox, 2, rowno); |
994 |
|
#else |
995 |
|
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
996 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
997 |
|
#endif |
998 |
|
|
999 |
|
rowno++; |
1000 |
|
} |
1001 |
|
|
1002 |
|
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
1003 |
{ |
{ |
1004 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1005 |
{ |
{ |
1006 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1007 |
|
#if USE_GTKMM_GRID |
1008 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1009 |
|
#else |
1010 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1011 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1012 |
|
#endif |
1013 |
} |
} |
1014 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1015 |
str += text; |
str += text; |
1016 |
str += "</b>"; |
str += "</b>"; |
1017 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1018 |
label->set_use_markup(); |
label->set_use_markup(); |
1019 |
label->set_alignment(Gtk::ALIGN_LEFT); |
#if HAS_GTKMM_ALIGNMENT |
1020 |
|
label->set_alignment(Gtk::ALIGN_START); |
1021 |
|
#else |
1022 |
|
label->set_halign(Gtk::Align::START); |
1023 |
|
#endif |
1024 |
|
#if USE_GTKMM_GRID |
1025 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1026 |
|
#else |
1027 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1028 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1029 |
|
#endif |
1030 |
rowno++; |
rowno++; |
1031 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1032 |
|
return label; |
1033 |
} |
} |
1034 |
|
|
1035 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
1037 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1038 |
{ |
{ |
1039 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1040 |
|
#if USE_GTKMM_GRID |
1041 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1042 |
|
#else |
1043 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1044 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1045 |
|
#endif |
1046 |
} |
} |
1047 |
pageno++; |
pageno++; |
1048 |
rowno = 0; |
rowno = 0; |
1051 |
|
|
1052 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1053 |
{ |
{ |
1054 |
|
#if USE_GTKMM_GRID |
1055 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1056 |
|
#else |
1057 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1058 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1059 |
|
#endif |
1060 |
rowno++; |
rowno++; |
1061 |
} |
} |
1062 |
|
|
1063 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1064 |
{ |
{ |
1065 |
|
#if USE_GTKMM_GRID |
1066 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1067 |
|
#else |
1068 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1069 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1070 |
|
#endif |
1071 |
rowno++; |
rowno++; |
1072 |
} |
} |
1073 |
|
|
1074 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1075 |
{ |
{ |
1076 |
|
#if USE_GTKMM_GRID |
1077 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1078 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1079 |
|
#else |
1080 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1081 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1082 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1083 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1084 |
|
#endif |
1085 |
rowno++; |
rowno++; |
1086 |
} |
} |
1087 |
|
|
1088 |
|
void DimRegionEdit::addLine(HBox& line) |
1089 |
|
{ |
1090 |
|
#if USE_GTKMM_GRID |
1091 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1092 |
|
#else |
1093 |
|
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1094 |
|
Gtk::FILL, Gtk::SHRINK); |
1095 |
|
#endif |
1096 |
|
rowno++; |
1097 |
|
} |
1098 |
|
|
1099 |
|
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1100 |
|
{ |
1101 |
|
#if USE_GTKMM_GRID |
1102 |
|
table[pageno]->attach(widget, 2, rowno); |
1103 |
|
#else |
1104 |
|
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1105 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1106 |
|
#endif |
1107 |
|
rowno++; |
1108 |
|
} |
1109 |
|
|
1110 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
1111 |
{ |
{ |
1112 |
dimregion = d; |
dimregion = d; |
1113 |
|
velocity_curve.set_dim_region(d); |
1114 |
|
release_curve.set_dim_region(d); |
1115 |
|
cutoff_curve.set_dim_region(d); |
1116 |
|
crossfade_curve.set_dim_region(d); |
1117 |
|
|
1118 |
set_sensitive(d); |
set_sensitive(d); |
1119 |
if (!d) return; |
if (!d) return; |
1132 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1133 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1134 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1135 |
|
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1136 |
|
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1137 |
|
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1138 |
|
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1139 |
|
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1140 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1141 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1142 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1155 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1156 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1157 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1158 |
|
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1159 |
|
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1160 |
|
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1161 |
|
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1162 |
|
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1163 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1164 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1165 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1208 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1209 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1210 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1211 |
|
// show sample group name |
1212 |
|
{ |
1213 |
|
Glib::ustring s = "---"; |
1214 |
|
if (d->pSample && d->pSample->GetGroup()) |
1215 |
|
s = d->pSample->GetGroup()->Name; |
1216 |
|
eSampleGroup.text.set_text(s); |
1217 |
|
} |
1218 |
|
// assemble sample format info string |
1219 |
|
{ |
1220 |
|
Glib::ustring s; |
1221 |
|
if (d->pSample) { |
1222 |
|
switch (d->pSample->Channels) { |
1223 |
|
case 1: s = _("Mono"); break; |
1224 |
|
case 2: s = _("Stereo"); break; |
1225 |
|
default: |
1226 |
|
s = ToString(d->pSample->Channels) + _(" audio channels"); |
1227 |
|
break; |
1228 |
|
} |
1229 |
|
s += " " + ToString(d->pSample->BitDepth) + " Bits"; |
1230 |
|
s += " " + ToString(d->pSample->SamplesPerSecond/1000) + "." |
1231 |
|
+ ToString((d->pSample->SamplesPerSecond%1000)/100) + " kHz"; |
1232 |
|
} else { |
1233 |
|
s = _("No sample assigned to this dimension region."); |
1234 |
|
} |
1235 |
|
eSampleFormatInfo.text.set_text(s); |
1236 |
|
} |
1237 |
|
// generate sample's memory address pointer string |
1238 |
|
{ |
1239 |
|
Glib::ustring s; |
1240 |
|
if (d->pSample) { |
1241 |
|
char buf[64] = {}; |
1242 |
|
snprintf(buf, sizeof(buf), "%p", d->pSample); |
1243 |
|
s = buf; |
1244 |
|
} else { |
1245 |
|
s = "---"; |
1246 |
|
} |
1247 |
|
eSampleID.text.set_text(s); |
1248 |
|
} |
1249 |
|
// generate raw wave form data CRC-32 checksum string |
1250 |
|
{ |
1251 |
|
Glib::ustring s = "---"; |
1252 |
|
if (d->pSample) { |
1253 |
|
char buf[64] = {}; |
1254 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1255 |
|
s = buf; |
1256 |
|
} |
1257 |
|
eChecksum.text.set_text(s); |
1258 |
|
} |
1259 |
|
buttonSelectSample.set_sensitive(d && d->pSample); |
1260 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1261 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1262 |
eGainPlus6.set_value(d->Gain); |
eGainPlus6.set_value(d->Gain); |
1273 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
d->pSample ? d->pSample->LoopPlayCount : 0); |
1274 |
update_model--; |
update_model--; |
1275 |
|
|
1276 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL"); |
wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) : |
1277 |
|
_("NULL")); |
1278 |
|
|
1279 |
update_loop_elements(); |
update_loop_elements(); |
1280 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
1289 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
1290 |
eVCFVelocityScale.set_sensitive(sensitive); |
eVCFVelocityScale.set_sensitive(sensitive); |
1291 |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
1292 |
|
cutoff_curve.set_sensitive(sensitive); |
1293 |
eVCFResonance.set_sensitive(sensitive); |
eVCFResonance.set_sensitive(sensitive); |
1294 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
1295 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
1296 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
1297 |
|
lEG2->set_sensitive(sensitive); |
1298 |
eEG2PreAttack.set_sensitive(sensitive); |
eEG2PreAttack.set_sensitive(sensitive); |
1299 |
eEG2Attack.set_sensitive(sensitive); |
eEG2Attack.set_sensitive(sensitive); |
1300 |
eEG2Decay1.set_sensitive(sensitive); |
eEG2Decay1.set_sensitive(sensitive); |
1305 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1306 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1307 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1308 |
|
eEG2StateOptions.set_sensitive(sensitive); |
1309 |
|
lLFO2->set_sensitive(sensitive); |
1310 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
1311 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
1312 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
1339 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
1340 |
eVCFCutoff.set_sensitive(!hasController); |
eVCFCutoff.set_sensitive(!hasController); |
1341 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
eVCFResonanceDynamic.set_sensitive(!hasController); |
1342 |
eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" : |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
1343 |
"Velocity scale:"); |
_("Velocity scale:")); |
1344 |
} |
} |
1345 |
|
|
1346 |
void DimRegionEdit::VCFResonanceController_changed() |
void DimRegionEdit::VCFResonanceController_changed() |
1383 |
eCrossfade_in_end.set_sensitive(hasController); |
eCrossfade_in_end.set_sensitive(hasController); |
1384 |
eCrossfade_out_start.set_sensitive(hasController); |
eCrossfade_out_start.set_sensitive(hasController); |
1385 |
eCrossfade_out_end.set_sensitive(hasController); |
eCrossfade_out_end.set_sensitive(hasController); |
1386 |
|
crossfade_curve.set_sensitive(hasController); |
1387 |
} |
} |
1388 |
|
|
1389 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
1497 |
update_model--; |
update_model--; |
1498 |
} |
} |
1499 |
|
|
1500 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1501 |
|
{ |
1502 |
|
bool result = false; |
1503 |
|
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1504 |
|
itDimReg != dimregs.end(); ++itDimReg) |
1505 |
|
{ |
1506 |
|
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1507 |
|
} |
1508 |
|
return result; |
1509 |
|
} |
1510 |
|
|
1511 |
|
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1512 |
{ |
{ |
1513 |
if (dimregion) { |
if (dimreg) { |
1514 |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
1515 |
|
|
1516 |
// 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() |
1517 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1518 |
|
|
1519 |
gig::Sample* oldref = dimregion->pSample; |
// make sure stereo samples always are the same in both |
1520 |
dimregion->pSample = sample; |
// dimregs in the samplechannel dimension |
1521 |
|
int nbDimregs = 1; |
1522 |
|
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1523 |
|
if (sample->Channels == 2) { |
1524 |
|
gig::Region* region = dimreg->GetParent(); |
1525 |
|
|
1526 |
|
int bitcount = 0; |
1527 |
|
int stereo_bit = 0; |
1528 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1529 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1530 |
|
stereo_bit = 1 << bitcount; |
1531 |
|
break; |
1532 |
|
} |
1533 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1534 |
|
} |
1535 |
|
|
1536 |
// copy sample information from Sample to DimensionRegion |
if (stereo_bit) { |
1537 |
|
int dimregno; |
1538 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1539 |
|
if (region->pDimensionRegions[dimregno] == dimreg) { |
1540 |
|
break; |
1541 |
|
} |
1542 |
|
} |
1543 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1544 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1545 |
|
nbDimregs = 2; |
1546 |
|
} |
1547 |
|
} |
1548 |
|
|
1549 |
dimregion->UnityNote = sample->MIDIUnityNote; |
gig::Sample* oldref = dimreg->pSample; |
|
dimregion->FineTune = sample->FineTune; |
|
1550 |
|
|
1551 |
int loops = sample->Loops ? 1 : 0; |
for (int i = 0 ; i < nbDimregs ; i++) { |
1552 |
while (dimregion->SampleLoops > loops) { |
d[i]->pSample = sample; |
1553 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
|
1554 |
} |
// copy sample information from Sample to DimensionRegion |
1555 |
while (dimregion->SampleLoops < sample->Loops) { |
if (copy_sample_unity) |
1556 |
DLS::sample_loop_t loop; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1557 |
dimregion->AddSampleLoop(&loop); |
if (copy_sample_tune) |
1558 |
} |
d[i]->FineTune = sample->FineTune; |
1559 |
if (loops) { |
if (copy_sample_loop) { |
1560 |
dimregion->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
int loops = sample->Loops ? 1 : 0; |
1561 |
dimregion->pSampleLoops[0].LoopType = sample->LoopType; |
while (d[i]->SampleLoops > loops) { |
1562 |
dimregion->pSampleLoops[0].LoopStart = sample->LoopStart; |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1563 |
dimregion->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
} |
1564 |
|
while (d[i]->SampleLoops < sample->Loops) { |
1565 |
|
DLS::sample_loop_t loop; |
1566 |
|
d[i]->AddSampleLoop(&loop); |
1567 |
|
} |
1568 |
|
if (loops) { |
1569 |
|
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1570 |
|
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1571 |
|
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1572 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1573 |
|
} |
1574 |
|
} |
1575 |
} |
} |
1576 |
|
|
1577 |
// update ui |
// update ui |
1578 |
update_model++; |
update_model++; |
1579 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1580 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1581 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1582 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1583 |
update_loop_elements(); |
update_loop_elements(); |
1584 |
update_model--; |
update_model--; |
1585 |
|
|
1586 |
sample_ref_changed_signal.emit(oldref, sample); |
sample_ref_changed_signal.emit(oldref, sample); |
|
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
|
|
//dimreg_changed_signal.emit(dimregion); |
|
1587 |
return true; |
return true; |
1588 |
} |
} |
1589 |
return false; |
return false; |
1652 |
if (value) { |
if (value) { |
1653 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1654 |
if (!d->SampleLoops) { |
if (!d->SampleLoops) { |
1655 |
|
DimRegionChangeGuard(this, d); |
1656 |
|
|
1657 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1658 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1659 |
// loop the whole sample by default |
// loop the whole sample by default |
1660 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1661 |
loop.LoopLength = |
loop.LoopLength = |
1662 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
|
dimreg_to_be_changed_signal.emit(d); |
|
1663 |
d->AddSampleLoop(&loop); |
d->AddSampleLoop(&loop); |
|
dimreg_changed_signal.emit(d); |
|
1664 |
} |
} |
1665 |
} else { |
} else { |
1666 |
if (d->SampleLoops) { |
if (d->SampleLoops) { |
1667 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, d); |
1668 |
|
|
1669 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1670 |
while (d->SampleLoops) { |
while (d->SampleLoops) { |
1671 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1672 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1673 |
} |
} |
1674 |
} |
} |
1675 |
} |
} |
1713 |
{ |
{ |
1714 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d->pSample) d->pSample->LoopPlayCount = value; |
1715 |
} |
} |
1716 |
|
|
1717 |
|
void DimRegionEdit::nullOutSampleReference() { |
1718 |
|
if (!dimregion) return; |
1719 |
|
gig::Sample* oldref = dimregion->pSample; |
1720 |
|
if (!oldref) return; |
1721 |
|
|
1722 |
|
DimRegionChangeGuard(this, dimregion); |
1723 |
|
|
1724 |
|
// in case currently assigned sample is a stereo one, then remove both |
1725 |
|
// references (expected to be due to a "stereo dimension") |
1726 |
|
gig::DimensionRegion* d[2] = { dimregion, NULL }; |
1727 |
|
if (oldref->Channels == 2) { |
1728 |
|
gig::Region* region = dimregion->GetParent(); |
1729 |
|
{ |
1730 |
|
int stereo_bit = 0; |
1731 |
|
int bitcount = 0; |
1732 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1733 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1734 |
|
stereo_bit = 1 << bitcount; |
1735 |
|
break; |
1736 |
|
} |
1737 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1738 |
|
} |
1739 |
|
|
1740 |
|
if (stereo_bit) { |
1741 |
|
int dimregno; |
1742 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1743 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
1744 |
|
break; |
1745 |
|
} |
1746 |
|
} |
1747 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1748 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1749 |
|
} |
1750 |
|
} |
1751 |
|
} |
1752 |
|
|
1753 |
|
if (d[0]) d[0]->pSample = NULL; |
1754 |
|
if (d[1]) d[1]->pSample = NULL; |
1755 |
|
|
1756 |
|
// update UI elements |
1757 |
|
set_dim_region(dimregion); |
1758 |
|
|
1759 |
|
sample_ref_changed_signal.emit(oldref, NULL); |
1760 |
|
} |
1761 |
|
|
1762 |
|
void DimRegionEdit::onButtonSelectSamplePressed() { |
1763 |
|
if (!dimregion) return; |
1764 |
|
if (!dimregion->pSample) return; |
1765 |
|
select_sample_signal.emit(dimregion->pSample); |
1766 |
|
} |
1767 |
|
|
1768 |
|
sigc::signal<void, gig::Sample*>& DimRegionEdit::signal_select_sample() { |
1769 |
|
return select_sample_signal; |
1770 |
|
} |