1 |
/* |
/* |
2 |
* Copyright (C) 2006-2016 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 |
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 = LinuxSampler::LFO::wave_sine, // see https://sourceforge.net/p/linuxsampler/mailman/linuxsampler-devel/thread/2189307.cNP0Xbctxq%40silver/#msg36774029 |
228 |
|
.rangeType = (signedRange) ? LinuxSampler::LFO::range_signed : LinuxSampler::LFO::range_unsigned, |
229 |
|
.frequency = frequency(), |
230 |
|
//.phase = TODO |
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), |
406 |
eCrossfade_out_start(_("Crossfade-out start")), |
eCrossfade_out_start(_("Crossfade-out start")), |
407 |
eCrossfade_out_end(_("Crossfade-out end")), |
eCrossfade_out_end(_("Crossfade-out end")), |
408 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
409 |
|
eSustainReleaseTrigger(_("Sustain Release Trigger")), |
410 |
|
eNoNoteOffReleaseTrigger(_("No note-off release trigger")), |
411 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
412 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
413 |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
419 |
eMSDecode(_("Decode Mid/Side Recordings")), |
eMSDecode(_("Decode Mid/Side Recordings")), |
420 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
421 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
422 |
|
eSampleGroup(_("Sample Group")), |
423 |
eSampleFormatInfo(_("Sample Format")), |
eSampleFormatInfo(_("Sample Format")), |
424 |
eSampleID("Sample ID"), |
eSampleID("Sample ID"), |
425 |
|
eChecksum("Wave Data CRC-32"), |
426 |
eFineTune(_("Fine tune"), -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
427 |
eGain(_("Gain"), -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
428 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
429 |
eSampleLoopEnabled(_("Enabled")), |
eSampleLoopEnabled(_("Enabled")), |
430 |
eSampleLoopStart(_("Loop start positon")), |
eSampleLoopStart(_("Loop start position")), |
431 |
eSampleLoopLength(_("Loop size")), |
eSampleLoopLength(_("Loop size")), |
432 |
eSampleLoopType(_("Loop type")), |
eSampleLoopType(_("Loop type")), |
433 |
eSampleLoopInfinite(_("Infinite loop")), |
eSampleLoopInfinite(_("Infinite loop")), |
455 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
456 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
457 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
458 |
|
connect(eEG1StateOptions.checkBoxAttack, &gig::DimensionRegion::EG1Options, |
459 |
|
&gig::eg_opt_t::AttackCancel); |
460 |
|
connect(eEG1StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG1Options, |
461 |
|
&gig::eg_opt_t::AttackHoldCancel); |
462 |
|
connect(eEG1StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG1Options, |
463 |
|
&gig::eg_opt_t::Decay1Cancel); |
464 |
|
connect(eEG1StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG1Options, |
465 |
|
&gig::eg_opt_t::Decay2Cancel); |
466 |
|
connect(eEG1StateOptions.checkBoxRelease, &gig::DimensionRegion::EG1Options, |
467 |
|
&gig::eg_opt_t::ReleaseCancel); |
468 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
469 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
470 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
486 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
487 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
488 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
489 |
|
connect(eEG2StateOptions.checkBoxAttack, &gig::DimensionRegion::EG2Options, |
490 |
|
&gig::eg_opt_t::AttackCancel); |
491 |
|
connect(eEG2StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG2Options, |
492 |
|
&gig::eg_opt_t::AttackHoldCancel); |
493 |
|
connect(eEG2StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG2Options, |
494 |
|
&gig::eg_opt_t::Decay1Cancel); |
495 |
|
connect(eEG2StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG2Options, |
496 |
|
&gig::eg_opt_t::Decay2Cancel); |
497 |
|
connect(eEG2StateOptions.checkBoxRelease, &gig::DimensionRegion::EG2Options, |
498 |
|
&gig::eg_opt_t::ReleaseCancel); |
499 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
500 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
501 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
543 |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
544 |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
545 |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
546 |
|
connect(eSustainReleaseTrigger, &gig::DimensionRegion::SustainReleaseTrigger); |
547 |
|
connect(eNoNoteOffReleaseTrigger, &gig::DimensionRegion::NoNoteOffReleaseTrigger); |
548 |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
549 |
connect(ePan, &gig::DimensionRegion::Pan); |
connect(ePan, &gig::DimensionRegion::Pan); |
550 |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
572 |
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
573 |
); |
); |
574 |
|
|
575 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 9 ; i++) { |
576 |
|
#if USE_GTKMM_GRID |
577 |
|
table[i] = new Gtk::Grid; |
578 |
|
table[i]->set_column_spacing(7); |
579 |
|
#else |
580 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
581 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
582 |
|
#endif |
583 |
|
|
584 |
|
// on Gtk 3 there is absolutely no margin by default |
585 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
586 |
|
# if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12 |
587 |
|
table[i]->set_margin_left(12); |
588 |
|
table[i]->set_margin_right(12); |
589 |
|
# else |
590 |
|
table[i]->set_margin_start(12); |
591 |
|
table[i]->set_margin_end(12); |
592 |
|
# endif |
593 |
|
#endif |
594 |
} |
} |
595 |
|
|
596 |
// set tooltips |
// set tooltips |
696 |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
697 |
#endif |
#endif |
698 |
addProp(eUnityNote); |
addProp(eUnityNote); |
699 |
|
addProp(eSampleGroup); |
700 |
addProp(eSampleFormatInfo); |
addProp(eSampleFormatInfo); |
701 |
addProp(eSampleID); |
addProp(eSampleID); |
702 |
|
addProp(eChecksum); |
703 |
addRightHandSide(buttonSelectSample); |
addRightHandSide(buttonSelectSample); |
704 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
705 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
741 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
742 |
addProp(eEG1ControllerDecayInfluence); |
addProp(eEG1ControllerDecayInfluence); |
743 |
addProp(eEG1ControllerReleaseInfluence); |
addProp(eEG1ControllerReleaseInfluence); |
744 |
|
addLine(eEG1StateOptions); |
745 |
|
|
746 |
nextPage(); |
nextPage(); |
747 |
|
|
764 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
765 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
766 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
767 |
|
{ |
768 |
|
Gtk::Frame* frame = new Gtk::Frame; |
769 |
|
frame->add(lfo1Graph); |
770 |
|
// on Gtk 3 there is no margin at all by default |
771 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
772 |
|
frame->set_margin_top(12); |
773 |
|
frame->set_margin_bottom(12); |
774 |
|
#endif |
775 |
|
#if USE_GTKMM_GRID |
776 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
777 |
|
#else |
778 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
779 |
|
Gtk::SHRINK, Gtk::SHRINK); |
780 |
|
#endif |
781 |
|
rowno++; |
782 |
|
} |
783 |
|
eLFO1FlipPhase.signal_value_changed().connect( |
784 |
|
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
785 |
|
); |
786 |
|
|
787 |
|
nextPage(); |
788 |
|
|
789 |
addHeader(_("Crossfade")); |
addHeader(_("Crossfade")); |
790 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
791 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
797 |
|
|
798 |
Gtk::Frame* frame = new Gtk::Frame; |
Gtk::Frame* frame = new Gtk::Frame; |
799 |
frame->add(crossfade_curve); |
frame->add(crossfade_curve); |
800 |
|
// on Gtk 3 there is no margin at all by default |
801 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
802 |
|
frame->set_margin_top(12); |
803 |
|
frame->set_margin_bottom(12); |
804 |
|
#endif |
805 |
|
#if USE_GTKMM_GRID |
806 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
807 |
|
#else |
808 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
809 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
810 |
|
#endif |
811 |
rowno++; |
rowno++; |
812 |
|
|
813 |
eCrossfade_in_start.signal_value_changed().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
881 |
|
|
882 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
883 |
frame->add(cutoff_curve); |
frame->add(cutoff_curve); |
884 |
|
// on Gtk 3 there is no margin at all by default |
885 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
886 |
|
frame->set_margin_top(12); |
887 |
|
frame->set_margin_bottom(12); |
888 |
|
#endif |
889 |
|
#if USE_GTKMM_GRID |
890 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
891 |
|
#else |
892 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
893 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
894 |
|
#endif |
895 |
rowno++; |
rowno++; |
896 |
|
|
897 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
927 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
928 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
929 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
930 |
|
addLine(eEG2StateOptions); |
931 |
|
|
932 |
|
nextPage(); |
933 |
|
|
934 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
935 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
936 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
950 |
addProp(eLFO2Controller); |
addProp(eLFO2Controller); |
951 |
addProp(eLFO2FlipPhase); |
addProp(eLFO2FlipPhase); |
952 |
addProp(eLFO2Sync); |
addProp(eLFO2Sync); |
953 |
|
{ |
954 |
|
Gtk::Frame* frame = new Gtk::Frame; |
955 |
|
frame->add(lfo2Graph); |
956 |
|
// on Gtk 3 there is no margin at all by default |
957 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
958 |
|
frame->set_margin_top(12); |
959 |
|
frame->set_margin_bottom(12); |
960 |
|
#endif |
961 |
|
#if USE_GTKMM_GRID |
962 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
963 |
|
#else |
964 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
965 |
|
Gtk::SHRINK, Gtk::SHRINK); |
966 |
|
#endif |
967 |
|
rowno++; |
968 |
|
} |
969 |
|
eLFO2FlipPhase.signal_value_changed().connect( |
970 |
|
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
971 |
|
); |
972 |
|
|
973 |
nextPage(); |
nextPage(); |
974 |
|
|
996 |
} |
} |
997 |
addProp(eLFO3Controller); |
addProp(eLFO3Controller); |
998 |
addProp(eLFO3Sync); |
addProp(eLFO3Sync); |
999 |
|
{ |
1000 |
|
Gtk::Frame* frame = new Gtk::Frame; |
1001 |
|
frame->add(lfo3Graph); |
1002 |
|
// on Gtk 3 there is no margin at all by default |
1003 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1004 |
|
frame->set_margin_top(12); |
1005 |
|
frame->set_margin_bottom(12); |
1006 |
|
#endif |
1007 |
|
#if USE_GTKMM_GRID |
1008 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1009 |
|
#else |
1010 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1011 |
|
Gtk::SHRINK, Gtk::SHRINK); |
1012 |
|
#endif |
1013 |
|
rowno++; |
1014 |
|
} |
1015 |
|
|
1016 |
nextPage(); |
nextPage(); |
1017 |
|
|
1030 |
|
|
1031 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
1032 |
frame->add(velocity_curve); |
frame->add(velocity_curve); |
1033 |
|
// on Gtk 3 there is no margin at all by default |
1034 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1035 |
|
frame->set_margin_top(12); |
1036 |
|
frame->set_margin_bottom(12); |
1037 |
|
#endif |
1038 |
|
#if USE_GTKMM_GRID |
1039 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1040 |
|
#else |
1041 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1042 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
1043 |
|
#endif |
1044 |
rowno++; |
rowno++; |
1045 |
|
|
1046 |
addHeader(_("Release Velocity Response")); |
addHeader(_("Release Velocity Response")); |
1055 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
1056 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
1057 |
frame->add(release_curve); |
frame->add(release_curve); |
1058 |
|
// on Gtk 3 there is no margin at all by default |
1059 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1060 |
|
frame->set_margin_top(12); |
1061 |
|
frame->set_margin_bottom(12); |
1062 |
|
#endif |
1063 |
|
#if USE_GTKMM_GRID |
1064 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1065 |
|
#else |
1066 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1067 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
1068 |
|
#endif |
1069 |
rowno++; |
rowno++; |
1070 |
|
|
1071 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
1072 |
{ |
{ |
1073 |
|
const char* choices[] = { _("off"), _("on (max. velocity)"), _("on (key velocity)"), 0 }; |
1074 |
|
static const gig::sust_rel_trg_t values[] = { |
1075 |
|
gig::sust_rel_trg_none, |
1076 |
|
gig::sust_rel_trg_maxvelocity, |
1077 |
|
gig::sust_rel_trg_keyvelocity |
1078 |
|
}; |
1079 |
|
eSustainReleaseTrigger.set_choices(choices, values); |
1080 |
|
} |
1081 |
|
eSustainReleaseTrigger.set_tip(_( |
1082 |
|
"By default release trigger samples are played on note-off events only. " |
1083 |
|
"This option allows to play release trigger sample on sustain pedal up " |
1084 |
|
"events as well. NOTE: This is a format extension!" |
1085 |
|
)); |
1086 |
|
addProp(eSustainReleaseTrigger); |
1087 |
|
{ |
1088 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
1089 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
1090 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
1093 |
}; |
}; |
1094 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
1095 |
} |
} |
1096 |
|
eNoNoteOffReleaseTrigger.set_tip(_( |
1097 |
|
"By default release trigger samples are played on note-off events only. " |
1098 |
|
"If this option is checked, then no release trigger sample is played " |
1099 |
|
"when releasing a note. NOTE: This is a format extension!" |
1100 |
|
)); |
1101 |
|
addProp(eNoNoteOffReleaseTrigger); |
1102 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
1103 |
eSelfMask.widget.set_tooltip_text(_( |
eSelfMask.widget.set_tooltip_text(_( |
1104 |
"If enabled: new notes with higher velocity value will stop older " |
"If enabled: new notes with higher velocity value will stop older " |
1165 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
1166 |
|
|
1167 |
append_page(*table[0], _("Sample")); |
append_page(*table[0], _("Sample")); |
1168 |
append_page(*table[1], _("Amplitude (1)")); |
append_page(*table[1], _("Amp (1)")); |
1169 |
append_page(*table[2], _("Amplitude (2)")); |
append_page(*table[2], _("Amp (2)")); |
1170 |
append_page(*table[3], _("Filter (1)")); |
append_page(*table[3], _("Amp (3)")); |
1171 |
append_page(*table[4], _("Filter (2)")); |
append_page(*table[4], _("Filter (1)")); |
1172 |
append_page(*table[5], _("Pitch")); |
append_page(*table[5], _("Filter (2)")); |
1173 |
append_page(*table[6], _("Misc")); |
append_page(*table[6], _("Filter (3)")); |
1174 |
|
append_page(*table[7], _("Pitch")); |
1175 |
|
append_page(*table[8], _("Misc")); |
1176 |
|
|
1177 |
|
Settings::singleton()->showTooltips.get_proxy().signal_changed().connect( |
1178 |
|
sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed) |
1179 |
|
); |
1180 |
|
|
1181 |
|
on_show_tooltips_changed(); |
1182 |
} |
} |
1183 |
|
|
1184 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
1189 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
1190 |
{ |
{ |
1191 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1192 |
|
#if HAS_GTKMM_ALIGNMENT |
1193 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1194 |
|
#else |
1195 |
|
label->set_halign(Gtk::Align::START); |
1196 |
|
#endif |
1197 |
|
|
1198 |
|
#if USE_GTKMM_GRID |
1199 |
|
table[pageno]->attach(*label, 1, rowno); |
1200 |
|
#else |
1201 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1202 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1203 |
|
#endif |
1204 |
|
|
1205 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
1206 |
|
|
1207 |
|
#if USE_GTKMM_GRID |
1208 |
|
table[pageno]->attach(*widget, 2, rowno); |
1209 |
|
#else |
1210 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
1211 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1212 |
|
#endif |
1213 |
|
|
1214 |
rowno++; |
rowno++; |
1215 |
} |
} |
1218 |
Gtk::Entry*& widget, Gtk::Button*& button) |
Gtk::Entry*& widget, Gtk::Button*& button) |
1219 |
{ |
{ |
1220 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1221 |
|
#if HAS_GTKMM_ALIGNMENT |
1222 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1223 |
|
#else |
1224 |
|
label->set_halign(Gtk::Align::START); |
1225 |
|
#endif |
1226 |
|
|
1227 |
|
#if USE_GTKMM_GRID |
1228 |
|
table[pageno]->attach(*label, 1, rowno); |
1229 |
|
#else |
1230 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1231 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1232 |
|
#endif |
1233 |
|
|
1234 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
1235 |
button = new Gtk::Button(); |
button = new Gtk::Button(); |
1236 |
|
|
1237 |
Gtk::HBox* hbox = new Gtk::HBox; |
HBox* hbox = new HBox; |
1238 |
hbox->pack_start(*widget); |
hbox->pack_start(*widget); |
1239 |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
1240 |
|
|
1241 |
|
#if USE_GTKMM_GRID |
1242 |
|
table[pageno]->attach(*hbox, 2, rowno); |
1243 |
|
#else |
1244 |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
1245 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1246 |
|
#endif |
1247 |
|
|
1248 |
rowno++; |
rowno++; |
1249 |
} |
} |
1253 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1254 |
{ |
{ |
1255 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1256 |
|
#if USE_GTKMM_GRID |
1257 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1258 |
|
#else |
1259 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1260 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1261 |
|
#endif |
1262 |
} |
} |
1263 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1264 |
str += text; |
str += text; |
1265 |
str += "</b>"; |
str += "</b>"; |
1266 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1267 |
label->set_use_markup(); |
label->set_use_markup(); |
1268 |
|
#if HAS_GTKMM_ALIGNMENT |
1269 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1270 |
|
#else |
1271 |
|
label->set_halign(Gtk::Align::START); |
1272 |
|
#endif |
1273 |
|
// on GTKMM 3 there is absolutely no margin by default |
1274 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1275 |
|
label->set_margin_top(18); |
1276 |
|
label->set_margin_bottom(13); |
1277 |
|
#endif |
1278 |
|
#if USE_GTKMM_GRID |
1279 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1280 |
|
#else |
1281 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1282 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1283 |
|
#endif |
1284 |
rowno++; |
rowno++; |
1285 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1286 |
return label; |
return label; |
1287 |
} |
} |
1288 |
|
|
1289 |
|
void DimRegionEdit::on_show_tooltips_changed() { |
1290 |
|
const bool b = Settings::singleton()->showTooltips; |
1291 |
|
|
1292 |
|
buttonSelectSample.set_has_tooltip(b); |
1293 |
|
buttonNullSampleReference->set_has_tooltip(b); |
1294 |
|
wSample->set_has_tooltip(b); |
1295 |
|
|
1296 |
|
eEG1StateOptions.on_show_tooltips_changed(); |
1297 |
|
eEG2StateOptions.on_show_tooltips_changed(); |
1298 |
|
|
1299 |
|
set_has_tooltip(b); |
1300 |
|
} |
1301 |
|
|
1302 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
1303 |
{ |
{ |
1304 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1305 |
{ |
{ |
1306 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1307 |
|
#if USE_GTKMM_GRID |
1308 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1309 |
|
#else |
1310 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1311 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1312 |
|
#endif |
1313 |
} |
} |
1314 |
pageno++; |
pageno++; |
1315 |
rowno = 0; |
rowno = 0; |
1318 |
|
|
1319 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1320 |
{ |
{ |
1321 |
|
#if USE_GTKMM_GRID |
1322 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1323 |
|
#else |
1324 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1325 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1326 |
|
#endif |
1327 |
rowno++; |
rowno++; |
1328 |
} |
} |
1329 |
|
|
1330 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1331 |
{ |
{ |
1332 |
|
#if USE_GTKMM_GRID |
1333 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1334 |
|
#else |
1335 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1336 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1337 |
|
#endif |
1338 |
rowno++; |
rowno++; |
1339 |
} |
} |
1340 |
|
|
1341 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1342 |
{ |
{ |
1343 |
|
#if USE_GTKMM_GRID |
1344 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1345 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1346 |
|
#else |
1347 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1348 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1349 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1350 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1351 |
|
#endif |
1352 |
|
rowno++; |
1353 |
|
} |
1354 |
|
|
1355 |
|
void DimRegionEdit::addLine(HBox& line) |
1356 |
|
{ |
1357 |
|
#if USE_GTKMM_GRID |
1358 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1359 |
|
#else |
1360 |
|
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1361 |
|
Gtk::FILL, Gtk::SHRINK); |
1362 |
|
#endif |
1363 |
rowno++; |
rowno++; |
1364 |
} |
} |
1365 |
|
|
1366 |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1367 |
{ |
{ |
1368 |
|
#if USE_GTKMM_GRID |
1369 |
|
table[pageno]->attach(widget, 2, rowno); |
1370 |
|
#else |
1371 |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1372 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1373 |
|
#endif |
1374 |
rowno++; |
rowno++; |
1375 |
} |
} |
1376 |
|
|
1381 |
release_curve.set_dim_region(d); |
release_curve.set_dim_region(d); |
1382 |
cutoff_curve.set_dim_region(d); |
cutoff_curve.set_dim_region(d); |
1383 |
crossfade_curve.set_dim_region(d); |
crossfade_curve.set_dim_region(d); |
1384 |
|
lfo1Graph.set_dim_region(d); |
1385 |
|
lfo2Graph.set_dim_region(d); |
1386 |
|
lfo3Graph.set_dim_region(d); |
1387 |
|
|
1388 |
set_sensitive(d); |
set_sensitive(d); |
1389 |
if (!d) return; |
if (!d) return; |
1402 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1403 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1404 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1405 |
|
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1406 |
|
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1407 |
|
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1408 |
|
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1409 |
|
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1410 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1411 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1412 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1425 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1426 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1427 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1428 |
|
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1429 |
|
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1430 |
|
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1431 |
|
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1432 |
|
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1433 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1434 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1435 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1467 |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
1468 |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
1469 |
ePitchTrack.set_value(d->PitchTrack); |
ePitchTrack.set_value(d->PitchTrack); |
1470 |
|
eSustainReleaseTrigger.set_value(d->SustainReleaseTrigger); |
1471 |
|
eNoNoteOffReleaseTrigger.set_value(d->NoNoteOffReleaseTrigger); |
1472 |
eDimensionBypass.set_value(d->DimensionBypass); |
eDimensionBypass.set_value(d->DimensionBypass); |
1473 |
ePan.set_value(d->Pan); |
ePan.set_value(d->Pan); |
1474 |
eSelfMask.set_value(d->SelfMask); |
eSelfMask.set_value(d->SelfMask); |
1480 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1481 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1482 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1483 |
|
// show sample group name |
1484 |
|
{ |
1485 |
|
Glib::ustring s = "---"; |
1486 |
|
if (d->pSample && d->pSample->GetGroup()) |
1487 |
|
s = d->pSample->GetGroup()->Name; |
1488 |
|
eSampleGroup.text.set_text(s); |
1489 |
|
} |
1490 |
// assemble sample format info string |
// assemble sample format info string |
1491 |
{ |
{ |
1492 |
Glib::ustring s; |
Glib::ustring s; |
1518 |
} |
} |
1519 |
eSampleID.text.set_text(s); |
eSampleID.text.set_text(s); |
1520 |
} |
} |
1521 |
|
// generate raw wave form data CRC-32 checksum string |
1522 |
|
{ |
1523 |
|
Glib::ustring s = "---"; |
1524 |
|
if (d->pSample) { |
1525 |
|
char buf[64] = {}; |
1526 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1527 |
|
s = buf; |
1528 |
|
} |
1529 |
|
eChecksum.text.set_text(s); |
1530 |
|
} |
1531 |
buttonSelectSample.set_sensitive(d && d->pSample); |
buttonSelectSample.set_sensitive(d && d->pSample); |
1532 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1533 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1577 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1578 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1579 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1580 |
|
eEG2StateOptions.set_sensitive(sensitive); |
1581 |
lLFO2->set_sensitive(sensitive); |
lLFO2->set_sensitive(sensitive); |
1582 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
1583 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
1585 |
eLFO2Controller.set_sensitive(sensitive); |
eLFO2Controller.set_sensitive(sensitive); |
1586 |
eLFO2FlipPhase.set_sensitive(sensitive); |
eLFO2FlipPhase.set_sensitive(sensitive); |
1587 |
eLFO2Sync.set_sensitive(sensitive); |
eLFO2Sync.set_sensitive(sensitive); |
1588 |
|
lfo2Graph.set_sensitive(sensitive); |
1589 |
if (sensitive) { |
if (sensitive) { |
1590 |
VCFCutoffController_changed(); |
VCFCutoffController_changed(); |
1591 |
VCFResonanceController_changed(); |
VCFResonanceController_changed(); |
1772 |
|
|
1773 |
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) |
1774 |
{ |
{ |
1775 |
|
bool result = false; |
1776 |
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1777 |
itDimReg != dimregs.end(); ++itDimReg) |
itDimReg != dimregs.end(); ++itDimReg) |
1778 |
{ |
{ |
1779 |
set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1780 |
} |
} |
1781 |
|
return result; |
1782 |
} |
} |
1783 |
|
|
1784 |
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1787 |
//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 |
1788 |
|
|
1789 |
// 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() |
1790 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1791 |
|
|
1792 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1793 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1857 |
update_model--; |
update_model--; |
1858 |
|
|
1859 |
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(dimreg); |
|
1860 |
return true; |
return true; |
1861 |
} |
} |
1862 |
return false; |
return false; |
1875 |
} |
} |
1876 |
|
|
1877 |
|
|
1878 |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion& d, uint8_t value) |
1879 |
{ |
{ |
1880 |
d->UnityNote = value; |
d.UnityNote = value; |
1881 |
} |
} |
1882 |
|
|
1883 |
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
void DimRegionEdit::set_FineTune(gig::DimensionRegion& d, int16_t value) |
1884 |
{ |
{ |
1885 |
d->FineTune = value; |
d.FineTune = value; |
1886 |
} |
} |
1887 |
|
|
1888 |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion& d, |
1889 |
uint8_t value) |
uint8_t value) |
1890 |
{ |
{ |
1891 |
d->Crossfade.in_start = value; |
d.Crossfade.in_start = value; |
1892 |
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
if (d.Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1893 |
} |
} |
1894 |
|
|
1895 |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion& d, |
1896 |
uint8_t value) |
uint8_t value) |
1897 |
{ |
{ |
1898 |
d->Crossfade.in_end = value; |
d.Crossfade.in_end = value; |
1899 |
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
if (value < d.Crossfade.in_start) set_Crossfade_in_start(d, value); |
1900 |
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
if (value > d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
1901 |
} |
} |
1902 |
|
|
1903 |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion& d, |
1904 |
uint8_t value) |
uint8_t value) |
1905 |
{ |
{ |
1906 |
d->Crossfade.out_start = value; |
d.Crossfade.out_start = value; |
1907 |
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
if (value < d.Crossfade.in_end) set_Crossfade_in_end(d, value); |
1908 |
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
if (value > d.Crossfade.out_end) set_Crossfade_out_end(d, value); |
1909 |
} |
} |
1910 |
|
|
1911 |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion& d, |
1912 |
uint8_t value) |
uint8_t value) |
1913 |
{ |
{ |
1914 |
d->Crossfade.out_end = value; |
d.Crossfade.out_end = value; |
1915 |
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
if (value < d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
1916 |
} |
} |
1917 |
|
|
1918 |
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
void DimRegionEdit::set_Gain(gig::DimensionRegion& d, int32_t value) |
1919 |
{ |
{ |
1920 |
d->SetGain(value); |
d.SetGain(value); |
1921 |
} |
} |
1922 |
|
|
1923 |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion& d, bool value) |
1924 |
{ |
{ |
1925 |
if (value) { |
if (value) { |
1926 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1927 |
if (!d->SampleLoops) { |
if (!d.SampleLoops) { |
1928 |
|
DimRegionChangeGuard(this, &d); |
1929 |
|
|
1930 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1931 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1932 |
// loop the whole sample by default |
// loop the whole sample by default |
1933 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1934 |
loop.LoopLength = |
loop.LoopLength = |
1935 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d.pSample) ? d.pSample->SamplesTotal : 0; |
1936 |
dimreg_to_be_changed_signal.emit(d); |
d.AddSampleLoop(&loop); |
|
d->AddSampleLoop(&loop); |
|
|
dimreg_changed_signal.emit(d); |
|
1937 |
} |
} |
1938 |
} else { |
} else { |
1939 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1940 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, &d); |
1941 |
|
|
1942 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1943 |
while (d->SampleLoops) { |
while (d.SampleLoops) { |
1944 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d.DeleteSampleLoop(&d.pSampleLoops[0]); |
1945 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1946 |
} |
} |
1947 |
} |
} |
1948 |
} |
} |
1949 |
|
|
1950 |
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopType(gig::DimensionRegion& d, uint32_t value) |
1951 |
{ |
{ |
1952 |
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
if (d.SampleLoops) d.pSampleLoops[0].LoopType = value; |
1953 |
} |
} |
1954 |
|
|
1955 |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion& d, uint32_t value) |
1956 |
{ |
{ |
1957 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1958 |
d->pSampleLoops[0].LoopStart = |
d.pSampleLoops[0].LoopStart = |
1959 |
d->pSample ? |
d.pSample ? |
1960 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
1961 |
d->pSampleLoops[0].LoopLength)) : |
d.pSampleLoops[0].LoopLength)) : |
1962 |
0; |
0; |
1963 |
} |
} |
1964 |
} |
} |
1965 |
|
|
1966 |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion& d, uint32_t value) |
1967 |
{ |
{ |
1968 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1969 |
d->pSampleLoops[0].LoopLength = |
d.pSampleLoops[0].LoopLength = |
1970 |
d->pSample ? |
d.pSample ? |
1971 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
1972 |
d->pSampleLoops[0].LoopStart)) : |
d.pSampleLoops[0].LoopStart)) : |
1973 |
0; |
0; |
1974 |
} |
} |
1975 |
} |
} |
1976 |
|
|
1977 |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion& d, bool value) |
1978 |
{ |
{ |
1979 |
if (d->pSample) { |
if (d.pSample) { |
1980 |
if (value) d->pSample->LoopPlayCount = 0; |
if (value) d.pSample->LoopPlayCount = 0; |
1981 |
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
else if (d.pSample->LoopPlayCount == 0) d.pSample->LoopPlayCount = 1; |
1982 |
} |
} |
1983 |
} |
} |
1984 |
|
|
1985 |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion& d, uint32_t value) |
1986 |
{ |
{ |
1987 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d.pSample) d.pSample->LoopPlayCount = value; |
1988 |
} |
} |
1989 |
|
|
1990 |
void DimRegionEdit::nullOutSampleReference() { |
void DimRegionEdit::nullOutSampleReference() { |
1992 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimregion->pSample; |
1993 |
if (!oldref) return; |
if (!oldref) return; |
1994 |
|
|
1995 |
dimreg_to_be_changed_signal.emit(dimregion); |
DimRegionChangeGuard(this, dimregion); |
1996 |
|
|
1997 |
// in case currently assigned sample is a stereo one, then remove both |
// in case currently assigned sample is a stereo one, then remove both |
1998 |
// references (expected to be due to a "stereo dimension") |
// references (expected to be due to a "stereo dimension") |
2030 |
set_dim_region(dimregion); |
set_dim_region(dimregion); |
2031 |
|
|
2032 |
sample_ref_changed_signal.emit(oldref, NULL); |
sample_ref_changed_signal.emit(oldref, NULL); |
|
dimreg_changed_signal.emit(dimregion); |
|
2033 |
} |
} |
2034 |
|
|
2035 |
void DimRegionEdit::onButtonSelectSamplePressed() { |
void DimRegionEdit::onButtonSelectSamplePressed() { |