1 |
/* |
/* |
2 |
* Copyright (C) 2006, 2007 Andreas Persson |
* Copyright (C) 2006-2010 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 |
22 |
#include "global.h" |
#include "global.h" |
23 |
|
|
24 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
25 |
eEG1PreAttack("Pre-attack", 0, 100, 2), |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
26 |
eEG1Attack("Attack", 0, 60, 3), |
eEG1Attack(_("Attack"), 0, 60, 3), |
27 |
eEG1Decay1("Decay 1", 0.005, 60, 3), |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
28 |
eEG1Decay2("Decay 2", 0, 60, 3), |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
29 |
eEG1InfiniteSustain("Infinite sustain"), |
eEG1InfiniteSustain(_("Infinite sustain")), |
30 |
eEG1Sustain("Sustain", 0, 100, 2), |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
31 |
eEG1Release("Release", 0, 60, 3), |
eEG1Release(_("Release"), 0, 60, 3), |
32 |
eEG1Hold("Hold"), |
eEG1Hold(_("Hold")), |
33 |
eEG1Controller("Controller"), |
eEG1Controller(_("Controller")), |
34 |
eEG1ControllerInvert("Controller invert"), |
eEG1ControllerInvert(_("Controller invert")), |
35 |
eEG1ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
36 |
eEG1ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
37 |
eEG1ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
38 |
eLFO1Frequency("Frequency", 0.1, 10, 2), |
eLFO1Frequency(_("Frequency"), 0.1, 10, 2), |
39 |
eLFO1InternalDepth("Internal depth", 0, 1200), |
eLFO1InternalDepth(_("Internal depth"), 0, 1200), |
40 |
eLFO1ControlDepth("Control depth", 0, 1200), |
eLFO1ControlDepth(_("Control depth"), 0, 1200), |
41 |
eLFO1Controller("Controller"), |
eLFO1Controller(_("Controller")), |
42 |
eLFO1FlipPhase("Flip phase"), |
eLFO1FlipPhase(_("Flip phase")), |
43 |
eLFO1Sync("Sync"), |
eLFO1Sync(_("Sync")), |
44 |
eEG2PreAttack("Pre-attack", 0, 100, 2), |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
45 |
eEG2Attack("Attack", 0, 60, 3), |
eEG2Attack(_("Attack"), 0, 60, 3), |
46 |
eEG2Decay1("Decay 1", 0.005, 60, 3), |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
47 |
eEG2Decay2("Decay 2", 0, 60, 3), |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
48 |
eEG2InfiniteSustain("Infinite sustain"), |
eEG2InfiniteSustain(_("Infinite sustain")), |
49 |
eEG2Sustain("Sustain", 0, 100, 2), |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
50 |
eEG2Release("Release", 0, 60, 3), |
eEG2Release(_("Release"), 0, 60, 3), |
51 |
eEG2Controller("Controller"), |
eEG2Controller(_("Controller")), |
52 |
eEG2ControllerInvert("Controller invert"), |
eEG2ControllerInvert(_("Controller invert")), |
53 |
eEG2ControllerAttackInfluence("Controller attack influence", 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
54 |
eEG2ControllerDecayInfluence("Controller decay influence", 0, 3), |
eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3), |
55 |
eEG2ControllerReleaseInfluence("Controller release influence", 0, 3), |
eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3), |
56 |
eLFO2Frequency("Frequency", 0.1, 10, 2), |
eLFO2Frequency(_("Frequency"), 0.1, 10, 2), |
57 |
eLFO2InternalDepth("Internal depth", 0, 1200), |
eLFO2InternalDepth(_("Internal depth"), 0, 1200), |
58 |
eLFO2ControlDepth("Control depth", 0, 1200), |
eLFO2ControlDepth(_("Control depth"), 0, 1200), |
59 |
eLFO2Controller("Controller"), |
eLFO2Controller(_("Controller")), |
60 |
eLFO2FlipPhase("Flip phase"), |
eLFO2FlipPhase(_("Flip phase")), |
61 |
eLFO2Sync("Sync"), |
eLFO2Sync(_("Sync")), |
62 |
eEG3Attack("Attack", 0, 10, 3), |
eEG3Attack(_("Attack"), 0, 10, 3), |
63 |
eEG3Depth("Depth", -1200, 1200), |
eEG3Depth(_("Depth"), -1200, 1200), |
64 |
eLFO3Frequency("Frequency", 0.1, 10, 2), |
eLFO3Frequency(_("Frequency"), 0.1, 10, 2), |
65 |
eLFO3InternalDepth("Internal depth", 0, 1200), |
eLFO3InternalDepth(_("Internal depth"), 0, 1200), |
66 |
eLFO3ControlDepth("Control depth", 0, 1200), |
eLFO3ControlDepth(_("Control depth"), 0, 1200), |
67 |
eLFO3Controller("Controller"), |
eLFO3Controller(_("Controller")), |
68 |
eLFO3Sync("Sync"), |
eLFO3Sync(_("Sync")), |
69 |
eVCFEnabled("Enabled"), |
eVCFEnabled(_("Enabled")), |
70 |
eVCFType("Type"), |
eVCFType(_("Type")), |
71 |
eVCFCutoffController("Cutoff controller"), |
eVCFCutoffController(_("Cutoff controller")), |
72 |
eVCFCutoffControllerInvert("Cutoff controller invert"), |
eVCFCutoffControllerInvert(_("Cutoff controller invert")), |
73 |
eVCFCutoff("Cutoff"), |
eVCFCutoff(_("Cutoff")), |
74 |
eVCFVelocityCurve("Velocity curve"), |
eVCFVelocityCurve(_("Velocity curve")), |
75 |
eVCFVelocityScale("Velocity scale"), |
eVCFVelocityScale(_("Velocity scale")), |
76 |
eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4), |
eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4), |
77 |
eVCFResonance("Resonance"), |
eVCFResonance(_("Resonance")), |
78 |
eVCFResonanceDynamic("Resonance dynamic"), |
eVCFResonanceDynamic(_("Resonance dynamic")), |
79 |
eVCFResonanceController("Resonance controller"), |
eVCFResonanceController(_("Resonance controller")), |
80 |
eVCFKeyboardTracking("Keyboard tracking"), |
eVCFKeyboardTracking(_("Keyboard tracking")), |
81 |
eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"), |
eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")), |
82 |
eVelocityResponseCurve("Velocity response curve"), |
eVelocityResponseCurve(_("Velocity response curve")), |
83 |
eVelocityResponseDepth("Velocity response depth", 0, 4), |
eVelocityResponseDepth(_("Velocity response depth"), 0, 4), |
84 |
eVelocityResponseCurveScaling("Velocity response curve scaling"), |
eVelocityResponseCurveScaling(_("Velocity response curve scaling")), |
85 |
eReleaseVelocityResponseCurve("Release velocity response curve"), |
eReleaseVelocityResponseCurve(_("Release velocity response curve")), |
86 |
eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4), |
eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4), |
87 |
eReleaseTriggerDecay("Release trigger decay", 0, 8), |
eReleaseTriggerDecay(_("Release trigger decay"), 0, 8), |
88 |
eCrossfade_in_start("Crossfade-in start"), |
eCrossfade_in_start(_("Crossfade-in start")), |
89 |
eCrossfade_in_end("Crossfade-in end"), |
eCrossfade_in_end(_("Crossfade-in end")), |
90 |
eCrossfade_out_start("Crossfade-out start"), |
eCrossfade_out_start(_("Crossfade-out start")), |
91 |
eCrossfade_out_end("Crossfade-out end"), |
eCrossfade_out_end(_("Crossfade-out end")), |
92 |
ePitchTrack("Pitch track"), |
ePitchTrack(_("Pitch track")), |
93 |
eDimensionBypass("Dimension bypass"), |
eDimensionBypass(_("Dimension bypass")), |
94 |
ePan("Pan", -64, 63), |
ePan(_("Pan"), -64, 63), |
95 |
eSelfMask("Self mask"), |
eSelfMask(_("Self mask")), |
96 |
eAttenuationController("Attenuation controller"), |
eAttenuationController(_("Attenuation controller")), |
97 |
eInvertAttenuationController("Invert attenuation controller"), |
eInvertAttenuationController(_("Invert attenuation controller")), |
98 |
eAttenuationControllerThreshold("Attenuation controller threshold"), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
99 |
eChannelOffset("Channel offset", 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
100 |
eSustainDefeat("Sustain defeat"), |
eSustainDefeat(_("Sustain defeat")), |
101 |
eMSDecode("MS decode"), |
eMSDecode(_("MS decode")), |
102 |
eSampleStartOffset("Sample start offset", 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
103 |
eUnityNote("Unity note"), |
eUnityNote(_("Unity note")), |
104 |
eFineTune("Fine tune", -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
105 |
eGain("Gain", -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
106 |
eGainPlus6("Gain +6dB", eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
107 |
eSampleLoopEnabled("Enabled"), |
eSampleLoopEnabled(_("Enabled")), |
108 |
eSampleLoopStart("Loop start positon"), |
eSampleLoopStart(_("Loop start positon")), |
109 |
eSampleLoopLength("Loop size"), |
eSampleLoopLength(_("Loop size")), |
110 |
eSampleLoopType("Loop type"), |
eSampleLoopType(_("Loop type")), |
111 |
eSampleLoopInfinite("Infinite loop"), |
eSampleLoopInfinite(_("Infinite loop")), |
112 |
eSampleLoopPlayCount("Playback count", 1), |
eSampleLoopPlayCount(_("Playback count"), 1), |
113 |
update_model(0) |
update_model(0) |
114 |
{ |
{ |
115 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
265 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
266 |
|
|
267 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
268 |
addString("Sample", lSample, wSample); |
addString(_("Sample"), lSample, wSample); |
269 |
//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); |
270 |
|
#ifdef OLD_TOOLTIPS |
271 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
272 |
|
#else |
273 |
|
wSample->set_tooltip_text(_("Drop a sample here")); |
274 |
|
#endif |
275 |
addProp(eUnityNote); |
addProp(eUnityNote); |
276 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
277 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
278 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
279 |
addHeader("Loops"); |
addHeader(_("Loops")); |
280 |
addProp(eSampleLoopEnabled); |
addProp(eSampleLoopEnabled); |
281 |
addProp(eSampleLoopStart); |
addProp(eSampleLoopStart); |
282 |
addProp(eSampleLoopLength); |
addProp(eSampleLoopLength); |
283 |
{ |
{ |
284 |
const char* choices[] = { "normal", "bidirectional", "backward", 0 }; |
const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 }; |
285 |
static const uint32_t values[] = { |
static const uint32_t values[] = { |
286 |
gig::loop_type_normal, |
gig::loop_type_normal, |
287 |
gig::loop_type_bidirectional, |
gig::loop_type_bidirectional, |
321 |
addProp(eLFO1InternalDepth); |
addProp(eLFO1InternalDepth); |
322 |
addProp(eLFO1ControlDepth); |
addProp(eLFO1ControlDepth); |
323 |
{ |
{ |
324 |
const char* choices[] = { "internal", "modwheel", "breath", |
const char* choices[] = { _("internal"), _("modwheel"), _("breath"), |
325 |
"internal+modwheel", "internal+breath", 0 }; |
_("internal+modwheel"), _("internal+breath"), 0 }; |
326 |
static const gig::lfo1_ctrl_t values[] = { |
static const gig::lfo1_ctrl_t values[] = { |
327 |
gig::lfo1_ctrl_internal, |
gig::lfo1_ctrl_internal, |
328 |
gig::lfo1_ctrl_modwheel, |
gig::lfo1_ctrl_modwheel, |
335 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
336 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
337 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
338 |
addHeader("Crossfade"); |
addHeader(_("Crossfade")); |
339 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
340 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
341 |
addProp(eAttenuationControllerThreshold); |
addProp(eAttenuationControllerThreshold); |
349 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
350 |
addProp(eVCFEnabled); |
addProp(eVCFEnabled); |
351 |
{ |
{ |
352 |
const char* choices[] = { "lowpass", "lowpassturbo", "bandpass", |
const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"), |
353 |
"highpass", "bandreject", 0 }; |
_("highpass"), _("bandreject"), 0 }; |
354 |
static const gig::vcf_type_t values[] = { |
static const gig::vcf_type_t values[] = { |
355 |
gig::vcf_type_lowpass, |
gig::vcf_type_lowpass, |
356 |
gig::vcf_type_lowpassturbo, |
gig::vcf_type_lowpassturbo, |
362 |
} |
} |
363 |
addProp(eVCFType); |
addProp(eVCFType); |
364 |
{ |
{ |
365 |
const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2", |
const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"), |
366 |
"breath", "foot", "sustainpedal", "softpedal", |
_("breath"), _("foot"), _("sustainpedal"), _("softpedal"), |
367 |
"genpurpose7", "genpurpose8", "aftertouch", 0 }; |
_("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 }; |
368 |
static const gig::vcf_cutoff_ctrl_t values[] = { |
static const gig::vcf_cutoff_ctrl_t values[] = { |
369 |
gig::vcf_cutoff_ctrl_none, |
gig::vcf_cutoff_ctrl_none, |
370 |
gig::vcf_cutoff_ctrl_none2, |
gig::vcf_cutoff_ctrl_none2, |
384 |
addProp(eVCFCutoffController); |
addProp(eVCFCutoffController); |
385 |
addProp(eVCFCutoffControllerInvert); |
addProp(eVCFCutoffControllerInvert); |
386 |
addProp(eVCFCutoff); |
addProp(eVCFCutoff); |
387 |
const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 }; |
const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 }; |
388 |
static const gig::curve_type_t curve_type_values[] = { |
static const gig::curve_type_t curve_type_values[] = { |
389 |
gig::curve_type_nonlinear, |
gig::curve_type_nonlinear, |
390 |
gig::curve_type_linear, |
gig::curve_type_linear, |
397 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
398 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
399 |
{ |
{ |
400 |
const char* choices[] = { "none", "genpurpose3", "genpurpose4", |
const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"), |
401 |
"genpurpose5", "genpurpose6", 0 }; |
_("genpurpose5"), _("genpurpose6"), 0 }; |
402 |
static const gig::vcf_res_ctrl_t values[] = { |
static const gig::vcf_res_ctrl_t values[] = { |
403 |
gig::vcf_res_ctrl_none, |
gig::vcf_res_ctrl_none, |
404 |
gig::vcf_res_ctrl_genpurpose3, |
gig::vcf_res_ctrl_genpurpose3, |
414 |
|
|
415 |
nextPage(); |
nextPage(); |
416 |
|
|
417 |
addHeader(_("Filter Cutoff Envelope (EG2)")); |
lEG2 = addHeader(_("Filter Cutoff Envelope (EG2)")); |
418 |
addProp(eEG2PreAttack); |
addProp(eEG2PreAttack); |
419 |
addProp(eEG2Attack); |
addProp(eEG2Attack); |
420 |
addProp(eEG2Decay1); |
addProp(eEG2Decay1); |
427 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
428 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
429 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
430 |
addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
431 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
432 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
433 |
addProp(eLFO2ControlDepth); |
addProp(eLFO2ControlDepth); |
434 |
{ |
{ |
435 |
const char* choices[] = { "internal", "modwheel", "foot", |
const char* choices[] = { _("internal"), _("modwheel"), _("foot"), |
436 |
"internal+modwheel", "internal+foot", 0 }; |
_("internal+modwheel"), _("internal+foot"), 0 }; |
437 |
static const gig::lfo2_ctrl_t values[] = { |
static const gig::lfo2_ctrl_t values[] = { |
438 |
gig::lfo2_ctrl_internal, |
gig::lfo2_ctrl_internal, |
439 |
gig::lfo2_ctrl_modwheel, |
gig::lfo2_ctrl_modwheel, |
460 |
addProp(eLFO3InternalDepth); |
addProp(eLFO3InternalDepth); |
461 |
addProp(eLFO3ControlDepth); |
addProp(eLFO3ControlDepth); |
462 |
{ |
{ |
463 |
const char* choices[] = { "internal", "modwheel", "aftertouch", |
const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"), |
464 |
"internal+modwheel", "internal+aftertouch", 0 }; |
_("internal+modwheel"), _("internal+aftertouch"), 0 }; |
465 |
static const gig::lfo3_ctrl_t values[] = { |
static const gig::lfo3_ctrl_t values[] = { |
466 |
gig::lfo3_ctrl_internal, |
gig::lfo3_ctrl_internal, |
467 |
gig::lfo3_ctrl_modwheel, |
gig::lfo3_ctrl_modwheel, |
486 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
487 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
488 |
{ |
{ |
489 |
const char* choices[] = { "none", "effect4depth", "effect5depth", 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
490 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
491 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
492 |
gig::dim_bypass_ctrl_94, |
gig::dim_bypass_ctrl_94, |
543 |
eSampleLoopInfinite.signal_value_changed().connect( |
eSampleLoopInfinite.signal_value_changed().connect( |
544 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
545 |
|
|
546 |
append_page(*table[0], "Sample"); |
append_page(*table[0], _("Sample")); |
547 |
append_page(*table[1], "Amplitude (1)"); |
append_page(*table[1], _("Amplitude (1)")); |
548 |
append_page(*table[2], "Amplitude (2)"); |
append_page(*table[2], _("Amplitude (2)")); |
549 |
append_page(*table[3], "Filter (1)"); |
append_page(*table[3], _("Filter (1)")); |
550 |
append_page(*table[4], "Filter (2)"); |
append_page(*table[4], _("Filter (2)")); |
551 |
append_page(*table[5], "Pitch"); |
append_page(*table[5], _("Pitch")); |
552 |
append_page(*table[6], "Misc"); |
append_page(*table[6], _("Misc")); |
553 |
} |
} |
554 |
|
|
555 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
573 |
rowno++; |
rowno++; |
574 |
} |
} |
575 |
|
|
576 |
void DimRegionEdit::addHeader(const char* text) |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
577 |
{ |
{ |
578 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
579 |
{ |
{ |
591 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
592 |
rowno++; |
rowno++; |
593 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
594 |
|
return label; |
595 |
} |
} |
596 |
|
|
597 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
638 |
set_sensitive(d); |
set_sensitive(d); |
639 |
if (!d) return; |
if (!d) return; |
640 |
|
|
|
// TODO: Here is where we decide which dimregions that are going |
|
|
// to be modified when the user changes a parameter. For now, just |
|
|
// choose the shown dimregion. |
|
|
dimregs.clear(); |
|
|
dimregs.insert(d); |
|
|
|
|
641 |
update_model++; |
update_model++; |
642 |
eEG1PreAttack.set_value(d->EG1PreAttack); |
eEG1PreAttack.set_value(d->EG1PreAttack); |
643 |
eEG1Attack.set_value(d->EG1Attack); |
eEG1Attack.set_value(d->EG1Attack); |
734 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
d->pSample ? d->pSample->LoopPlayCount : 0); |
735 |
update_model--; |
update_model--; |
736 |
|
|
737 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL"); |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
738 |
|
|
739 |
update_loop_elements(); |
update_loop_elements(); |
740 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
753 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
754 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
755 |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
eVCFKeyboardTrackingBreakpoint.set_sensitive(sensitive); |
756 |
|
lEG2->set_sensitive(sensitive); |
757 |
eEG2PreAttack.set_sensitive(sensitive); |
eEG2PreAttack.set_sensitive(sensitive); |
758 |
eEG2Attack.set_sensitive(sensitive); |
eEG2Attack.set_sensitive(sensitive); |
759 |
eEG2Decay1.set_sensitive(sensitive); |
eEG2Decay1.set_sensitive(sensitive); |
764 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
765 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
766 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
767 |
|
lLFO2->set_sensitive(sensitive); |
768 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
769 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
770 |
eLFO2ControlDepth.set_sensitive(sensitive); |
eLFO2ControlDepth.set_sensitive(sensitive); |
797 |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
eVCFCutoffControllerInvert.set_sensitive(hasController); |
798 |
eVCFCutoff.set_sensitive(!hasController); |
eVCFCutoff.set_sensitive(!hasController); |
799 |
eVCFResonanceDynamic.set_sensitive(!hasController); |
eVCFResonanceDynamic.set_sensitive(!hasController); |
800 |
eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" : |
eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") : |
801 |
"Velocity scale:"); |
_("Velocity scale:")); |
802 |
} |
} |
803 |
|
|
804 |
void DimRegionEdit::VCFResonanceController_changed() |
void DimRegionEdit::VCFResonanceController_changed() |
962 |
// 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() |
963 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//dimreg_to_be_changed_signal.emit(dimregion); |
964 |
|
|
965 |
|
// make sure stereo samples always are the same in both |
966 |
|
// dimregs in the samplechannel dimension |
967 |
|
int nbDimregs = 1; |
968 |
|
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
969 |
|
if (sample->Channels == 2) { |
970 |
|
gig::Region* region = dimregion->GetParent(); |
971 |
|
|
972 |
|
int bitcount = 0; |
973 |
|
int stereo_bit = 0; |
974 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
975 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
976 |
|
stereo_bit = 1 << bitcount; |
977 |
|
break; |
978 |
|
} |
979 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
980 |
|
} |
981 |
|
|
982 |
|
if (stereo_bit) { |
983 |
|
int dimregno; |
984 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
985 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
986 |
|
break; |
987 |
|
} |
988 |
|
} |
989 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
990 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
991 |
|
nbDimregs = 2; |
992 |
|
} |
993 |
|
} |
994 |
|
|
995 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimregion->pSample; |
|
dimregion->pSample = sample; |
|
996 |
|
|
997 |
// copy sample information from Sample to DimensionRegion |
for (int i = 0 ; i < nbDimregs ; i++) { |
998 |
|
d[i]->pSample = sample; |
999 |
|
|
1000 |
dimregion->UnityNote = sample->MIDIUnityNote; |
// copy sample information from Sample to DimensionRegion |
|
dimregion->FineTune = sample->FineTune; |
|
1001 |
|
|
1002 |
int loops = sample->Loops ? 1 : 0; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1003 |
while (dimregion->SampleLoops > loops) { |
d[i]->FineTune = sample->FineTune; |
1004 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
|
1005 |
} |
int loops = sample->Loops ? 1 : 0; |
1006 |
while (dimregion->SampleLoops < sample->Loops) { |
while (d[i]->SampleLoops > loops) { |
1007 |
DLS::sample_loop_t loop; |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1008 |
dimregion->AddSampleLoop(&loop); |
} |
1009 |
} |
while (d[i]->SampleLoops < sample->Loops) { |
1010 |
if (loops) { |
DLS::sample_loop_t loop; |
1011 |
dimregion->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
d[i]->AddSampleLoop(&loop); |
1012 |
dimregion->pSampleLoops[0].LoopType = sample->LoopType; |
} |
1013 |
dimregion->pSampleLoops[0].LoopStart = sample->LoopStart; |
if (loops) { |
1014 |
dimregion->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1015 |
|
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1016 |
|
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1017 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1018 |
|
} |
1019 |
} |
} |
1020 |
|
|
1021 |
// update ui |
// update ui |