1 |
/* |
/* |
2 |
* Copyright (C) 2006-2013 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); |
102 |
} |
} |
103 |
} |
} |
104 |
int bitcount = 0; |
int bitcount = 0; |
|
int layer_bit = 0; |
|
105 |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
106 |
if (region->pDimensionDefinitions[dim].dimension == |
if (region->pDimensionDefinitions[dim].dimension == |
107 |
gig::dimension_layer) { |
gig::dimension_layer) { |
|
layer_bit = 1 << bitcount; |
|
|
|
|
108 |
int mask = |
int mask = |
109 |
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
110 |
bitcount); |
bitcount); |
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), |
206 |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
207 |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
eEG1PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
208 |
eEG1Attack(_("Attack"), 0, 60, 3), |
eEG1Attack(_("Attack Time (seconds)"), 0, 60, 3), |
209 |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
eEG1Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
210 |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
eEG1Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
211 |
eEG1InfiniteSustain(_("Infinite sustain")), |
eEG1InfiniteSustain(_("Infinite sustain")), |
212 |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
eEG1Sustain(_("Sustain Level (%)"), 0, 100, 2), |
213 |
eEG1Release(_("Release"), 0, 60, 3), |
eEG1Release(_("Release Time (seconds)"), 0, 60, 3), |
214 |
eEG1Hold(_("Hold")), |
eEG1Hold(_("Hold Attack Stage until Loop End")), |
215 |
eEG1Controller(_("Controller")), |
eEG1Controller(_("Controller")), |
216 |
eEG1ControllerInvert(_("Controller invert")), |
eEG1ControllerInvert(_("Controller invert")), |
217 |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
223 |
eLFO1Controller(_("Controller")), |
eLFO1Controller(_("Controller")), |
224 |
eLFO1FlipPhase(_("Flip phase")), |
eLFO1FlipPhase(_("Flip phase")), |
225 |
eLFO1Sync(_("Sync")), |
eLFO1Sync(_("Sync")), |
226 |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
eEG2PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
227 |
eEG2Attack(_("Attack"), 0, 60, 3), |
eEG2Attack(_("Attack Time (seconds)"), 0, 60, 3), |
228 |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
eEG2Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
229 |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
eEG2Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
230 |
eEG2InfiniteSustain(_("Infinite sustain")), |
eEG2InfiniteSustain(_("Infinite sustain")), |
231 |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
eEG2Sustain(_("Sustain Level (%)"), 0, 100, 2), |
232 |
eEG2Release(_("Release"), 0, 60, 3), |
eEG2Release(_("Release Time (seconds)"), 0, 60, 3), |
233 |
eEG2Controller(_("Controller")), |
eEG2Controller(_("Controller")), |
234 |
eEG2ControllerInvert(_("Controller invert")), |
eEG2ControllerInvert(_("Controller invert")), |
235 |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
274 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
275 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
276 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
277 |
eSelfMask(_("Self mask")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
278 |
eAttenuationController(_("Attenuation controller")), |
eAttenuationController(_("Attenuation controller")), |
279 |
eInvertAttenuationController(_("Invert attenuation controller")), |
eInvertAttenuationController(_("Invert attenuation controller")), |
280 |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
281 |
eChannelOffset(_("Channel offset"), 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
282 |
eSustainDefeat(_("Sustain defeat")), |
eSustainDefeat(_("Ignore Hold Pedal (a.k.a. \"Sustain defeat\")")), |
283 |
eMSDecode(_("MS decode")), |
eMSDecode(_("Decode Mid/Side Recordings")), |
284 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
285 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
286 |
|
eSampleGroup(_("Sample Group")), |
287 |
|
eSampleFormatInfo(_("Sample Format")), |
288 |
|
eSampleID("Sample ID"), |
289 |
|
eChecksum("Wave Data CRC-32"), |
290 |
eFineTune(_("Fine tune"), -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
291 |
eGain(_("Gain"), -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
292 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
293 |
eSampleLoopEnabled(_("Enabled")), |
eSampleLoopEnabled(_("Enabled")), |
294 |
eSampleLoopStart(_("Loop start positon")), |
eSampleLoopStart(_("Loop start position")), |
295 |
eSampleLoopLength(_("Loop size")), |
eSampleLoopLength(_("Loop size")), |
296 |
eSampleLoopType(_("Loop type")), |
eSampleLoopType(_("Loop type")), |
297 |
eSampleLoopInfinite(_("Infinite loop")), |
eSampleLoopInfinite(_("Infinite loop")), |
298 |
eSampleLoopPlayCount(_("Playback count"), 1), |
eSampleLoopPlayCount(_("Playback count"), 1), |
299 |
|
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
300 |
update_model(0) |
update_model(0) |
301 |
{ |
{ |
302 |
|
// make synthesis parameter page tabs scrollable |
303 |
|
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
304 |
|
set_scrollable(); |
305 |
|
|
306 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
307 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
308 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
319 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
320 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
321 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
322 |
|
{ |
323 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackCancel)); |
324 |
|
connect(eEG1StateOptions.checkBoxAttack, mp.pmember); |
325 |
|
} |
326 |
|
{ |
327 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackHoldCancel)); |
328 |
|
connect(eEG1StateOptions.checkBoxAttackHold, mp.pmember); |
329 |
|
} |
330 |
|
{ |
331 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay1Cancel)); |
332 |
|
connect(eEG1StateOptions.checkBoxDecay1, mp.pmember); |
333 |
|
} |
334 |
|
{ |
335 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay2Cancel)); |
336 |
|
connect(eEG1StateOptions.checkBoxDecay2, mp.pmember); |
337 |
|
} |
338 |
|
{ |
339 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.ReleaseCancel)); |
340 |
|
connect(eEG1StateOptions.checkBoxRelease, mp.pmember); |
341 |
|
} |
342 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
343 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
344 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
360 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
361 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
362 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
363 |
|
{ |
364 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackCancel)); |
365 |
|
connect(eEG2StateOptions.checkBoxAttack, mp.pmember); |
366 |
|
} |
367 |
|
{ |
368 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackHoldCancel)); |
369 |
|
connect(eEG2StateOptions.checkBoxAttackHold, mp.pmember); |
370 |
|
} |
371 |
|
{ |
372 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay1Cancel)); |
373 |
|
connect(eEG2StateOptions.checkBoxDecay1, mp.pmember); |
374 |
|
} |
375 |
|
{ |
376 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay2Cancel)); |
377 |
|
connect(eEG2StateOptions.checkBoxDecay2, mp.pmember); |
378 |
|
} |
379 |
|
{ |
380 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.ReleaseCancel)); |
381 |
|
connect(eEG2StateOptions.checkBoxRelease, mp.pmember); |
382 |
|
} |
383 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
384 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
385 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
450 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
451 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
452 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
453 |
|
buttonSelectSample.signal_clicked().connect( |
454 |
|
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
455 |
|
); |
456 |
|
|
457 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
458 |
|
#if USE_GTKMM_GRID |
459 |
|
table[i] = new Gtk::Grid; |
460 |
|
table[i]->set_column_spacing(7); |
461 |
|
#else |
462 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
463 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
464 |
|
#endif |
465 |
|
|
466 |
|
// on Gtk 3 there is absolutely no margin by default |
467 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
468 |
|
# if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12 |
469 |
|
table[i]->set_margin_left(12); |
470 |
|
table[i]->set_margin_right(12); |
471 |
|
# else |
472 |
|
table[i]->set_margin_start(12); |
473 |
|
table[i]->set_margin_end(12); |
474 |
|
# endif |
475 |
|
#endif |
476 |
} |
} |
477 |
|
|
478 |
// set tooltips |
// set tooltips |
479 |
eUnityNote.set_tip( |
eUnityNote.set_tip( |
480 |
_("Note this sample is associated with (a.k.a. 'root note')") |
_("Note this sample is associated with (a.k.a. 'root note')") |
481 |
); |
); |
482 |
|
buttonSelectSample.set_tooltip_text( |
483 |
|
_("Selects the sample of this dimension region on the left hand side's sample tree view.") |
484 |
|
); |
485 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
486 |
ePan.set_tip(_("Stereo balance (left/right)")); |
ePan.set_tip(_("Stereo balance (left/right)")); |
487 |
eChannelOffset.set_tip( |
eChannelOffset.set_tip( |
512 |
"Caution: this setting is stored on Sample side, thus is shared " |
"Caution: this setting is stored on Sample side, thus is shared " |
513 |
"among all dimension regions that use this sample!") |
"among all dimension regions that use this sample!") |
514 |
); |
); |
515 |
|
|
516 |
|
eEG1PreAttack.set_tip( |
517 |
|
"Very first level this EG starts with. It rises then in Attack Time " |
518 |
|
"seconds from this initial level to 100%." |
519 |
|
); |
520 |
|
eEG1Attack.set_tip( |
521 |
|
"Duration of the EG's Attack stage, which raises its level from " |
522 |
|
"Pre-Attack Level to 100%." |
523 |
|
); |
524 |
|
eEG1Hold.set_tip( |
525 |
|
"On looped sounds, enabling this will cause the Decay 1 stage not to " |
526 |
|
"enter before the loop has been passed one time." |
527 |
|
); |
528 |
|
eAttenuationController.set_tip(_( |
529 |
|
"If you are not using the 'Layer' dimension, then this controller " |
530 |
|
"simply alters the volume. If you are using the 'Layer' dimension, " |
531 |
|
"then this controller is controlling the crossfade between Layers in " |
532 |
|
"real-time." |
533 |
|
)); |
534 |
|
|
535 |
|
eLFO1Sync.set_tip( |
536 |
|
"If not checked, every voice will use its own LFO instance, which " |
537 |
|
"causes voices triggered at different points in time to have different " |
538 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
539 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
540 |
|
"no matter when the individual notes have been triggered." |
541 |
|
); |
542 |
|
eLFO2Sync.set_tip( |
543 |
|
"If not checked, every voice will use its own LFO instance, which " |
544 |
|
"causes voices triggered at different points in time to have different " |
545 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
546 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
547 |
|
"no matter when the individual notes have been triggered." |
548 |
|
); |
549 |
|
eLFO3Sync.set_tip( |
550 |
|
"If not checked, every voice will use its own LFO instance, which " |
551 |
|
"causes voices triggered at different points in time to have different " |
552 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
553 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
554 |
|
"no matter when the individual notes have been triggered." |
555 |
|
); |
556 |
|
eLFO1FlipPhase.set_tip( |
557 |
|
"Inverts the LFO's generated wave vertically." |
558 |
|
); |
559 |
|
eLFO2FlipPhase.set_tip( |
560 |
|
"Inverts the LFO's generated wave vertically." |
561 |
|
); |
562 |
|
|
563 |
pageno = 0; |
pageno = 0; |
564 |
rowno = 0; |
rowno = 0; |
565 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
566 |
|
|
567 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
568 |
addString(_("Sample"), lSample, wSample); |
addString(_("Sample"), lSample, wSample, buttonNullSampleReference); |
569 |
|
buttonNullSampleReference->set_label("X"); |
570 |
|
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.")); |
571 |
|
buttonNullSampleReference->signal_clicked().connect( |
572 |
|
sigc::mem_fun(*this, &DimRegionEdit::nullOutSampleReference) |
573 |
|
); |
574 |
//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); |
575 |
#ifdef OLD_TOOLTIPS |
#ifdef OLD_TOOLTIPS |
576 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
577 |
#else |
#else |
578 |
wSample->set_tooltip_text(_("Drop a sample here")); |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
579 |
#endif |
#endif |
580 |
addProp(eUnityNote); |
addProp(eUnityNote); |
581 |
|
addProp(eSampleGroup); |
582 |
|
addProp(eSampleFormatInfo); |
583 |
|
addProp(eSampleID); |
584 |
|
addProp(eChecksum); |
585 |
|
addRightHandSide(buttonSelectSample); |
586 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
587 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
588 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
612 |
addHeader(_("Amplitude Envelope (EG1)")); |
addHeader(_("Amplitude Envelope (EG1)")); |
613 |
addProp(eEG1PreAttack); |
addProp(eEG1PreAttack); |
614 |
addProp(eEG1Attack); |
addProp(eEG1Attack); |
615 |
|
addProp(eEG1Hold); |
616 |
addProp(eEG1Decay1); |
addProp(eEG1Decay1); |
617 |
addProp(eEG1Decay2); |
addProp(eEG1Decay2); |
618 |
addProp(eEG1InfiniteSustain); |
addProp(eEG1InfiniteSustain); |
619 |
addProp(eEG1Sustain); |
addProp(eEG1Sustain); |
620 |
addProp(eEG1Release); |
addProp(eEG1Release); |
|
addProp(eEG1Hold); |
|
621 |
addProp(eEG1Controller); |
addProp(eEG1Controller); |
622 |
addProp(eEG1ControllerInvert); |
addProp(eEG1ControllerInvert); |
623 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
624 |
addProp(eEG1ControllerDecayInfluence); |
addProp(eEG1ControllerDecayInfluence); |
625 |
addProp(eEG1ControllerReleaseInfluence); |
addProp(eEG1ControllerReleaseInfluence); |
626 |
|
addLine(eEG1StateOptions); |
627 |
|
|
628 |
nextPage(); |
nextPage(); |
629 |
|
|
657 |
|
|
658 |
Gtk::Frame* frame = new Gtk::Frame; |
Gtk::Frame* frame = new Gtk::Frame; |
659 |
frame->add(crossfade_curve); |
frame->add(crossfade_curve); |
660 |
|
// on Gtk 3 there is no margin at all by default |
661 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
662 |
|
frame->set_margin_top(12); |
663 |
|
frame->set_margin_bottom(12); |
664 |
|
#endif |
665 |
|
#if USE_GTKMM_GRID |
666 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
667 |
|
#else |
668 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
669 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
670 |
|
#endif |
671 |
rowno++; |
rowno++; |
672 |
|
|
673 |
eCrossfade_in_start.signal_value_changed().connect( |
eCrossfade_in_start.signal_value_changed().connect( |
741 |
|
|
742 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
743 |
frame->add(cutoff_curve); |
frame->add(cutoff_curve); |
744 |
|
// on Gtk 3 there is no margin at all by default |
745 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
746 |
|
frame->set_margin_top(12); |
747 |
|
frame->set_margin_bottom(12); |
748 |
|
#endif |
749 |
|
#if USE_GTKMM_GRID |
750 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
751 |
|
#else |
752 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
753 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
754 |
|
#endif |
755 |
rowno++; |
rowno++; |
756 |
|
|
757 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
787 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
788 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
789 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
790 |
|
addLine(eEG2StateOptions); |
791 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
792 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
793 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
837 |
|
|
838 |
nextPage(); |
nextPage(); |
839 |
|
|
840 |
addHeader(_("Velocity Reponse")); |
addHeader(_("Velocity Response")); |
841 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
842 |
addProp(eVelocityResponseCurve); |
addProp(eVelocityResponseCurve); |
843 |
addProp(eVelocityResponseDepth); |
addProp(eVelocityResponseDepth); |
852 |
|
|
853 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
854 |
frame->add(velocity_curve); |
frame->add(velocity_curve); |
855 |
|
// on Gtk 3 there is no margin at all by default |
856 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
857 |
|
frame->set_margin_top(12); |
858 |
|
frame->set_margin_bottom(12); |
859 |
|
#endif |
860 |
|
#if USE_GTKMM_GRID |
861 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
862 |
|
#else |
863 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
864 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
865 |
|
#endif |
866 |
rowno++; |
rowno++; |
867 |
|
|
868 |
addHeader(_("Release Velocity Reponse")); |
addHeader(_("Release Velocity Response")); |
869 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
870 |
curve_type_values); |
curve_type_values); |
871 |
addProp(eReleaseVelocityResponseCurve); |
addProp(eReleaseVelocityResponseCurve); |
877 |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
878 |
frame = new Gtk::Frame; |
frame = new Gtk::Frame; |
879 |
frame->add(release_curve); |
frame->add(release_curve); |
880 |
|
// on Gtk 3 there is no margin at all by default |
881 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
882 |
|
frame->set_margin_top(12); |
883 |
|
frame->set_margin_bottom(12); |
884 |
|
#endif |
885 |
|
#if USE_GTKMM_GRID |
886 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
887 |
|
#else |
888 |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
889 |
Gtk::SHRINK, Gtk::SHRINK); |
Gtk::SHRINK, Gtk::SHRINK); |
890 |
|
#endif |
891 |
rowno++; |
rowno++; |
892 |
|
|
893 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
901 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
902 |
} |
} |
903 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
904 |
|
eSelfMask.widget.set_tooltip_text(_( |
905 |
|
"If enabled: new notes with higher velocity value will stop older " |
906 |
|
"notes with lower velocity values, that way you can save voices that " |
907 |
|
"would barely be audible. This is also useful for certain drum sounds." |
908 |
|
)); |
909 |
addProp(eSelfMask); |
addProp(eSelfMask); |
910 |
|
eSustainDefeat.widget.set_tooltip_text(_( |
911 |
|
"If enabled: sustain pedal will not hold a note. This way you can use " |
912 |
|
"the sustain pedal for other purposes, for example to switch among " |
913 |
|
"dimension regions." |
914 |
|
)); |
915 |
addProp(eSustainDefeat); |
addProp(eSustainDefeat); |
916 |
|
eMSDecode.widget.set_tooltip_text(_( |
917 |
|
"Defines if Mid/Side Recordings should be decoded. Mid/Side Recordings " |
918 |
|
"are an alternative way to record sounds in stereo. The sampler needs " |
919 |
|
"to decode such samples to actually make use of them. Note: this " |
920 |
|
"feature is currently not supported by LinuxSampler." |
921 |
|
)); |
922 |
addProp(eMSDecode); |
addProp(eMSDecode); |
923 |
|
|
924 |
nextPage(); |
nextPage(); |
972 |
append_page(*table[4], _("Filter (2)")); |
append_page(*table[4], _("Filter (2)")); |
973 |
append_page(*table[5], _("Pitch")); |
append_page(*table[5], _("Pitch")); |
974 |
append_page(*table[6], _("Misc")); |
append_page(*table[6], _("Misc")); |
975 |
|
|
976 |
|
Settings::singleton()->showTooltips.get_proxy().signal_changed().connect( |
977 |
|
sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed) |
978 |
|
); |
979 |
|
|
980 |
|
on_show_tooltips_changed(); |
981 |
} |
} |
982 |
|
|
983 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
988 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
989 |
{ |
{ |
990 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
991 |
|
#if HAS_GTKMM_ALIGNMENT |
992 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
993 |
|
#else |
994 |
|
label->set_halign(Gtk::Align::START); |
995 |
|
#endif |
996 |
|
|
997 |
|
#if USE_GTKMM_GRID |
998 |
|
table[pageno]->attach(*label, 1, rowno); |
999 |
|
#else |
1000 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1001 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1002 |
|
#endif |
1003 |
|
|
1004 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
1005 |
|
|
1006 |
|
#if USE_GTKMM_GRID |
1007 |
|
table[pageno]->attach(*widget, 2, rowno); |
1008 |
|
#else |
1009 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
1010 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1011 |
|
#endif |
1012 |
|
|
1013 |
|
rowno++; |
1014 |
|
} |
1015 |
|
|
1016 |
|
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
1017 |
|
Gtk::Entry*& widget, Gtk::Button*& button) |
1018 |
|
{ |
1019 |
|
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1020 |
|
#if HAS_GTKMM_ALIGNMENT |
1021 |
|
label->set_alignment(Gtk::ALIGN_START); |
1022 |
|
#else |
1023 |
|
label->set_halign(Gtk::Align::START); |
1024 |
|
#endif |
1025 |
|
|
1026 |
|
#if USE_GTKMM_GRID |
1027 |
|
table[pageno]->attach(*label, 1, rowno); |
1028 |
|
#else |
1029 |
|
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1030 |
|
Gtk::FILL, Gtk::SHRINK); |
1031 |
|
#endif |
1032 |
|
|
1033 |
|
widget = new Gtk::Entry(); |
1034 |
|
button = new Gtk::Button(); |
1035 |
|
|
1036 |
|
HBox* hbox = new HBox; |
1037 |
|
hbox->pack_start(*widget); |
1038 |
|
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
1039 |
|
|
1040 |
|
#if USE_GTKMM_GRID |
1041 |
|
table[pageno]->attach(*hbox, 2, rowno); |
1042 |
|
#else |
1043 |
|
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
1044 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1045 |
|
#endif |
1046 |
|
|
1047 |
rowno++; |
rowno++; |
1048 |
} |
} |
1052 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1053 |
{ |
{ |
1054 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1055 |
|
#if USE_GTKMM_GRID |
1056 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1057 |
|
#else |
1058 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1059 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1060 |
|
#endif |
1061 |
} |
} |
1062 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1063 |
str += text; |
str += text; |
1064 |
str += "</b>"; |
str += "</b>"; |
1065 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1066 |
label->set_use_markup(); |
label->set_use_markup(); |
1067 |
|
#if HAS_GTKMM_ALIGNMENT |
1068 |
label->set_alignment(Gtk::ALIGN_START); |
label->set_alignment(Gtk::ALIGN_START); |
1069 |
|
#else |
1070 |
|
label->set_halign(Gtk::Align::START); |
1071 |
|
#endif |
1072 |
|
// on GTKMM 3 there is absolutely no margin by default |
1073 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1074 |
|
label->set_margin_top(18); |
1075 |
|
label->set_margin_bottom(13); |
1076 |
|
#endif |
1077 |
|
#if USE_GTKMM_GRID |
1078 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1079 |
|
#else |
1080 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1081 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1082 |
|
#endif |
1083 |
rowno++; |
rowno++; |
1084 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1085 |
return label; |
return label; |
1086 |
} |
} |
1087 |
|
|
1088 |
|
void DimRegionEdit::on_show_tooltips_changed() { |
1089 |
|
const bool b = Settings::singleton()->showTooltips; |
1090 |
|
|
1091 |
|
buttonSelectSample.set_has_tooltip(b); |
1092 |
|
buttonNullSampleReference->set_has_tooltip(b); |
1093 |
|
wSample->set_has_tooltip(b); |
1094 |
|
|
1095 |
|
eEG1StateOptions.on_show_tooltips_changed(); |
1096 |
|
eEG2StateOptions.on_show_tooltips_changed(); |
1097 |
|
|
1098 |
|
set_has_tooltip(b); |
1099 |
|
} |
1100 |
|
|
1101 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
1102 |
{ |
{ |
1103 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1104 |
{ |
{ |
1105 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1106 |
|
#if USE_GTKMM_GRID |
1107 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1108 |
|
#else |
1109 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1110 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1111 |
|
#endif |
1112 |
} |
} |
1113 |
pageno++; |
pageno++; |
1114 |
rowno = 0; |
rowno = 0; |
1117 |
|
|
1118 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1119 |
{ |
{ |
1120 |
|
#if USE_GTKMM_GRID |
1121 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1122 |
|
#else |
1123 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1124 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1125 |
|
#endif |
1126 |
rowno++; |
rowno++; |
1127 |
} |
} |
1128 |
|
|
1129 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1130 |
{ |
{ |
1131 |
|
#if USE_GTKMM_GRID |
1132 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1133 |
|
#else |
1134 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1135 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1136 |
|
#endif |
1137 |
rowno++; |
rowno++; |
1138 |
} |
} |
1139 |
|
|
1140 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1141 |
{ |
{ |
1142 |
|
#if USE_GTKMM_GRID |
1143 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1144 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1145 |
|
#else |
1146 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1147 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1148 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1149 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1150 |
|
#endif |
1151 |
|
rowno++; |
1152 |
|
} |
1153 |
|
|
1154 |
|
void DimRegionEdit::addLine(HBox& line) |
1155 |
|
{ |
1156 |
|
#if USE_GTKMM_GRID |
1157 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1158 |
|
#else |
1159 |
|
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1160 |
|
Gtk::FILL, Gtk::SHRINK); |
1161 |
|
#endif |
1162 |
rowno++; |
rowno++; |
1163 |
} |
} |
1164 |
|
|
1165 |
|
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1166 |
|
{ |
1167 |
|
#if USE_GTKMM_GRID |
1168 |
|
table[pageno]->attach(widget, 2, rowno); |
1169 |
|
#else |
1170 |
|
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1171 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1172 |
|
#endif |
1173 |
|
rowno++; |
1174 |
|
} |
1175 |
|
|
1176 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
1177 |
{ |
{ |
1198 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1199 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1200 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1201 |
|
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1202 |
|
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1203 |
|
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1204 |
|
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1205 |
|
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1206 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1207 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1208 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1221 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1222 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1223 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1224 |
|
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1225 |
|
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1226 |
|
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1227 |
|
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1228 |
|
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1229 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1230 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1231 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1274 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1275 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1276 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1277 |
|
// show sample group name |
1278 |
|
{ |
1279 |
|
Glib::ustring s = "---"; |
1280 |
|
if (d->pSample && d->pSample->GetGroup()) |
1281 |
|
s = d->pSample->GetGroup()->Name; |
1282 |
|
eSampleGroup.text.set_text(s); |
1283 |
|
} |
1284 |
|
// assemble sample format info string |
1285 |
|
{ |
1286 |
|
Glib::ustring s; |
1287 |
|
if (d->pSample) { |
1288 |
|
switch (d->pSample->Channels) { |
1289 |
|
case 1: s = _("Mono"); break; |
1290 |
|
case 2: s = _("Stereo"); break; |
1291 |
|
default: |
1292 |
|
s = ToString(d->pSample->Channels) + _(" audio channels"); |
1293 |
|
break; |
1294 |
|
} |
1295 |
|
s += " " + ToString(d->pSample->BitDepth) + " Bits"; |
1296 |
|
s += " " + ToString(d->pSample->SamplesPerSecond/1000) + "." |
1297 |
|
+ ToString((d->pSample->SamplesPerSecond%1000)/100) + " kHz"; |
1298 |
|
} else { |
1299 |
|
s = _("No sample assigned to this dimension region."); |
1300 |
|
} |
1301 |
|
eSampleFormatInfo.text.set_text(s); |
1302 |
|
} |
1303 |
|
// generate sample's memory address pointer string |
1304 |
|
{ |
1305 |
|
Glib::ustring s; |
1306 |
|
if (d->pSample) { |
1307 |
|
char buf[64] = {}; |
1308 |
|
snprintf(buf, sizeof(buf), "%p", d->pSample); |
1309 |
|
s = buf; |
1310 |
|
} else { |
1311 |
|
s = "---"; |
1312 |
|
} |
1313 |
|
eSampleID.text.set_text(s); |
1314 |
|
} |
1315 |
|
// generate raw wave form data CRC-32 checksum string |
1316 |
|
{ |
1317 |
|
Glib::ustring s = "---"; |
1318 |
|
if (d->pSample) { |
1319 |
|
char buf[64] = {}; |
1320 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1321 |
|
s = buf; |
1322 |
|
} |
1323 |
|
eChecksum.text.set_text(s); |
1324 |
|
} |
1325 |
|
buttonSelectSample.set_sensitive(d && d->pSample); |
1326 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1327 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1328 |
eGainPlus6.set_value(d->Gain); |
eGainPlus6.set_value(d->Gain); |
1371 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1372 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1373 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1374 |
|
eEG2StateOptions.set_sensitive(sensitive); |
1375 |
lLFO2->set_sensitive(sensitive); |
lLFO2->set_sensitive(sensitive); |
1376 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
1377 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
1563 |
update_model--; |
update_model--; |
1564 |
} |
} |
1565 |
|
|
1566 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1567 |
|
{ |
1568 |
|
bool result = false; |
1569 |
|
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1570 |
|
itDimReg != dimregs.end(); ++itDimReg) |
1571 |
|
{ |
1572 |
|
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1573 |
|
} |
1574 |
|
return result; |
1575 |
|
} |
1576 |
|
|
1577 |
|
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1578 |
{ |
{ |
1579 |
if (dimregion) { |
if (dimreg) { |
1580 |
//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 |
1581 |
|
|
1582 |
// 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() |
1583 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1584 |
|
|
1585 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1586 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1587 |
int nbDimregs = 1; |
int nbDimregs = 1; |
1588 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1589 |
if (sample->Channels == 2) { |
if (sample->Channels == 2) { |
1590 |
gig::Region* region = dimregion->GetParent(); |
gig::Region* region = dimreg->GetParent(); |
1591 |
|
|
1592 |
int bitcount = 0; |
int bitcount = 0; |
1593 |
int stereo_bit = 0; |
int stereo_bit = 0; |
1602 |
if (stereo_bit) { |
if (stereo_bit) { |
1603 |
int dimregno; |
int dimregno; |
1604 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1605 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1606 |
break; |
break; |
1607 |
} |
} |
1608 |
} |
} |
1612 |
} |
} |
1613 |
} |
} |
1614 |
|
|
1615 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimreg->pSample; |
1616 |
|
|
1617 |
for (int i = 0 ; i < nbDimregs ; i++) { |
for (int i = 0 ; i < nbDimregs ; i++) { |
1618 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1619 |
|
|
1620 |
// copy sample information from Sample to DimensionRegion |
// copy sample information from Sample to DimensionRegion |
1621 |
|
if (copy_sample_unity) |
1622 |
d[i]->UnityNote = sample->MIDIUnityNote; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1623 |
d[i]->FineTune = sample->FineTune; |
if (copy_sample_tune) |
1624 |
|
d[i]->FineTune = sample->FineTune; |
1625 |
int loops = sample->Loops ? 1 : 0; |
if (copy_sample_loop) { |
1626 |
while (d[i]->SampleLoops > loops) { |
int loops = sample->Loops ? 1 : 0; |
1627 |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
while (d[i]->SampleLoops > loops) { |
1628 |
} |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1629 |
while (d[i]->SampleLoops < sample->Loops) { |
} |
1630 |
DLS::sample_loop_t loop; |
while (d[i]->SampleLoops < sample->Loops) { |
1631 |
d[i]->AddSampleLoop(&loop); |
DLS::sample_loop_t loop; |
1632 |
} |
d[i]->AddSampleLoop(&loop); |
1633 |
if (loops) { |
} |
1634 |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
if (loops) { |
1635 |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1636 |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1637 |
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1638 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1639 |
|
} |
1640 |
} |
} |
1641 |
} |
} |
1642 |
|
|
1643 |
// update ui |
// update ui |
1644 |
update_model++; |
update_model++; |
1645 |
wSample->set_text(gig_to_utf8(dimregion->pSample->pInfo->Name)); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1646 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1647 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1648 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1649 |
update_loop_elements(); |
update_loop_elements(); |
1650 |
update_model--; |
update_model--; |
1651 |
|
|
1652 |
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); |
|
1653 |
return true; |
return true; |
1654 |
} |
} |
1655 |
return false; |
return false; |
1718 |
if (value) { |
if (value) { |
1719 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1720 |
if (!d->SampleLoops) { |
if (!d->SampleLoops) { |
1721 |
|
DimRegionChangeGuard(this, d); |
1722 |
|
|
1723 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1724 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1725 |
// loop the whole sample by default |
// loop the whole sample by default |
1726 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1727 |
loop.LoopLength = |
loop.LoopLength = |
1728 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
|
dimreg_to_be_changed_signal.emit(d); |
|
1729 |
d->AddSampleLoop(&loop); |
d->AddSampleLoop(&loop); |
|
dimreg_changed_signal.emit(d); |
|
1730 |
} |
} |
1731 |
} else { |
} else { |
1732 |
if (d->SampleLoops) { |
if (d->SampleLoops) { |
1733 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, d); |
1734 |
|
|
1735 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1736 |
while (d->SampleLoops) { |
while (d->SampleLoops) { |
1737 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1738 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1739 |
} |
} |
1740 |
} |
} |
1741 |
} |
} |
1779 |
{ |
{ |
1780 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d->pSample) d->pSample->LoopPlayCount = value; |
1781 |
} |
} |
1782 |
|
|
1783 |
|
void DimRegionEdit::nullOutSampleReference() { |
1784 |
|
if (!dimregion) return; |
1785 |
|
gig::Sample* oldref = dimregion->pSample; |
1786 |
|
if (!oldref) return; |
1787 |
|
|
1788 |
|
DimRegionChangeGuard(this, dimregion); |
1789 |
|
|
1790 |
|
// in case currently assigned sample is a stereo one, then remove both |
1791 |
|
// references (expected to be due to a "stereo dimension") |
1792 |
|
gig::DimensionRegion* d[2] = { dimregion, NULL }; |
1793 |
|
if (oldref->Channels == 2) { |
1794 |
|
gig::Region* region = dimregion->GetParent(); |
1795 |
|
{ |
1796 |
|
int stereo_bit = 0; |
1797 |
|
int bitcount = 0; |
1798 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1799 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1800 |
|
stereo_bit = 1 << bitcount; |
1801 |
|
break; |
1802 |
|
} |
1803 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1804 |
|
} |
1805 |
|
|
1806 |
|
if (stereo_bit) { |
1807 |
|
int dimregno; |
1808 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1809 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
1810 |
|
break; |
1811 |
|
} |
1812 |
|
} |
1813 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1814 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1815 |
|
} |
1816 |
|
} |
1817 |
|
} |
1818 |
|
|
1819 |
|
if (d[0]) d[0]->pSample = NULL; |
1820 |
|
if (d[1]) d[1]->pSample = NULL; |
1821 |
|
|
1822 |
|
// update UI elements |
1823 |
|
set_dim_region(dimregion); |
1824 |
|
|
1825 |
|
sample_ref_changed_signal.emit(oldref, NULL); |
1826 |
|
} |
1827 |
|
|
1828 |
|
void DimRegionEdit::onButtonSelectSamplePressed() { |
1829 |
|
if (!dimregion) return; |
1830 |
|
if (!dimregion->pSample) return; |
1831 |
|
select_sample_signal.emit(dimregion->pSample); |
1832 |
|
} |
1833 |
|
|
1834 |
|
sigc::signal<void, gig::Sample*>& DimRegionEdit::signal_select_sample() { |
1835 |
|
return select_sample_signal; |
1836 |
|
} |