1 |
/* |
/* |
2 |
* Copyright (C) 2006-2015 Andreas Persson |
* Copyright (C) 2006-2017 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
17 |
* 02110-1301 USA. |
* 02110-1301 USA. |
18 |
*/ |
*/ |
19 |
|
|
20 |
|
#include "global.h" |
21 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
22 |
|
|
|
#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); |
155 |
} |
} |
156 |
|
|
157 |
|
|
158 |
|
EGStateOptions::EGStateOptions() : HBox(), |
159 |
|
label(_("May be cancelled: ")), |
160 |
|
checkBoxAttack(_("Attack")), |
161 |
|
checkBoxAttackHold(_("Attack Hold")), |
162 |
|
checkBoxDecay1(_("Decay 1")), |
163 |
|
checkBoxDecay2(_("Decay 2")), |
164 |
|
checkBoxRelease(_("Release")) |
165 |
|
{ |
166 |
|
set_spacing(6); |
167 |
|
|
168 |
|
pack_start(label); |
169 |
|
pack_start(checkBoxAttack, Gtk::PACK_SHRINK); |
170 |
|
pack_start(checkBoxAttackHold, Gtk::PACK_SHRINK); |
171 |
|
pack_start(checkBoxDecay1, Gtk::PACK_SHRINK); |
172 |
|
pack_start(checkBoxDecay2, Gtk::PACK_SHRINK); |
173 |
|
pack_start(checkBoxRelease, Gtk::PACK_SHRINK); |
174 |
|
|
175 |
|
checkBoxAttack.set_tooltip_text(_( |
176 |
|
"If checked: a note-off aborts the 'attack' stage." |
177 |
|
)); |
178 |
|
checkBoxAttackHold.set_tooltip_text(_( |
179 |
|
"If checked: a note-off aborts the 'attack hold' stage." |
180 |
|
)); |
181 |
|
checkBoxDecay1.set_tooltip_text(_( |
182 |
|
"If checked: a note-off aborts the 'decay 1' stage." |
183 |
|
)); |
184 |
|
checkBoxDecay2.set_tooltip_text(_( |
185 |
|
"If checked: a note-off aborts the 'decay 2' stage." |
186 |
|
)); |
187 |
|
checkBoxRelease.set_tooltip_text(_( |
188 |
|
"If checked: a note-on reverts back from the 'release' stage." |
189 |
|
)); |
190 |
|
} |
191 |
|
|
192 |
|
void EGStateOptions::on_show_tooltips_changed() { |
193 |
|
const bool b = Settings::singleton()->showTooltips; |
194 |
|
|
195 |
|
checkBoxAttack.set_has_tooltip(b); |
196 |
|
checkBoxAttackHold.set_has_tooltip(b); |
197 |
|
checkBoxDecay1.set_has_tooltip(b); |
198 |
|
checkBoxDecay2.set_has_tooltip(b); |
199 |
|
checkBoxRelease.set_has_tooltip(b); |
200 |
|
} |
201 |
|
|
202 |
|
|
203 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
204 |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
205 |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
272 |
eCrossfade_out_start(_("Crossfade-out start")), |
eCrossfade_out_start(_("Crossfade-out start")), |
273 |
eCrossfade_out_end(_("Crossfade-out end")), |
eCrossfade_out_end(_("Crossfade-out end")), |
274 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
275 |
|
eSustainReleaseTrigger(_("Sustain Release Trigger")), |
276 |
|
eNoNoteOffReleaseTrigger(_("No note-off release trigger")), |
277 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
278 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
279 |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
285 |
eMSDecode(_("Decode Mid/Side Recordings")), |
eMSDecode(_("Decode Mid/Side Recordings")), |
286 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
287 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
288 |
|
eSampleGroup(_("Sample Group")), |
289 |
eSampleFormatInfo(_("Sample Format")), |
eSampleFormatInfo(_("Sample Format")), |
290 |
eSampleID("Sample ID"), |
eSampleID("Sample ID"), |
291 |
|
eChecksum("Wave Data CRC-32"), |
292 |
eFineTune(_("Fine tune"), -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
293 |
eGain(_("Gain"), -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
294 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
295 |
eSampleLoopEnabled(_("Enabled")), |
eSampleLoopEnabled(_("Enabled")), |
296 |
eSampleLoopStart(_("Loop start positon")), |
eSampleLoopStart(_("Loop start position")), |
297 |
eSampleLoopLength(_("Loop size")), |
eSampleLoopLength(_("Loop size")), |
298 |
eSampleLoopType(_("Loop type")), |
eSampleLoopType(_("Loop type")), |
299 |
eSampleLoopInfinite(_("Infinite loop")), |
eSampleLoopInfinite(_("Infinite loop")), |
301 |
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
302 |
update_model(0) |
update_model(0) |
303 |
{ |
{ |
304 |
|
// make synthesis parameter page tabs scrollable |
305 |
|
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
306 |
|
set_scrollable(); |
307 |
|
|
308 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
309 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
310 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
321 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
322 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
323 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
324 |
|
{ |
325 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackCancel)); |
326 |
|
connect(eEG1StateOptions.checkBoxAttack, mp.pmember); |
327 |
|
} |
328 |
|
{ |
329 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackHoldCancel)); |
330 |
|
connect(eEG1StateOptions.checkBoxAttackHold, mp.pmember); |
331 |
|
} |
332 |
|
{ |
333 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay1Cancel)); |
334 |
|
connect(eEG1StateOptions.checkBoxDecay1, mp.pmember); |
335 |
|
} |
336 |
|
{ |
337 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay2Cancel)); |
338 |
|
connect(eEG1StateOptions.checkBoxDecay2, mp.pmember); |
339 |
|
} |
340 |
|
{ |
341 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.ReleaseCancel)); |
342 |
|
connect(eEG1StateOptions.checkBoxRelease, mp.pmember); |
343 |
|
} |
344 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
345 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
346 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
362 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
363 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
364 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
365 |
|
{ |
366 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackCancel)); |
367 |
|
connect(eEG2StateOptions.checkBoxAttack, mp.pmember); |
368 |
|
} |
369 |
|
{ |
370 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackHoldCancel)); |
371 |
|
connect(eEG2StateOptions.checkBoxAttackHold, mp.pmember); |
372 |
|
} |
373 |
|
{ |
374 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay1Cancel)); |
375 |
|
connect(eEG2StateOptions.checkBoxDecay1, mp.pmember); |
376 |
|
} |
377 |
|
{ |
378 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay2Cancel)); |
379 |
|
connect(eEG2StateOptions.checkBoxDecay2, mp.pmember); |
380 |
|
} |
381 |
|
{ |
382 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.ReleaseCancel)); |
383 |
|
connect(eEG2StateOptions.checkBoxRelease, mp.pmember); |
384 |
|
} |
385 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
386 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
387 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
429 |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
430 |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
431 |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
432 |
|
connect(eSustainReleaseTrigger, &gig::DimensionRegion::SustainReleaseTrigger); |
433 |
|
connect(eNoNoteOffReleaseTrigger, &gig::DimensionRegion::NoNoteOffReleaseTrigger); |
434 |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
435 |
connect(ePan, &gig::DimensionRegion::Pan); |
connect(ePan, &gig::DimensionRegion::Pan); |
436 |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
459 |
); |
); |
460 |
|
|
461 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
462 |
|
#if USE_GTKMM_GRID |
463 |
|
table[i] = new Gtk::Grid; |
464 |
|
table[i]->set_column_spacing(7); |
465 |
|
#else |
466 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
467 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
468 |
|
#endif |
469 |
|
|
470 |
|
// on Gtk 3 there is absolutely no margin by default |
471 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
472 |
|
# if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12 |
473 |
|
table[i]->set_margin_left(12); |
474 |
|
table[i]->set_margin_right(12); |
475 |
|
# else |
476 |
|
table[i]->set_margin_start(12); |
477 |
|
table[i]->set_margin_end(12); |
478 |
|
# endif |
479 |
|
#endif |
480 |
} |
} |
481 |
|
|
482 |
// set tooltips |
// set tooltips |
582 |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
583 |
#endif |
#endif |
584 |
addProp(eUnityNote); |
addProp(eUnityNote); |
585 |
|
addProp(eSampleGroup); |
586 |
addProp(eSampleFormatInfo); |
addProp(eSampleFormatInfo); |
587 |
addProp(eSampleID); |
addProp(eSampleID); |
588 |
|
addProp(eChecksum); |
589 |
addRightHandSide(buttonSelectSample); |
addRightHandSide(buttonSelectSample); |
590 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
591 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
627 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
628 |
addProp(eEG1ControllerDecayInfluence); |
addProp(eEG1ControllerDecayInfluence); |
629 |
addProp(eEG1ControllerReleaseInfluence); |
addProp(eEG1ControllerReleaseInfluence); |
630 |
|
addLine(eEG1StateOptions); |
631 |
|
|
632 |
nextPage(); |
nextPage(); |
633 |
|
|
661 |
|
|
662 |
Gtk::Frame* frame = new Gtk::Frame; |
Gtk::Frame* frame = new Gtk::Frame; |
663 |
frame->add(crossfade_curve); |
frame->add(crossfade_curve); |
664 |
|
// on Gtk 3 there is no margin at all by default |
665 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
666 |
|
frame->set_margin_top(12); |
667 |
|
frame->set_margin_bottom(12); |
668 |
|
#endif |
669 |
|
#if USE_GTKMM_GRID |
670 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
671 |
|
#else |
672 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
673 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
674 |
|
#endif |
675 |
rowno++; |
rowno++; |
676 |
|
|
677 |
eCrossfade_in_start.signal_value_changed().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
745 |
|
|
746 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
747 |
frame->add(cutoff_curve); |
frame->add(cutoff_curve); |
748 |
|
// on Gtk 3 there is no margin at all by default |
749 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
750 |
|
frame->set_margin_top(12); |
751 |
|
frame->set_margin_bottom(12); |
752 |
|
#endif |
753 |
|
#if USE_GTKMM_GRID |
754 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
755 |
|
#else |
756 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
757 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
758 |
|
#endif |
759 |
rowno++; |
rowno++; |
760 |
|
|
761 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
791 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
792 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
793 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
794 |
|
addLine(eEG2StateOptions); |
795 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
796 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
797 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
856 |
|
|
857 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
858 |
frame->add(velocity_curve); |
frame->add(velocity_curve); |
859 |
|
// on Gtk 3 there is no margin at all by default |
860 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
861 |
|
frame->set_margin_top(12); |
862 |
|
frame->set_margin_bottom(12); |
863 |
|
#endif |
864 |
|
#if USE_GTKMM_GRID |
865 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
866 |
|
#else |
867 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
868 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
869 |
|
#endif |
870 |
rowno++; |
rowno++; |
871 |
|
|
872 |
addHeader(_("Release Velocity Response")); |
addHeader(_("Release Velocity Response")); |
881 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
882 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
883 |
frame->add(release_curve); |
frame->add(release_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(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
898 |
{ |
{ |
899 |
|
const char* choices[] = { _("off"), _("on (max. velocity)"), _("on (key velocity)"), 0 }; |
900 |
|
static const gig::sust_rel_trg_t values[] = { |
901 |
|
gig::sust_rel_trg_none, |
902 |
|
gig::sust_rel_trg_maxvelocity, |
903 |
|
gig::sust_rel_trg_keyvelocity |
904 |
|
}; |
905 |
|
eSustainReleaseTrigger.set_choices(choices, values); |
906 |
|
} |
907 |
|
eSustainReleaseTrigger.set_tip(_( |
908 |
|
"By default release trigger samples are played on note-off events only. " |
909 |
|
"This option allows to play release trigger sample on sustain pedal up " |
910 |
|
"events as well. NOTE: This is a format extension!" |
911 |
|
)); |
912 |
|
addProp(eSustainReleaseTrigger); |
913 |
|
{ |
914 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
915 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
916 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
919 |
}; |
}; |
920 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
921 |
} |
} |
922 |
|
eNoNoteOffReleaseTrigger.set_tip(_( |
923 |
|
"By default release trigger samples are played on note-off events only. " |
924 |
|
"If this option is checked, then no release trigger sample is played " |
925 |
|
"when releasing a note. NOTE: This is a format extension!" |
926 |
|
)); |
927 |
|
addProp(eNoNoteOffReleaseTrigger); |
928 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
929 |
eSelfMask.widget.set_tooltip_text(_( |
eSelfMask.widget.set_tooltip_text(_( |
930 |
"If enabled: new notes with higher velocity value will stop older " |
"If enabled: new notes with higher velocity value will stop older " |
997 |
append_page(*table[4], _("Filter (2)")); |
append_page(*table[4], _("Filter (2)")); |
998 |
append_page(*table[5], _("Pitch")); |
append_page(*table[5], _("Pitch")); |
999 |
append_page(*table[6], _("Misc")); |
append_page(*table[6], _("Misc")); |
1000 |
|
|
1001 |
|
Settings::singleton()->showTooltips.get_proxy().signal_changed().connect( |
1002 |
|
sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed) |
1003 |
|
); |
1004 |
|
|
1005 |
|
on_show_tooltips_changed(); |
1006 |
} |
} |
1007 |
|
|
1008 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
1013 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
1014 |
{ |
{ |
1015 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1016 |
|
#if HAS_GTKMM_ALIGNMENT |
1017 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1018 |
|
#else |
1019 |
|
label->set_halign(Gtk::Align::START); |
1020 |
|
#endif |
1021 |
|
|
1022 |
|
#if USE_GTKMM_GRID |
1023 |
|
table[pageno]->attach(*label, 1, rowno); |
1024 |
|
#else |
1025 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1026 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1027 |
|
#endif |
1028 |
|
|
1029 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
1030 |
|
|
1031 |
|
#if USE_GTKMM_GRID |
1032 |
|
table[pageno]->attach(*widget, 2, rowno); |
1033 |
|
#else |
1034 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
1035 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1036 |
|
#endif |
1037 |
|
|
1038 |
rowno++; |
rowno++; |
1039 |
} |
} |
1042 |
Gtk::Entry*& widget, Gtk::Button*& button) |
Gtk::Entry*& widget, Gtk::Button*& button) |
1043 |
{ |
{ |
1044 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1045 |
|
#if HAS_GTKMM_ALIGNMENT |
1046 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1047 |
|
#else |
1048 |
|
label->set_halign(Gtk::Align::START); |
1049 |
|
#endif |
1050 |
|
|
1051 |
|
#if USE_GTKMM_GRID |
1052 |
|
table[pageno]->attach(*label, 1, rowno); |
1053 |
|
#else |
1054 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1055 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1056 |
|
#endif |
1057 |
|
|
1058 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
1059 |
button = new Gtk::Button(); |
button = new Gtk::Button(); |
1060 |
|
|
1061 |
Gtk::HBox* hbox = new Gtk::HBox; |
HBox* hbox = new HBox; |
1062 |
hbox->pack_start(*widget); |
hbox->pack_start(*widget); |
1063 |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
1064 |
|
|
1065 |
|
#if USE_GTKMM_GRID |
1066 |
|
table[pageno]->attach(*hbox, 2, rowno); |
1067 |
|
#else |
1068 |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
1069 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1070 |
|
#endif |
1071 |
|
|
1072 |
rowno++; |
rowno++; |
1073 |
} |
} |
1077 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1078 |
{ |
{ |
1079 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1080 |
|
#if USE_GTKMM_GRID |
1081 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1082 |
|
#else |
1083 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1084 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1085 |
|
#endif |
1086 |
} |
} |
1087 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1088 |
str += text; |
str += text; |
1089 |
str += "</b>"; |
str += "</b>"; |
1090 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1091 |
label->set_use_markup(); |
label->set_use_markup(); |
1092 |
|
#if HAS_GTKMM_ALIGNMENT |
1093 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1094 |
|
#else |
1095 |
|
label->set_halign(Gtk::Align::START); |
1096 |
|
#endif |
1097 |
|
// on GTKMM 3 there is absolutely no margin by default |
1098 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1099 |
|
label->set_margin_top(18); |
1100 |
|
label->set_margin_bottom(13); |
1101 |
|
#endif |
1102 |
|
#if USE_GTKMM_GRID |
1103 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1104 |
|
#else |
1105 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1106 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1107 |
|
#endif |
1108 |
rowno++; |
rowno++; |
1109 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1110 |
return label; |
return label; |
1111 |
} |
} |
1112 |
|
|
1113 |
|
void DimRegionEdit::on_show_tooltips_changed() { |
1114 |
|
const bool b = Settings::singleton()->showTooltips; |
1115 |
|
|
1116 |
|
buttonSelectSample.set_has_tooltip(b); |
1117 |
|
buttonNullSampleReference->set_has_tooltip(b); |
1118 |
|
wSample->set_has_tooltip(b); |
1119 |
|
|
1120 |
|
eEG1StateOptions.on_show_tooltips_changed(); |
1121 |
|
eEG2StateOptions.on_show_tooltips_changed(); |
1122 |
|
|
1123 |
|
set_has_tooltip(b); |
1124 |
|
} |
1125 |
|
|
1126 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
1127 |
{ |
{ |
1128 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1129 |
{ |
{ |
1130 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1131 |
|
#if USE_GTKMM_GRID |
1132 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1133 |
|
#else |
1134 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1135 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1136 |
|
#endif |
1137 |
} |
} |
1138 |
pageno++; |
pageno++; |
1139 |
rowno = 0; |
rowno = 0; |
1142 |
|
|
1143 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1144 |
{ |
{ |
1145 |
|
#if USE_GTKMM_GRID |
1146 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1147 |
|
#else |
1148 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1149 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1150 |
|
#endif |
1151 |
rowno++; |
rowno++; |
1152 |
} |
} |
1153 |
|
|
1154 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1155 |
{ |
{ |
1156 |
|
#if USE_GTKMM_GRID |
1157 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1158 |
|
#else |
1159 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1160 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1161 |
|
#endif |
1162 |
rowno++; |
rowno++; |
1163 |
} |
} |
1164 |
|
|
1165 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1166 |
{ |
{ |
1167 |
|
#if USE_GTKMM_GRID |
1168 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1169 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1170 |
|
#else |
1171 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1172 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1173 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1174 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1175 |
|
#endif |
1176 |
|
rowno++; |
1177 |
|
} |
1178 |
|
|
1179 |
|
void DimRegionEdit::addLine(HBox& line) |
1180 |
|
{ |
1181 |
|
#if USE_GTKMM_GRID |
1182 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1183 |
|
#else |
1184 |
|
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1185 |
|
Gtk::FILL, Gtk::SHRINK); |
1186 |
|
#endif |
1187 |
rowno++; |
rowno++; |
1188 |
} |
} |
1189 |
|
|
1190 |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1191 |
{ |
{ |
1192 |
|
#if USE_GTKMM_GRID |
1193 |
|
table[pageno]->attach(widget, 2, rowno); |
1194 |
|
#else |
1195 |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1196 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1197 |
|
#endif |
1198 |
rowno++; |
rowno++; |
1199 |
} |
} |
1200 |
|
|
1223 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1224 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1225 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1226 |
|
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1227 |
|
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1228 |
|
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1229 |
|
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1230 |
|
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1231 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1232 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1233 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1246 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1247 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1248 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1249 |
|
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1250 |
|
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1251 |
|
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1252 |
|
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1253 |
|
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1254 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1255 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1256 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1288 |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
1289 |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
1290 |
ePitchTrack.set_value(d->PitchTrack); |
ePitchTrack.set_value(d->PitchTrack); |
1291 |
|
eSustainReleaseTrigger.set_value(d->SustainReleaseTrigger); |
1292 |
|
eNoNoteOffReleaseTrigger.set_value(d->NoNoteOffReleaseTrigger); |
1293 |
eDimensionBypass.set_value(d->DimensionBypass); |
eDimensionBypass.set_value(d->DimensionBypass); |
1294 |
ePan.set_value(d->Pan); |
ePan.set_value(d->Pan); |
1295 |
eSelfMask.set_value(d->SelfMask); |
eSelfMask.set_value(d->SelfMask); |
1301 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1302 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1303 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1304 |
|
// show sample group name |
1305 |
|
{ |
1306 |
|
Glib::ustring s = "---"; |
1307 |
|
if (d->pSample && d->pSample->GetGroup()) |
1308 |
|
s = d->pSample->GetGroup()->Name; |
1309 |
|
eSampleGroup.text.set_text(s); |
1310 |
|
} |
1311 |
// assemble sample format info string |
// assemble sample format info string |
1312 |
{ |
{ |
1313 |
Glib::ustring s; |
Glib::ustring s; |
1339 |
} |
} |
1340 |
eSampleID.text.set_text(s); |
eSampleID.text.set_text(s); |
1341 |
} |
} |
1342 |
|
// generate raw wave form data CRC-32 checksum string |
1343 |
|
{ |
1344 |
|
Glib::ustring s = "---"; |
1345 |
|
if (d->pSample) { |
1346 |
|
char buf[64] = {}; |
1347 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1348 |
|
s = buf; |
1349 |
|
} |
1350 |
|
eChecksum.text.set_text(s); |
1351 |
|
} |
1352 |
buttonSelectSample.set_sensitive(d && d->pSample); |
buttonSelectSample.set_sensitive(d && d->pSample); |
1353 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1354 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1398 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1399 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1400 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1401 |
|
eEG2StateOptions.set_sensitive(sensitive); |
1402 |
lLFO2->set_sensitive(sensitive); |
lLFO2->set_sensitive(sensitive); |
1403 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
1404 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
1592 |
|
|
1593 |
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) |
1594 |
{ |
{ |
1595 |
if (dimregion) { |
bool result = false; |
1596 |
|
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1597 |
|
itDimReg != dimregs.end(); ++itDimReg) |
1598 |
|
{ |
1599 |
|
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1600 |
|
} |
1601 |
|
return result; |
1602 |
|
} |
1603 |
|
|
1604 |
|
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1605 |
|
{ |
1606 |
|
if (dimreg) { |
1607 |
//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 |
1608 |
|
|
1609 |
// 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() |
1610 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1611 |
|
|
1612 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1613 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1614 |
int nbDimregs = 1; |
int nbDimregs = 1; |
1615 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1616 |
if (sample->Channels == 2) { |
if (sample->Channels == 2) { |
1617 |
gig::Region* region = dimregion->GetParent(); |
gig::Region* region = dimreg->GetParent(); |
1618 |
|
|
1619 |
int bitcount = 0; |
int bitcount = 0; |
1620 |
int stereo_bit = 0; |
int stereo_bit = 0; |
1629 |
if (stereo_bit) { |
if (stereo_bit) { |
1630 |
int dimregno; |
int dimregno; |
1631 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1632 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1633 |
break; |
break; |
1634 |
} |
} |
1635 |
} |
} |
1639 |
} |
} |
1640 |
} |
} |
1641 |
|
|
1642 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimreg->pSample; |
1643 |
|
|
1644 |
for (int i = 0 ; i < nbDimregs ; i++) { |
for (int i = 0 ; i < nbDimregs ; i++) { |
1645 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1669 |
|
|
1670 |
// update ui |
// update ui |
1671 |
update_model++; |
update_model++; |
1672 |
wSample->set_text(gig_to_utf8(dimregion->pSample->pInfo->Name)); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1673 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1674 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1675 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1676 |
update_loop_elements(); |
update_loop_elements(); |
1677 |
update_model--; |
update_model--; |
1678 |
|
|
1679 |
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); |
|
1680 |
return true; |
return true; |
1681 |
} |
} |
1682 |
return false; |
return false; |
1745 |
if (value) { |
if (value) { |
1746 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1747 |
if (!d->SampleLoops) { |
if (!d->SampleLoops) { |
1748 |
|
DimRegionChangeGuard(this, d); |
1749 |
|
|
1750 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1751 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1752 |
// loop the whole sample by default |
// loop the whole sample by default |
1753 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1754 |
loop.LoopLength = |
loop.LoopLength = |
1755 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
|
dimreg_to_be_changed_signal.emit(d); |
|
1756 |
d->AddSampleLoop(&loop); |
d->AddSampleLoop(&loop); |
|
dimreg_changed_signal.emit(d); |
|
1757 |
} |
} |
1758 |
} else { |
} else { |
1759 |
if (d->SampleLoops) { |
if (d->SampleLoops) { |
1760 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, d); |
1761 |
|
|
1762 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1763 |
while (d->SampleLoops) { |
while (d->SampleLoops) { |
1764 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1765 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1766 |
} |
} |
1767 |
} |
} |
1768 |
} |
} |
1812 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimregion->pSample; |
1813 |
if (!oldref) return; |
if (!oldref) return; |
1814 |
|
|
1815 |
dimreg_to_be_changed_signal.emit(dimregion); |
DimRegionChangeGuard(this, dimregion); |
1816 |
|
|
1817 |
// in case currently assigned sample is a stereo one, then remove both |
// in case currently assigned sample is a stereo one, then remove both |
1818 |
// references (expected to be due to a "stereo dimension") |
// references (expected to be due to a "stereo dimension") |
1850 |
set_dim_region(dimregion); |
set_dim_region(dimregion); |
1851 |
|
|
1852 |
sample_ref_changed_signal.emit(oldref, NULL); |
sample_ref_changed_signal.emit(oldref, NULL); |
|
dimreg_changed_signal.emit(dimregion); |
|
1853 |
} |
} |
1854 |
|
|
1855 |
void DimRegionEdit::onButtonSelectSamplePressed() { |
void DimRegionEdit::onButtonSelectSamplePressed() { |