1 |
/* |
/* |
2 |
* Copyright (C) 2006-2015 Andreas Persson |
* Copyright (C) 2006-2019 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 |
|
|
|
#include "global.h" |
|
23 |
#include "compat.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 |
|
#include "Settings.h" |
32 |
|
|
33 |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
34 |
getter(getter), dimreg(0) { |
getter(getter), dimreg(0) { |
35 |
set_size_request(80, 80); |
set_size_request(80, 80); |
39 |
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
40 |
const Cairo::RefPtr<Cairo::Context>& cr = |
const Cairo::RefPtr<Cairo::Context>& cr = |
41 |
get_window()->create_cairo_context(); |
get_window()->create_cairo_context(); |
|
#if 0 |
|
|
} |
|
|
#endif |
|
42 |
#else |
#else |
43 |
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
44 |
#endif |
#endif |
74 |
|
|
75 |
|
|
76 |
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
77 |
set_size_request(280, 80); |
set_size_request(500, 100); |
78 |
} |
} |
79 |
|
|
80 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
81 |
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
82 |
const Cairo::RefPtr<Cairo::Context>& cr = |
const Cairo::RefPtr<Cairo::Context>& cr = |
83 |
get_window()->create_cairo_context(); |
get_window()->create_cairo_context(); |
|
#if 0 |
|
|
} |
|
|
#endif |
|
84 |
#else |
#else |
85 |
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
86 |
#endif |
#endif |
149 |
} |
} |
150 |
|
|
151 |
|
|
152 |
|
LFOGraph::LFOGraph() : dimreg(0) { |
153 |
|
set_size_request(500, 100); |
154 |
|
} |
155 |
|
|
156 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
157 |
|
bool LFOGraph::on_expose_event(GdkEventExpose* e) { |
158 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
159 |
|
get_window()->create_cairo_context(); |
160 |
|
#else |
161 |
|
bool LFOGraph::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
162 |
|
#endif |
163 |
|
if (dimreg) { |
164 |
|
const int w = get_width(); |
165 |
|
const int h = get_height(); |
166 |
|
const bool sensitive = is_sensitive(); |
167 |
|
const bool signedRange = this->signedRange(); |
168 |
|
const float visiblePeriods = 5.f; // such that minimum LFO frequency 0.1 Hz draws exactly a half period |
169 |
|
|
170 |
|
// short-hand functions for setting colors |
171 |
|
auto setGrayColor = [&] { |
172 |
|
cr->set_source_rgba(0.88, 0.88, 0.88, sensitive ? 1.0 : 0.3); |
173 |
|
}; |
174 |
|
auto setBlackColor = [&] { |
175 |
|
cr->set_source_rgba(0, 0, 0, sensitive ? 1.0 : 0.3); |
176 |
|
}; |
177 |
|
auto setGreenColor = [&] { |
178 |
|
cr->set_source_rgba(94/255.f, 219/255.f, 80/255.f, sensitive ? 1.0 : 0.3); |
179 |
|
}; |
180 |
|
auto setRedColor = [&] { |
181 |
|
cr->set_source_rgba(255.f, 44/255.f, 44/255.f, sensitive ? 1.0 : 0.3); |
182 |
|
}; |
183 |
|
/*auto setBlueColor = [&] { |
184 |
|
cr->set_source_rgba(53/255.f, 167/255.f, 255.f, sensitive ? 1.0 : 0.3); |
185 |
|
};*/ |
186 |
|
auto setOrangeColor = [&] { |
187 |
|
cr->set_source_rgba(255.f, 177/255.f, 82/255.f, sensitive ? 1.0 : 0.3); |
188 |
|
}; |
189 |
|
auto setWhiteColor = [&] { |
190 |
|
cr->set_source_rgba(255.f, 255.f, 255.f, sensitive ? 1.0 : 0.3); |
191 |
|
}; |
192 |
|
|
193 |
|
// fill background white |
194 |
|
cr->rectangle(0, 0, w, h); |
195 |
|
setWhiteColor(); |
196 |
|
cr->fill(); |
197 |
|
|
198 |
|
// draw horizontal center line (dashed gray) if LFO range is signed |
199 |
|
if (signedRange) { |
200 |
|
cr->move_to(0, h/2); |
201 |
|
cr->line_to(w, h/2); |
202 |
|
cr->set_line_width(2); |
203 |
|
setGrayColor(); |
204 |
|
cr->set_dash(std::vector<double>{ 7, 5 }, 0 /*offset*/); |
205 |
|
cr->stroke(); |
206 |
|
} |
207 |
|
|
208 |
|
// draw a vertical line for each second |
209 |
|
for (int period = 1; period < visiblePeriods; ++period) { |
210 |
|
int x = float(w) / float(visiblePeriods) * period; |
211 |
|
cr->move_to(x, 0); |
212 |
|
cr->line_to(x, h); |
213 |
|
cr->set_line_width(2); |
214 |
|
setGrayColor(); |
215 |
|
cr->set_dash(std::vector<double>{ 5, 3 }, 0 /*offset*/); |
216 |
|
cr->stroke(); |
217 |
|
} |
218 |
|
|
219 |
|
// how many curves shall we draw, two or one? |
220 |
|
const int runs = (hasControllerAssigned()) ? 2 : 1; |
221 |
|
// only draw the two curves in dashed style if they're very close to each other |
222 |
|
const bool dashedCurves = (runs == 2 && controllerDepth() < 63); |
223 |
|
// draw the required amount of curves |
224 |
|
for (int run = 0; run < runs; ++run) { |
225 |
|
// setup the LFO generator with the relevant parameters |
226 |
|
lfo.setup({ |
227 |
|
.waveType = waveType(), |
228 |
|
.rangeType = (signedRange) ? LinuxSampler::LFO::range_signed : LinuxSampler::LFO::range_unsigned, |
229 |
|
.frequency = frequency(), |
230 |
|
.phase = phase(), |
231 |
|
.startLevel = startLevel(), |
232 |
|
.internalDepth = internalDepth(), |
233 |
|
.midiControllerDepth = controllerDepth(), |
234 |
|
.flipPolarity = flipPolarity(), |
235 |
|
.samplerate = w / visiblePeriods, |
236 |
|
.maxValue = (signedRange) ? h/2 : h, |
237 |
|
}); |
238 |
|
// 1st curve reflects min. CC value, 2nd curve max. CC value |
239 |
|
lfo.setMIDICtrlValue( (run == 0) ? 0 : 127 ); |
240 |
|
|
241 |
|
// the actual render/draw loop |
242 |
|
for (int x = 0; x < w ; ++x) { |
243 |
|
const float y = |
244 |
|
(signedRange) ? |
245 |
|
h/2 - lfo.render() : |
246 |
|
h - lfo.render(); |
247 |
|
if (x == 0) |
248 |
|
cr->move_to(x, y); |
249 |
|
else |
250 |
|
cr->line_to(x, y); |
251 |
|
} |
252 |
|
cr->set_line_width( (frequency() <= 4.f) ? 2 : 1 ); |
253 |
|
if (runs == 1) |
254 |
|
setOrangeColor(); |
255 |
|
else if (run == 0) |
256 |
|
setGreenColor(); |
257 |
|
else |
258 |
|
setRedColor(); |
259 |
|
if (dashedCurves) |
260 |
|
cr->set_dash(std::vector<double>{ 3, 3 }, (run == 0) ? 0 : 3 /*offset*/); |
261 |
|
else |
262 |
|
cr->set_dash(std::vector<double>(), 0 /*offset*/); |
263 |
|
cr->stroke(); |
264 |
|
} |
265 |
|
|
266 |
|
// draw text legend |
267 |
|
if (runs == 2) { |
268 |
|
setRedColor(); |
269 |
|
cr->move_to(2, 10); |
270 |
|
cr->show_text("CC Max."); |
271 |
|
|
272 |
|
setGreenColor(); |
273 |
|
cr->move_to(2, 23); |
274 |
|
cr->show_text("CC Min."); |
275 |
|
} else { // no controller assigned, internal depth only ... |
276 |
|
setOrangeColor(); |
277 |
|
cr->move_to(2, 10); |
278 |
|
cr->show_text("Const. Depth"); |
279 |
|
} |
280 |
|
// draw text legend for each second ("1s", "2s", ...) |
281 |
|
for (int period = 1; period < visiblePeriods; ++period) { |
282 |
|
int x = float(w) / float(visiblePeriods) * period; |
283 |
|
setBlackColor(); |
284 |
|
cr->move_to(x - 13, h - 3); |
285 |
|
cr->show_text(ToString(period) + "s"); |
286 |
|
} |
287 |
|
} |
288 |
|
return true; |
289 |
|
} |
290 |
|
|
291 |
|
|
292 |
|
EGStateOptions::EGStateOptions() : HBox(), |
293 |
|
label(_("May be cancelled: ")), |
294 |
|
checkBoxAttack(_("Attack")), |
295 |
|
checkBoxAttackHold(_("Attack Hold")), |
296 |
|
checkBoxDecay1(_("Decay 1")), |
297 |
|
checkBoxDecay2(_("Decay 2")), |
298 |
|
checkBoxRelease(_("Release")) |
299 |
|
{ |
300 |
|
set_spacing(6); |
301 |
|
|
302 |
|
pack_start(label); |
303 |
|
pack_start(checkBoxAttack, Gtk::PACK_SHRINK); |
304 |
|
pack_start(checkBoxAttackHold, Gtk::PACK_SHRINK); |
305 |
|
pack_start(checkBoxDecay1, Gtk::PACK_SHRINK); |
306 |
|
pack_start(checkBoxDecay2, Gtk::PACK_SHRINK); |
307 |
|
pack_start(checkBoxRelease, Gtk::PACK_SHRINK); |
308 |
|
|
309 |
|
checkBoxAttack.set_tooltip_text(_( |
310 |
|
"If checked: a note-off aborts the 'attack' stage." |
311 |
|
)); |
312 |
|
checkBoxAttackHold.set_tooltip_text(_( |
313 |
|
"If checked: a note-off aborts the 'attack hold' stage." |
314 |
|
)); |
315 |
|
checkBoxDecay1.set_tooltip_text(_( |
316 |
|
"If checked: a note-off aborts the 'decay 1' stage." |
317 |
|
)); |
318 |
|
checkBoxDecay2.set_tooltip_text(_( |
319 |
|
"If checked: a note-off aborts the 'decay 2' stage." |
320 |
|
)); |
321 |
|
checkBoxRelease.set_tooltip_text(_( |
322 |
|
"If checked: a note-on reverts back from the 'release' stage." |
323 |
|
)); |
324 |
|
} |
325 |
|
|
326 |
|
void EGStateOptions::on_show_tooltips_changed() { |
327 |
|
const bool b = Settings::singleton()->showTooltips; |
328 |
|
|
329 |
|
checkBoxAttack.set_has_tooltip(b); |
330 |
|
checkBoxAttackHold.set_has_tooltip(b); |
331 |
|
checkBoxDecay1.set_has_tooltip(b); |
332 |
|
checkBoxDecay2.set_has_tooltip(b); |
333 |
|
checkBoxRelease.set_has_tooltip(b); |
334 |
|
} |
335 |
|
|
336 |
|
|
337 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
338 |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
339 |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
351 |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
352 |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
353 |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
354 |
|
eLFO1Wave(_("Wave Form")), |
355 |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
356 |
|
eLFO1Phase(_("Phase"), 0.0, 360.0, 2), |
357 |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
358 |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
359 |
eLFO1Controller(_("Controller")), |
eLFO1Controller(_("Controller")), |
371 |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
372 |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
373 |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
374 |
|
eLFO2Wave(_("Wave Form")), |
375 |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
376 |
|
eLFO2Phase(_("Phase"), 0.0, 360.0, 2), |
377 |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
378 |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
379 |
eLFO2Controller(_("Controller")), |
eLFO2Controller(_("Controller")), |
381 |
eLFO2Sync(_("Sync")), |
eLFO2Sync(_("Sync")), |
382 |
eEG3Attack(_("Attack"), 0, 10, 3), |
eEG3Attack(_("Attack"), 0, 10, 3), |
383 |
eEG3Depth(_("Depth"), -1200, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
384 |
|
eLFO3Wave(_("Wave Form")), |
385 |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
386 |
|
eLFO3Phase(_("Phase"), 0.0, 360.0, 2), |
387 |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
388 |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
389 |
eLFO3Controller(_("Controller")), |
eLFO3Controller(_("Controller")), |
390 |
|
eLFO3FlipPhase(_("Flip phase")), |
391 |
eLFO3Sync(_("Sync")), |
eLFO3Sync(_("Sync")), |
392 |
eVCFEnabled(_("Enabled")), |
eVCFEnabled(_("Enabled")), |
393 |
eVCFType(_("Type")), |
eVCFType(_("Type")), |
413 |
eCrossfade_out_start(_("Crossfade-out start")), |
eCrossfade_out_start(_("Crossfade-out start")), |
414 |
eCrossfade_out_end(_("Crossfade-out end")), |
eCrossfade_out_end(_("Crossfade-out end")), |
415 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
416 |
|
eSustainReleaseTrigger(_("Sustain Release Trigger")), |
417 |
|
eNoNoteOffReleaseTrigger(_("No note-off release trigger")), |
418 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
419 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
420 |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
426 |
eMSDecode(_("Decode Mid/Side Recordings")), |
eMSDecode(_("Decode Mid/Side Recordings")), |
427 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
428 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
429 |
|
eSampleGroup(_("Sample Group")), |
430 |
eSampleFormatInfo(_("Sample Format")), |
eSampleFormatInfo(_("Sample Format")), |
431 |
eSampleID("Sample ID"), |
eSampleID("Sample ID"), |
432 |
|
eChecksum("Wave Data CRC-32"), |
433 |
eFineTune(_("Fine tune"), -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
434 |
eGain(_("Gain"), -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
435 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
436 |
eSampleLoopEnabled(_("Enabled")), |
eSampleLoopEnabled(_("Enabled")), |
437 |
eSampleLoopStart(_("Loop start positon")), |
eSampleLoopStart(_("Loop start position")), |
438 |
eSampleLoopLength(_("Loop size")), |
eSampleLoopLength(_("Loop size")), |
439 |
eSampleLoopType(_("Loop type")), |
eSampleLoopType(_("Loop type")), |
440 |
eSampleLoopInfinite(_("Infinite loop")), |
eSampleLoopInfinite(_("Infinite loop")), |
441 |
eSampleLoopPlayCount(_("Playback count"), 1), |
eSampleLoopPlayCount(_("Playback count"), 1), |
442 |
|
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
443 |
update_model(0) |
update_model(0) |
444 |
{ |
{ |
445 |
|
// make synthesis parameter page tabs scrollable |
446 |
|
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
447 |
|
set_scrollable(); |
448 |
|
|
449 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
450 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
451 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
462 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
463 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
464 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
465 |
|
connect(eEG1StateOptions.checkBoxAttack, &gig::DimensionRegion::EG1Options, |
466 |
|
&gig::eg_opt_t::AttackCancel); |
467 |
|
connect(eEG1StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG1Options, |
468 |
|
&gig::eg_opt_t::AttackHoldCancel); |
469 |
|
connect(eEG1StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG1Options, |
470 |
|
&gig::eg_opt_t::Decay1Cancel); |
471 |
|
connect(eEG1StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG1Options, |
472 |
|
&gig::eg_opt_t::Decay2Cancel); |
473 |
|
connect(eEG1StateOptions.checkBoxRelease, &gig::DimensionRegion::EG1Options, |
474 |
|
&gig::eg_opt_t::ReleaseCancel); |
475 |
|
connect(eLFO1Wave, &gig::DimensionRegion::LFO1WaveForm); |
476 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
477 |
|
connect(eLFO1Phase, &gig::DimensionRegion::LFO1Phase); |
478 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
479 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
480 |
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller); |
495 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
496 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
497 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
498 |
|
connect(eEG2StateOptions.checkBoxAttack, &gig::DimensionRegion::EG2Options, |
499 |
|
&gig::eg_opt_t::AttackCancel); |
500 |
|
connect(eEG2StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG2Options, |
501 |
|
&gig::eg_opt_t::AttackHoldCancel); |
502 |
|
connect(eEG2StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG2Options, |
503 |
|
&gig::eg_opt_t::Decay1Cancel); |
504 |
|
connect(eEG2StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG2Options, |
505 |
|
&gig::eg_opt_t::Decay2Cancel); |
506 |
|
connect(eEG2StateOptions.checkBoxRelease, &gig::DimensionRegion::EG2Options, |
507 |
|
&gig::eg_opt_t::ReleaseCancel); |
508 |
|
connect(eLFO2Wave, &gig::DimensionRegion::LFO2WaveForm); |
509 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
510 |
|
connect(eLFO2Phase, &gig::DimensionRegion::LFO2Phase); |
511 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
512 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
513 |
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller); |
515 |
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync); |
516 |
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
connect(eEG3Attack, &gig::DimensionRegion::EG3Attack); |
517 |
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
connect(eEG3Depth, &gig::DimensionRegion::EG3Depth); |
518 |
|
connect(eLFO3Wave, &gig::DimensionRegion::LFO3WaveForm); |
519 |
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency); |
520 |
|
connect(eLFO3Phase, &gig::DimensionRegion::LFO3Phase); |
521 |
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth); |
522 |
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth); |
523 |
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller); |
524 |
|
connect(eLFO3FlipPhase, &gig::DimensionRegion::LFO3FlipPhase); |
525 |
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync); |
526 |
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled); |
527 |
connect(eVCFType, &gig::DimensionRegion::VCFType); |
connect(eVCFType, &gig::DimensionRegion::VCFType); |
557 |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
558 |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
559 |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
560 |
|
connect(eSustainReleaseTrigger, &gig::DimensionRegion::SustainReleaseTrigger); |
561 |
|
connect(eNoNoteOffReleaseTrigger, &gig::DimensionRegion::NoNoteOffReleaseTrigger); |
562 |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
563 |
connect(ePan, &gig::DimensionRegion::Pan); |
connect(ePan, &gig::DimensionRegion::Pan); |
564 |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
582 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
583 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
584 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
585 |
|
buttonSelectSample.signal_clicked().connect( |
586 |
|
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
587 |
|
); |
588 |
|
|
589 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 9 ; i++) { |
590 |
|
#if USE_GTKMM_GRID |
591 |
|
table[i] = new Gtk::Grid; |
592 |
|
table[i]->set_column_spacing(7); |
593 |
|
#else |
594 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
595 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
596 |
|
#endif |
597 |
|
|
598 |
|
// on Gtk 3 there is absolutely no margin by default |
599 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
600 |
|
# if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12 |
601 |
|
table[i]->set_margin_left(12); |
602 |
|
table[i]->set_margin_right(12); |
603 |
|
# else |
604 |
|
table[i]->set_margin_start(12); |
605 |
|
table[i]->set_margin_end(12); |
606 |
|
# endif |
607 |
|
#endif |
608 |
} |
} |
609 |
|
|
610 |
// set tooltips |
// set tooltips |
611 |
eUnityNote.set_tip( |
eUnityNote.set_tip( |
612 |
_("Note this sample is associated with (a.k.a. 'root note')") |
_("Note this sample is associated with (a.k.a. 'root note')") |
613 |
); |
); |
614 |
|
buttonSelectSample.set_tooltip_text( |
615 |
|
_("Selects the sample of this dimension region on the left hand side's sample tree view.") |
616 |
|
); |
617 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
618 |
ePan.set_tip(_("Stereo balance (left/right)")); |
ePan.set_tip(_("Stereo balance (left/right)")); |
619 |
eChannelOffset.set_tip( |
eChannelOffset.set_tip( |
691 |
eLFO2FlipPhase.set_tip( |
eLFO2FlipPhase.set_tip( |
692 |
"Inverts the LFO's generated wave vertically." |
"Inverts the LFO's generated wave vertically." |
693 |
); |
); |
694 |
|
eLFO3FlipPhase.set_tip( |
695 |
|
"Inverts the LFO's generated wave vertically." |
696 |
|
); |
697 |
|
|
698 |
pageno = 0; |
pageno = 0; |
699 |
rowno = 0; |
rowno = 0; |
700 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
701 |
|
|
702 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
703 |
addString(_("Sample"), lSample, wSample); |
addString(_("Sample"), lSample, wSample, buttonNullSampleReference); |
704 |
|
buttonNullSampleReference->set_label("X"); |
705 |
|
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.")); |
706 |
|
buttonNullSampleReference->signal_clicked().connect( |
707 |
|
sigc::mem_fun(*this, &DimRegionEdit::nullOutSampleReference) |
708 |
|
); |
709 |
//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); |
710 |
#ifdef OLD_TOOLTIPS |
#ifdef OLD_TOOLTIPS |
711 |
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
713 |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
714 |
#endif |
#endif |
715 |
addProp(eUnityNote); |
addProp(eUnityNote); |
716 |
|
addProp(eSampleGroup); |
717 |
addProp(eSampleFormatInfo); |
addProp(eSampleFormatInfo); |
718 |
addProp(eSampleID); |
addProp(eSampleID); |
719 |
|
addProp(eChecksum); |
720 |
|
addRightHandSide(buttonSelectSample); |
721 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
722 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
723 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
758 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
759 |
addProp(eEG1ControllerDecayInfluence); |
addProp(eEG1ControllerDecayInfluence); |
760 |
addProp(eEG1ControllerReleaseInfluence); |
addProp(eEG1ControllerReleaseInfluence); |
761 |
|
addLine(eEG1StateOptions); |
762 |
|
|
763 |
nextPage(); |
nextPage(); |
764 |
|
|
765 |
addHeader(_("Amplitude Oscillator (LFO1)")); |
addHeader(_("Amplitude Oscillator (LFO1)")); |
766 |
|
addProp(eLFO1Wave); |
767 |
addProp(eLFO1Frequency); |
addProp(eLFO1Frequency); |
768 |
|
addProp(eLFO1Phase); |
769 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
770 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
771 |
{ |
{ |
783 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
784 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
785 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
786 |
|
{ |
787 |
|
Gtk::Frame* frame = new Gtk::Frame; |
788 |
|
frame->add(lfo1Graph); |
789 |
|
// on Gtk 3 there is no margin at all by default |
790 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
791 |
|
frame->set_margin_top(12); |
792 |
|
frame->set_margin_bottom(12); |
793 |
|
#endif |
794 |
|
#if USE_GTKMM_GRID |
795 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
796 |
|
#else |
797 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
798 |
|
Gtk::SHRINK, Gtk::SHRINK); |
799 |
|
#endif |
800 |
|
rowno++; |
801 |
|
} |
802 |
|
eLFO1FlipPhase.signal_value_changed().connect( |
803 |
|
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
804 |
|
); |
805 |
|
|
806 |
|
nextPage(); |
807 |
|
|
808 |
addHeader(_("Crossfade")); |
addHeader(_("Crossfade")); |
809 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
810 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
816 |
|
|
817 |
Gtk::Frame* frame = new Gtk::Frame; |
Gtk::Frame* frame = new Gtk::Frame; |
818 |
frame->add(crossfade_curve); |
frame->add(crossfade_curve); |
819 |
|
// on Gtk 3 there is no margin at all by default |
820 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
821 |
|
frame->set_margin_top(12); |
822 |
|
frame->set_margin_bottom(12); |
823 |
|
#endif |
824 |
|
#if USE_GTKMM_GRID |
825 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
826 |
|
#else |
827 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
828 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
829 |
|
#endif |
830 |
rowno++; |
rowno++; |
831 |
|
|
832 |
eCrossfade_in_start.signal_value_changed().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
900 |
|
|
901 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
902 |
frame->add(cutoff_curve); |
frame->add(cutoff_curve); |
903 |
|
// on Gtk 3 there is no margin at all by default |
904 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
905 |
|
frame->set_margin_top(12); |
906 |
|
frame->set_margin_bottom(12); |
907 |
|
#endif |
908 |
|
#if USE_GTKMM_GRID |
909 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
910 |
|
#else |
911 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
912 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
913 |
|
#endif |
914 |
rowno++; |
rowno++; |
915 |
|
|
916 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
946 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
947 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
948 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
949 |
|
addLine(eEG2StateOptions); |
950 |
|
|
951 |
|
nextPage(); |
952 |
|
|
953 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
954 |
|
addProp(eLFO2Wave); |
955 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
956 |
|
addProp(eLFO2Phase); |
957 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
958 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
959 |
{ |
{ |
971 |
addProp(eLFO2Controller); |
addProp(eLFO2Controller); |
972 |
addProp(eLFO2FlipPhase); |
addProp(eLFO2FlipPhase); |
973 |
addProp(eLFO2Sync); |
addProp(eLFO2Sync); |
974 |
|
{ |
975 |
|
Gtk::Frame* frame = new Gtk::Frame; |
976 |
|
frame->add(lfo2Graph); |
977 |
|
// on Gtk 3 there is no margin at all by default |
978 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
979 |
|
frame->set_margin_top(12); |
980 |
|
frame->set_margin_bottom(12); |
981 |
|
#endif |
982 |
|
#if USE_GTKMM_GRID |
983 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
984 |
|
#else |
985 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
986 |
|
Gtk::SHRINK, Gtk::SHRINK); |
987 |
|
#endif |
988 |
|
rowno++; |
989 |
|
} |
990 |
|
eLFO2FlipPhase.signal_value_changed().connect( |
991 |
|
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
992 |
|
); |
993 |
|
|
994 |
nextPage(); |
nextPage(); |
995 |
|
|
1000 |
addProp(eEG3Attack); |
addProp(eEG3Attack); |
1001 |
addProp(eEG3Depth); |
addProp(eEG3Depth); |
1002 |
addHeader(_("Pitch Oscillator (LFO3)")); |
addHeader(_("Pitch Oscillator (LFO3)")); |
1003 |
|
addProp(eLFO3Wave); |
1004 |
addProp(eLFO3Frequency); |
addProp(eLFO3Frequency); |
1005 |
|
addProp(eLFO3Phase); |
1006 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
1007 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
1008 |
{ |
{ |
1018 |
eLFO3Controller.set_choices(choices, values); |
eLFO3Controller.set_choices(choices, values); |
1019 |
} |
} |
1020 |
addProp(eLFO3Controller); |
addProp(eLFO3Controller); |
1021 |
|
addProp(eLFO3FlipPhase); |
1022 |
addProp(eLFO3Sync); |
addProp(eLFO3Sync); |
1023 |
|
{ |
1024 |
|
Gtk::Frame* frame = new Gtk::Frame; |
1025 |
|
frame->add(lfo3Graph); |
1026 |
|
// on Gtk 3 there is no margin at all by default |
1027 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1028 |
|
frame->set_margin_top(12); |
1029 |
|
frame->set_margin_bottom(12); |
1030 |
|
#endif |
1031 |
|
#if USE_GTKMM_GRID |
1032 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1033 |
|
#else |
1034 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1035 |
|
Gtk::SHRINK, Gtk::SHRINK); |
1036 |
|
#endif |
1037 |
|
rowno++; |
1038 |
|
} |
1039 |
|
eLFO3FlipPhase.signal_value_changed().connect( |
1040 |
|
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw) |
1041 |
|
); |
1042 |
|
|
1043 |
nextPage(); |
nextPage(); |
1044 |
|
|
1057 |
|
|
1058 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
1059 |
frame->add(velocity_curve); |
frame->add(velocity_curve); |
1060 |
|
// on Gtk 3 there is no margin at all by default |
1061 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1062 |
|
frame->set_margin_top(12); |
1063 |
|
frame->set_margin_bottom(12); |
1064 |
|
#endif |
1065 |
|
#if USE_GTKMM_GRID |
1066 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1067 |
|
#else |
1068 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1069 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
1070 |
|
#endif |
1071 |
rowno++; |
rowno++; |
1072 |
|
|
1073 |
addHeader(_("Release Velocity Response")); |
addHeader(_("Release Velocity Response")); |
1082 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
1083 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
1084 |
frame->add(release_curve); |
frame->add(release_curve); |
1085 |
|
// on Gtk 3 there is no margin at all by default |
1086 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1087 |
|
frame->set_margin_top(12); |
1088 |
|
frame->set_margin_bottom(12); |
1089 |
|
#endif |
1090 |
|
#if USE_GTKMM_GRID |
1091 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1092 |
|
#else |
1093 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1094 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
1095 |
|
#endif |
1096 |
rowno++; |
rowno++; |
1097 |
|
|
1098 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
1099 |
{ |
{ |
1100 |
|
const char* choices[] = { _("off"), _("on (max. velocity)"), _("on (key velocity)"), 0 }; |
1101 |
|
static const gig::sust_rel_trg_t values[] = { |
1102 |
|
gig::sust_rel_trg_none, |
1103 |
|
gig::sust_rel_trg_maxvelocity, |
1104 |
|
gig::sust_rel_trg_keyvelocity |
1105 |
|
}; |
1106 |
|
eSustainReleaseTrigger.set_choices(choices, values); |
1107 |
|
} |
1108 |
|
eSustainReleaseTrigger.set_tip(_( |
1109 |
|
"By default release trigger samples are played on note-off events only. " |
1110 |
|
"This option allows to play release trigger sample on sustain pedal up " |
1111 |
|
"events as well. NOTE: This is a format extension!" |
1112 |
|
)); |
1113 |
|
addProp(eSustainReleaseTrigger); |
1114 |
|
{ |
1115 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
1116 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
1117 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
1120 |
}; |
}; |
1121 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
1122 |
} |
} |
1123 |
|
eNoNoteOffReleaseTrigger.set_tip(_( |
1124 |
|
"By default release trigger samples are played on note-off events only. " |
1125 |
|
"If this option is checked, then no release trigger sample is played " |
1126 |
|
"when releasing a note. NOTE: This is a format extension!" |
1127 |
|
)); |
1128 |
|
addProp(eNoNoteOffReleaseTrigger); |
1129 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
1130 |
eSelfMask.widget.set_tooltip_text(_( |
eSelfMask.widget.set_tooltip_text(_( |
1131 |
"If enabled: new notes with higher velocity value will stop older " |
"If enabled: new notes with higher velocity value will stop older " |
1192 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
1193 |
|
|
1194 |
append_page(*table[0], _("Sample")); |
append_page(*table[0], _("Sample")); |
1195 |
append_page(*table[1], _("Amplitude (1)")); |
append_page(*table[1], _("Amp (1)")); |
1196 |
append_page(*table[2], _("Amplitude (2)")); |
append_page(*table[2], _("Amp (2)")); |
1197 |
append_page(*table[3], _("Filter (1)")); |
append_page(*table[3], _("Amp (3)")); |
1198 |
append_page(*table[4], _("Filter (2)")); |
append_page(*table[4], _("Filter (1)")); |
1199 |
append_page(*table[5], _("Pitch")); |
append_page(*table[5], _("Filter (2)")); |
1200 |
append_page(*table[6], _("Misc")); |
append_page(*table[6], _("Filter (3)")); |
1201 |
|
append_page(*table[7], _("Pitch")); |
1202 |
|
append_page(*table[8], _("Misc")); |
1203 |
|
|
1204 |
|
Settings::singleton()->showTooltips.get_proxy().signal_changed().connect( |
1205 |
|
sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed) |
1206 |
|
); |
1207 |
|
|
1208 |
|
on_show_tooltips_changed(); |
1209 |
} |
} |
1210 |
|
|
1211 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
1216 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
1217 |
{ |
{ |
1218 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1219 |
|
#if HAS_GTKMM_ALIGNMENT |
1220 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1221 |
|
#else |
1222 |
|
label->set_halign(Gtk::Align::START); |
1223 |
|
#endif |
1224 |
|
|
1225 |
|
#if USE_GTKMM_GRID |
1226 |
|
table[pageno]->attach(*label, 1, rowno); |
1227 |
|
#else |
1228 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1229 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1230 |
|
#endif |
1231 |
|
|
1232 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
1233 |
|
|
1234 |
|
#if USE_GTKMM_GRID |
1235 |
|
table[pageno]->attach(*widget, 2, rowno); |
1236 |
|
#else |
1237 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
1238 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1239 |
|
#endif |
1240 |
|
|
1241 |
|
rowno++; |
1242 |
|
} |
1243 |
|
|
1244 |
|
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
1245 |
|
Gtk::Entry*& widget, Gtk::Button*& button) |
1246 |
|
{ |
1247 |
|
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1248 |
|
#if HAS_GTKMM_ALIGNMENT |
1249 |
|
label->set_alignment(Gtk::ALIGN_START); |
1250 |
|
#else |
1251 |
|
label->set_halign(Gtk::Align::START); |
1252 |
|
#endif |
1253 |
|
|
1254 |
|
#if USE_GTKMM_GRID |
1255 |
|
table[pageno]->attach(*label, 1, rowno); |
1256 |
|
#else |
1257 |
|
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1258 |
|
Gtk::FILL, Gtk::SHRINK); |
1259 |
|
#endif |
1260 |
|
|
1261 |
|
widget = new Gtk::Entry(); |
1262 |
|
button = new Gtk::Button(); |
1263 |
|
|
1264 |
|
HBox* hbox = new HBox; |
1265 |
|
hbox->pack_start(*widget); |
1266 |
|
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
1267 |
|
|
1268 |
|
#if USE_GTKMM_GRID |
1269 |
|
table[pageno]->attach(*hbox, 2, rowno); |
1270 |
|
#else |
1271 |
|
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
1272 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1273 |
|
#endif |
1274 |
|
|
1275 |
rowno++; |
rowno++; |
1276 |
} |
} |
1280 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1281 |
{ |
{ |
1282 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1283 |
|
#if USE_GTKMM_GRID |
1284 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1285 |
|
#else |
1286 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1287 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1288 |
|
#endif |
1289 |
} |
} |
1290 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1291 |
str += text; |
str += text; |
1292 |
str += "</b>"; |
str += "</b>"; |
1293 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1294 |
label->set_use_markup(); |
label->set_use_markup(); |
1295 |
|
#if HAS_GTKMM_ALIGNMENT |
1296 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1297 |
|
#else |
1298 |
|
label->set_halign(Gtk::Align::START); |
1299 |
|
#endif |
1300 |
|
// on GTKMM 3 there is absolutely no margin by default |
1301 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1302 |
|
label->set_margin_top(18); |
1303 |
|
label->set_margin_bottom(13); |
1304 |
|
#endif |
1305 |
|
#if USE_GTKMM_GRID |
1306 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1307 |
|
#else |
1308 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1309 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1310 |
|
#endif |
1311 |
rowno++; |
rowno++; |
1312 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1313 |
return label; |
return label; |
1314 |
} |
} |
1315 |
|
|
1316 |
|
void DimRegionEdit::on_show_tooltips_changed() { |
1317 |
|
const bool b = Settings::singleton()->showTooltips; |
1318 |
|
|
1319 |
|
buttonSelectSample.set_has_tooltip(b); |
1320 |
|
buttonNullSampleReference->set_has_tooltip(b); |
1321 |
|
wSample->set_has_tooltip(b); |
1322 |
|
|
1323 |
|
eEG1StateOptions.on_show_tooltips_changed(); |
1324 |
|
eEG2StateOptions.on_show_tooltips_changed(); |
1325 |
|
|
1326 |
|
set_has_tooltip(b); |
1327 |
|
} |
1328 |
|
|
1329 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
1330 |
{ |
{ |
1331 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1332 |
{ |
{ |
1333 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1334 |
|
#if USE_GTKMM_GRID |
1335 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1336 |
|
#else |
1337 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1338 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1339 |
|
#endif |
1340 |
} |
} |
1341 |
pageno++; |
pageno++; |
1342 |
rowno = 0; |
rowno = 0; |
1345 |
|
|
1346 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1347 |
{ |
{ |
1348 |
|
#if USE_GTKMM_GRID |
1349 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1350 |
|
#else |
1351 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1352 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1353 |
|
#endif |
1354 |
rowno++; |
rowno++; |
1355 |
} |
} |
1356 |
|
|
1357 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1358 |
{ |
{ |
1359 |
|
#if USE_GTKMM_GRID |
1360 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1361 |
|
#else |
1362 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1363 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1364 |
|
#endif |
1365 |
rowno++; |
rowno++; |
1366 |
} |
} |
1367 |
|
|
1368 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1369 |
{ |
{ |
1370 |
|
#if USE_GTKMM_GRID |
1371 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1372 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1373 |
|
#else |
1374 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1375 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1376 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1377 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1378 |
|
#endif |
1379 |
rowno++; |
rowno++; |
1380 |
} |
} |
1381 |
|
|
1382 |
|
void DimRegionEdit::addLine(HBox& line) |
1383 |
|
{ |
1384 |
|
#if USE_GTKMM_GRID |
1385 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1386 |
|
#else |
1387 |
|
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1388 |
|
Gtk::FILL, Gtk::SHRINK); |
1389 |
|
#endif |
1390 |
|
rowno++; |
1391 |
|
} |
1392 |
|
|
1393 |
|
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1394 |
|
{ |
1395 |
|
#if USE_GTKMM_GRID |
1396 |
|
table[pageno]->attach(widget, 2, rowno); |
1397 |
|
#else |
1398 |
|
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1399 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1400 |
|
#endif |
1401 |
|
rowno++; |
1402 |
|
} |
1403 |
|
|
1404 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
1405 |
{ |
{ |
1408 |
release_curve.set_dim_region(d); |
release_curve.set_dim_region(d); |
1409 |
cutoff_curve.set_dim_region(d); |
cutoff_curve.set_dim_region(d); |
1410 |
crossfade_curve.set_dim_region(d); |
crossfade_curve.set_dim_region(d); |
1411 |
|
lfo1Graph.set_dim_region(d); |
1412 |
|
lfo2Graph.set_dim_region(d); |
1413 |
|
lfo3Graph.set_dim_region(d); |
1414 |
|
|
1415 |
set_sensitive(d); |
set_sensitive(d); |
1416 |
if (!d) return; |
if (!d) return; |
1429 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1430 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1431 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1432 |
|
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1433 |
|
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1434 |
|
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1435 |
|
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1436 |
|
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1437 |
|
eLFO1Wave.set_value(d->LFO1WaveForm); |
1438 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1439 |
|
eLFO1Phase.set_value(d->LFO1Phase); |
1440 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1441 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1442 |
eLFO1Controller.set_value(d->LFO1Controller); |
eLFO1Controller.set_value(d->LFO1Controller); |
1454 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1455 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1456 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1457 |
|
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1458 |
|
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1459 |
|
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1460 |
|
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1461 |
|
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1462 |
|
eLFO2Wave.set_value(d->LFO2WaveForm); |
1463 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1464 |
|
eLFO2Phase.set_value(d->LFO2Phase); |
1465 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1466 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1467 |
eLFO2Controller.set_value(d->LFO2Controller); |
eLFO2Controller.set_value(d->LFO2Controller); |
1469 |
eLFO2Sync.set_value(d->LFO2Sync); |
eLFO2Sync.set_value(d->LFO2Sync); |
1470 |
eEG3Attack.set_value(d->EG3Attack); |
eEG3Attack.set_value(d->EG3Attack); |
1471 |
eEG3Depth.set_value(d->EG3Depth); |
eEG3Depth.set_value(d->EG3Depth); |
1472 |
|
eLFO3Wave.set_value(d->LFO3WaveForm); |
1473 |
eLFO3Frequency.set_value(d->LFO3Frequency); |
eLFO3Frequency.set_value(d->LFO3Frequency); |
1474 |
|
eLFO3Phase.set_value(d->LFO3Phase); |
1475 |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
eLFO3InternalDepth.set_value(d->LFO3InternalDepth); |
1476 |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
eLFO3ControlDepth.set_value(d->LFO3ControlDepth); |
1477 |
eLFO3Controller.set_value(d->LFO3Controller); |
eLFO3Controller.set_value(d->LFO3Controller); |
1478 |
|
eLFO3FlipPhase.set_value(d->LFO3FlipPhase); |
1479 |
eLFO3Sync.set_value(d->LFO3Sync); |
eLFO3Sync.set_value(d->LFO3Sync); |
1480 |
eVCFEnabled.set_value(d->VCFEnabled); |
eVCFEnabled.set_value(d->VCFEnabled); |
1481 |
eVCFType.set_value(d->VCFType); |
eVCFType.set_value(d->VCFType); |
1501 |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
1502 |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
1503 |
ePitchTrack.set_value(d->PitchTrack); |
ePitchTrack.set_value(d->PitchTrack); |
1504 |
|
eSustainReleaseTrigger.set_value(d->SustainReleaseTrigger); |
1505 |
|
eNoNoteOffReleaseTrigger.set_value(d->NoNoteOffReleaseTrigger); |
1506 |
eDimensionBypass.set_value(d->DimensionBypass); |
eDimensionBypass.set_value(d->DimensionBypass); |
1507 |
ePan.set_value(d->Pan); |
ePan.set_value(d->Pan); |
1508 |
eSelfMask.set_value(d->SelfMask); |
eSelfMask.set_value(d->SelfMask); |
1514 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1515 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1516 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1517 |
|
// show sample group name |
1518 |
|
{ |
1519 |
|
Glib::ustring s = "---"; |
1520 |
|
if (d->pSample && d->pSample->GetGroup()) |
1521 |
|
s = d->pSample->GetGroup()->Name; |
1522 |
|
eSampleGroup.text.set_text(s); |
1523 |
|
} |
1524 |
// assemble sample format info string |
// assemble sample format info string |
1525 |
{ |
{ |
1526 |
Glib::ustring s; |
Glib::ustring s; |
1552 |
} |
} |
1553 |
eSampleID.text.set_text(s); |
eSampleID.text.set_text(s); |
1554 |
} |
} |
1555 |
|
// generate raw wave form data CRC-32 checksum string |
1556 |
|
{ |
1557 |
|
Glib::ustring s = "---"; |
1558 |
|
if (d->pSample) { |
1559 |
|
char buf[64] = {}; |
1560 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1561 |
|
s = buf; |
1562 |
|
} |
1563 |
|
eChecksum.text.set_text(s); |
1564 |
|
} |
1565 |
|
buttonSelectSample.set_sensitive(d && d->pSample); |
1566 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1567 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1568 |
eGainPlus6.set_value(d->Gain); |
eGainPlus6.set_value(d->Gain); |
1611 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1612 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1613 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1614 |
|
eEG2StateOptions.set_sensitive(sensitive); |
1615 |
lLFO2->set_sensitive(sensitive); |
lLFO2->set_sensitive(sensitive); |
1616 |
|
eLFO2Wave.set_sensitive(sensitive); |
1617 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
1618 |
|
eLFO2Phase.set_sensitive(sensitive); |
1619 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
1620 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
1621 |
eLFO2Controller.set_sensitive(sensitive); |
eLFO2Controller.set_sensitive(sensitive); |
1622 |
eLFO2FlipPhase.set_sensitive(sensitive); |
eLFO2FlipPhase.set_sensitive(sensitive); |
1623 |
eLFO2Sync.set_sensitive(sensitive); |
eLFO2Sync.set_sensitive(sensitive); |
1624 |
|
lfo2Graph.set_sensitive(sensitive); |
1625 |
if (sensitive) { |
if (sensitive) { |
1626 |
VCFCutoffController_changed(); |
VCFCutoffController_changed(); |
1627 |
VCFResonanceController_changed(); |
VCFResonanceController_changed(); |
1808 |
|
|
1809 |
bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1810 |
{ |
{ |
1811 |
if (dimregion) { |
bool result = false; |
1812 |
|
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1813 |
|
itDimReg != dimregs.end(); ++itDimReg) |
1814 |
|
{ |
1815 |
|
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1816 |
|
} |
1817 |
|
return result; |
1818 |
|
} |
1819 |
|
|
1820 |
|
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1821 |
|
{ |
1822 |
|
if (dimreg) { |
1823 |
//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 |
1824 |
|
|
1825 |
// 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() |
1826 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1827 |
|
|
1828 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1829 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1830 |
int nbDimregs = 1; |
int nbDimregs = 1; |
1831 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1832 |
if (sample->Channels == 2) { |
if (sample->Channels == 2) { |
1833 |
gig::Region* region = dimregion->GetParent(); |
gig::Region* region = dimreg->GetParent(); |
1834 |
|
|
1835 |
int bitcount = 0; |
int bitcount = 0; |
1836 |
int stereo_bit = 0; |
int stereo_bit = 0; |
1845 |
if (stereo_bit) { |
if (stereo_bit) { |
1846 |
int dimregno; |
int dimregno; |
1847 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1848 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1849 |
break; |
break; |
1850 |
} |
} |
1851 |
} |
} |
1855 |
} |
} |
1856 |
} |
} |
1857 |
|
|
1858 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimreg->pSample; |
1859 |
|
|
1860 |
for (int i = 0 ; i < nbDimregs ; i++) { |
for (int i = 0 ; i < nbDimregs ; i++) { |
1861 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1885 |
|
|
1886 |
// update ui |
// update ui |
1887 |
update_model++; |
update_model++; |
1888 |
wSample->set_text(gig_to_utf8(dimregion->pSample->pInfo->Name)); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1889 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1890 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1891 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1892 |
update_loop_elements(); |
update_loop_elements(); |
1893 |
update_model--; |
update_model--; |
1894 |
|
|
1895 |
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); |
|
1896 |
return true; |
return true; |
1897 |
} |
} |
1898 |
return false; |
return false; |
1911 |
} |
} |
1912 |
|
|
1913 |
|
|
1914 |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion& d, uint8_t value) |
1915 |
{ |
{ |
1916 |
d->UnityNote = value; |
d.UnityNote = value; |
1917 |
} |
} |
1918 |
|
|
1919 |
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
void DimRegionEdit::set_FineTune(gig::DimensionRegion& d, int16_t value) |
1920 |
{ |
{ |
1921 |
d->FineTune = value; |
d.FineTune = value; |
1922 |
} |
} |
1923 |
|
|
1924 |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion& d, |
1925 |
uint8_t value) |
uint8_t value) |
1926 |
{ |
{ |
1927 |
d->Crossfade.in_start = value; |
d.Crossfade.in_start = value; |
1928 |
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
if (d.Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1929 |
} |
} |
1930 |
|
|
1931 |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion& d, |
1932 |
uint8_t value) |
uint8_t value) |
1933 |
{ |
{ |
1934 |
d->Crossfade.in_end = value; |
d.Crossfade.in_end = value; |
1935 |
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
if (value < d.Crossfade.in_start) set_Crossfade_in_start(d, value); |
1936 |
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
if (value > d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
1937 |
} |
} |
1938 |
|
|
1939 |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion& d, |
1940 |
uint8_t value) |
uint8_t value) |
1941 |
{ |
{ |
1942 |
d->Crossfade.out_start = value; |
d.Crossfade.out_start = value; |
1943 |
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
if (value < d.Crossfade.in_end) set_Crossfade_in_end(d, value); |
1944 |
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
if (value > d.Crossfade.out_end) set_Crossfade_out_end(d, value); |
1945 |
} |
} |
1946 |
|
|
1947 |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion& d, |
1948 |
uint8_t value) |
uint8_t value) |
1949 |
{ |
{ |
1950 |
d->Crossfade.out_end = value; |
d.Crossfade.out_end = value; |
1951 |
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
if (value < d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
1952 |
} |
} |
1953 |
|
|
1954 |
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
void DimRegionEdit::set_Gain(gig::DimensionRegion& d, int32_t value) |
1955 |
{ |
{ |
1956 |
d->SetGain(value); |
d.SetGain(value); |
1957 |
} |
} |
1958 |
|
|
1959 |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion& d, bool value) |
1960 |
{ |
{ |
1961 |
if (value) { |
if (value) { |
1962 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1963 |
if (!d->SampleLoops) { |
if (!d.SampleLoops) { |
1964 |
|
DimRegionChangeGuard(this, &d); |
1965 |
|
|
1966 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1967 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1968 |
// loop the whole sample by default |
// loop the whole sample by default |
1969 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1970 |
loop.LoopLength = |
loop.LoopLength = |
1971 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d.pSample) ? d.pSample->SamplesTotal : 0; |
1972 |
dimreg_to_be_changed_signal.emit(d); |
d.AddSampleLoop(&loop); |
|
d->AddSampleLoop(&loop); |
|
|
dimreg_changed_signal.emit(d); |
|
1973 |
} |
} |
1974 |
} else { |
} else { |
1975 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1976 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, &d); |
1977 |
|
|
1978 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1979 |
while (d->SampleLoops) { |
while (d.SampleLoops) { |
1980 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d.DeleteSampleLoop(&d.pSampleLoops[0]); |
1981 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1982 |
} |
} |
1983 |
} |
} |
1984 |
} |
} |
1985 |
|
|
1986 |
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopType(gig::DimensionRegion& d, uint32_t value) |
1987 |
{ |
{ |
1988 |
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
if (d.SampleLoops) d.pSampleLoops[0].LoopType = value; |
1989 |
} |
} |
1990 |
|
|
1991 |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion& d, uint32_t value) |
1992 |
{ |
{ |
1993 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1994 |
d->pSampleLoops[0].LoopStart = |
d.pSampleLoops[0].LoopStart = |
1995 |
d->pSample ? |
d.pSample ? |
1996 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
1997 |
d->pSampleLoops[0].LoopLength)) : |
d.pSampleLoops[0].LoopLength)) : |
1998 |
0; |
0; |
1999 |
} |
} |
2000 |
} |
} |
2001 |
|
|
2002 |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion& d, uint32_t value) |
2003 |
{ |
{ |
2004 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
2005 |
d->pSampleLoops[0].LoopLength = |
d.pSampleLoops[0].LoopLength = |
2006 |
d->pSample ? |
d.pSample ? |
2007 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
2008 |
d->pSampleLoops[0].LoopStart)) : |
d.pSampleLoops[0].LoopStart)) : |
2009 |
0; |
0; |
2010 |
} |
} |
2011 |
} |
} |
2012 |
|
|
2013 |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion& d, bool value) |
2014 |
{ |
{ |
2015 |
if (d->pSample) { |
if (d.pSample) { |
2016 |
if (value) d->pSample->LoopPlayCount = 0; |
if (value) d.pSample->LoopPlayCount = 0; |
2017 |
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
else if (d.pSample->LoopPlayCount == 0) d.pSample->LoopPlayCount = 1; |
2018 |
} |
} |
2019 |
} |
} |
2020 |
|
|
2021 |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion& d, uint32_t value) |
2022 |
{ |
{ |
2023 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d.pSample) d.pSample->LoopPlayCount = value; |
2024 |
|
} |
2025 |
|
|
2026 |
|
void DimRegionEdit::nullOutSampleReference() { |
2027 |
|
if (!dimregion) return; |
2028 |
|
gig::Sample* oldref = dimregion->pSample; |
2029 |
|
if (!oldref) return; |
2030 |
|
|
2031 |
|
DimRegionChangeGuard(this, dimregion); |
2032 |
|
|
2033 |
|
// in case currently assigned sample is a stereo one, then remove both |
2034 |
|
// references (expected to be due to a "stereo dimension") |
2035 |
|
gig::DimensionRegion* d[2] = { dimregion, NULL }; |
2036 |
|
if (oldref->Channels == 2) { |
2037 |
|
gig::Region* region = dimregion->GetParent(); |
2038 |
|
{ |
2039 |
|
int stereo_bit = 0; |
2040 |
|
int bitcount = 0; |
2041 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
2042 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
2043 |
|
stereo_bit = 1 << bitcount; |
2044 |
|
break; |
2045 |
|
} |
2046 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
2047 |
|
} |
2048 |
|
|
2049 |
|
if (stereo_bit) { |
2050 |
|
int dimregno; |
2051 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
2052 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
2053 |
|
break; |
2054 |
|
} |
2055 |
|
} |
2056 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
2057 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
2058 |
|
} |
2059 |
|
} |
2060 |
|
} |
2061 |
|
|
2062 |
|
if (d[0]) d[0]->pSample = NULL; |
2063 |
|
if (d[1]) d[1]->pSample = NULL; |
2064 |
|
|
2065 |
|
// update UI elements |
2066 |
|
set_dim_region(dimregion); |
2067 |
|
|
2068 |
|
sample_ref_changed_signal.emit(oldref, NULL); |
2069 |
|
} |
2070 |
|
|
2071 |
|
void DimRegionEdit::onButtonSelectSamplePressed() { |
2072 |
|
if (!dimregion) return; |
2073 |
|
if (!dimregion->pSample) return; |
2074 |
|
select_sample_signal.emit(dimregion->pSample); |
2075 |
|
} |
2076 |
|
|
2077 |
|
sigc::signal<void, gig::Sample*>& DimRegionEdit::signal_select_sample() { |
2078 |
|
return select_sample_signal; |
2079 |
} |
} |