1 |
/* |
/* |
2 |
* Copyright (C) 2006-2009 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 |
20 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
21 |
|
|
22 |
#include "global.h" |
#include "global.h" |
23 |
|
#include "compat.h" |
24 |
|
|
25 |
|
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
26 |
|
getter(getter), dimreg(0) { |
27 |
|
set_size_request(80, 80); |
28 |
|
} |
29 |
|
|
30 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
31 |
|
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
32 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
33 |
|
get_window()->create_cairo_context(); |
34 |
|
#if 0 |
35 |
|
} |
36 |
|
#endif |
37 |
|
#else |
38 |
|
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
39 |
|
#endif |
40 |
|
if (dimreg) { |
41 |
|
int w = get_width(); |
42 |
|
int h = get_height(); |
43 |
|
|
44 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
45 |
|
for (double x = 0 ; x <= w ; x++) { |
46 |
|
int vel = int(x * (127 - 1e-10) / w + 1); |
47 |
|
double y = (1 - (dimreg->*getter)(vel)) * (h - 3) + 1.5; |
48 |
|
|
49 |
|
if (x < 1e-10) { |
50 |
|
cr->move_to(x, y); |
51 |
|
} else { |
52 |
|
cr->line_to(x, y); |
53 |
|
} |
54 |
|
} |
55 |
|
if (pass == 0) { |
56 |
|
cr->line_to(w, h); |
57 |
|
cr->line_to(0, h); |
58 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 0.2 : 0.1); |
59 |
|
cr->fill(); |
60 |
|
} else { |
61 |
|
cr->set_line_width(3); |
62 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 1.0 : 0.3); |
63 |
|
cr->stroke(); |
64 |
|
} |
65 |
|
} |
66 |
|
} |
67 |
|
return true; |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
72 |
|
set_size_request(280, 80); |
73 |
|
} |
74 |
|
|
75 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
76 |
|
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
77 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
78 |
|
get_window()->create_cairo_context(); |
79 |
|
#if 0 |
80 |
|
} |
81 |
|
#endif |
82 |
|
#else |
83 |
|
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
84 |
|
#endif |
85 |
|
if (dimreg) { |
86 |
|
cr->translate(1.5, 0); |
87 |
|
|
88 |
|
// first, draw curves for the other layers |
89 |
|
gig::Region* region = dimreg->GetParent(); |
90 |
|
int dimregno; |
91 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
92 |
|
if (region->pDimensionRegions[dimregno] == dimreg) { |
93 |
|
break; |
94 |
|
} |
95 |
|
} |
96 |
|
int bitcount = 0; |
97 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
98 |
|
if (region->pDimensionDefinitions[dim].dimension == |
99 |
|
gig::dimension_layer) { |
100 |
|
int mask = |
101 |
|
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
102 |
|
bitcount); |
103 |
|
int c = dimregno & mask; // mask away the layer dimension |
104 |
|
|
105 |
|
for (int i = 0 ; i < region->pDimensionDefinitions[dim].zones ; |
106 |
|
i++) { |
107 |
|
gig::DimensionRegion* d = |
108 |
|
region->pDimensionRegions[c + (i << bitcount)]; |
109 |
|
if (d != dimreg) { |
110 |
|
draw_one_curve(cr, d, false); |
111 |
|
} |
112 |
|
} |
113 |
|
break; |
114 |
|
} |
115 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
116 |
|
} |
117 |
|
|
118 |
|
// then, draw the currently selected layer |
119 |
|
draw_one_curve(cr, dimreg, is_sensitive()); |
120 |
|
} |
121 |
|
return true; |
122 |
|
} |
123 |
|
|
124 |
|
void CrossfadeCurve::draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr, |
125 |
|
const gig::DimensionRegion* d, |
126 |
|
bool sensitive) { |
127 |
|
int w = get_width(); |
128 |
|
int h = get_height(); |
129 |
|
|
130 |
|
if (d->Crossfade.out_end) { |
131 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
132 |
|
cr->move_to(d->Crossfade.in_start / 127.0 * (w - 3), h); |
133 |
|
cr->line_to(d->Crossfade.in_end / 127.0 * (w - 3), 1.5); |
134 |
|
cr->line_to(d->Crossfade.out_start / 127.0 * (w - 3), 1.5); |
135 |
|
cr->line_to(d->Crossfade.out_end / 127.0 * (w - 3), h); |
136 |
|
|
137 |
|
if (pass == 0) { |
138 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 0.2 : 0.1); |
139 |
|
cr->fill(); |
140 |
|
} else { |
141 |
|
cr->set_line_width(3); |
142 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 1.0 : 0.3); |
143 |
|
cr->stroke(); |
144 |
|
} |
145 |
|
} |
146 |
|
} |
147 |
|
} |
148 |
|
|
149 |
|
|
150 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
151 |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
152 |
eEG1Attack(_("Attack"), 0, 60, 3), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
153 |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
154 |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
eEG1PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
155 |
|
eEG1Attack(_("Attack Time (seconds)"), 0, 60, 3), |
156 |
|
eEG1Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
157 |
|
eEG1Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
158 |
eEG1InfiniteSustain(_("Infinite sustain")), |
eEG1InfiniteSustain(_("Infinite sustain")), |
159 |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
eEG1Sustain(_("Sustain Level (%)"), 0, 100, 2), |
160 |
eEG1Release(_("Release"), 0, 60, 3), |
eEG1Release(_("Release Time (seconds)"), 0, 60, 3), |
161 |
eEG1Hold(_("Hold")), |
eEG1Hold(_("Hold Attack Stage until Loop End")), |
162 |
eEG1Controller(_("Controller")), |
eEG1Controller(_("Controller")), |
163 |
eEG1ControllerInvert(_("Controller invert")), |
eEG1ControllerInvert(_("Controller invert")), |
164 |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
170 |
eLFO1Controller(_("Controller")), |
eLFO1Controller(_("Controller")), |
171 |
eLFO1FlipPhase(_("Flip phase")), |
eLFO1FlipPhase(_("Flip phase")), |
172 |
eLFO1Sync(_("Sync")), |
eLFO1Sync(_("Sync")), |
173 |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
eEG2PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
174 |
eEG2Attack(_("Attack"), 0, 60, 3), |
eEG2Attack(_("Attack Time (seconds)"), 0, 60, 3), |
175 |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
eEG2Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
176 |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
eEG2Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
177 |
eEG2InfiniteSustain(_("Infinite sustain")), |
eEG2InfiniteSustain(_("Infinite sustain")), |
178 |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
eEG2Sustain(_("Sustain Level (%)"), 0, 100, 2), |
179 |
eEG2Release(_("Release"), 0, 60, 3), |
eEG2Release(_("Release Time (seconds)"), 0, 60, 3), |
180 |
eEG2Controller(_("Controller")), |
eEG2Controller(_("Controller")), |
181 |
eEG2ControllerInvert(_("Controller invert")), |
eEG2ControllerInvert(_("Controller invert")), |
182 |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
221 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
222 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
223 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
224 |
eSelfMask(_("Self mask")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
225 |
eAttenuationController(_("Attenuation controller")), |
eAttenuationController(_("Attenuation controller")), |
226 |
eInvertAttenuationController(_("Invert attenuation controller")), |
eInvertAttenuationController(_("Invert attenuation controller")), |
227 |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
228 |
eChannelOffset(_("Channel offset"), 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
229 |
eSustainDefeat(_("Sustain defeat")), |
eSustainDefeat(_("Ignore Hold Pedal (a.k.a. \"Sustain defeat\")")), |
230 |
eMSDecode(_("MS decode")), |
eMSDecode(_("Decode Mid/Side Recordings")), |
231 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
232 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
233 |
|
eSampleGroup(_("Sample Group")), |
234 |
|
eSampleFormatInfo(_("Sample Format")), |
235 |
|
eSampleID("Sample ID"), |
236 |
|
eChecksum("Wave Data CRC-32"), |
237 |
eFineTune(_("Fine tune"), -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
238 |
eGain(_("Gain"), -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
239 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
243 |
eSampleLoopType(_("Loop type")), |
eSampleLoopType(_("Loop type")), |
244 |
eSampleLoopInfinite(_("Infinite loop")), |
eSampleLoopInfinite(_("Infinite loop")), |
245 |
eSampleLoopPlayCount(_("Playback count"), 1), |
eSampleLoopPlayCount(_("Playback count"), 1), |
246 |
|
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
247 |
update_model(0) |
update_model(0) |
248 |
{ |
{ |
249 |
|
// make synthesis parameter page tabs scrollable |
250 |
|
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
251 |
|
set_scrollable(); |
252 |
|
|
253 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
254 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
255 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
357 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
358 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
359 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
360 |
|
buttonSelectSample.signal_clicked().connect( |
361 |
|
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
362 |
|
); |
363 |
|
|
364 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
365 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
370 |
eUnityNote.set_tip( |
eUnityNote.set_tip( |
371 |
_("Note this sample is associated with (a.k.a. 'root note')") |
_("Note this sample is associated with (a.k.a. 'root note')") |
372 |
); |
); |
373 |
|
buttonSelectSample.set_tooltip_text( |
374 |
|
_("Selects the sample of this dimension region on the left hand side's sample tree view.") |
375 |
|
); |
376 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
377 |
ePan.set_tip(_("Stereo balance (left/right)")); |
ePan.set_tip(_("Stereo balance (left/right)")); |
378 |
eChannelOffset.set_tip( |
eChannelOffset.set_tip( |
403 |
"Caution: this setting is stored on Sample side, thus is shared " |
"Caution: this setting is stored on Sample side, thus is shared " |
404 |
"among all dimension regions that use this sample!") |
"among all dimension regions that use this sample!") |
405 |
); |
); |
406 |
|
|
407 |
|
eEG1PreAttack.set_tip( |
408 |
|
"Very first level this EG starts with. It rises then in Attack Time " |
409 |
|
"seconds from this initial level to 100%." |
410 |
|
); |
411 |
|
eEG1Attack.set_tip( |
412 |
|
"Duration of the EG's Attack stage, which raises its level from " |
413 |
|
"Pre-Attack Level to 100%." |
414 |
|
); |
415 |
|
eEG1Hold.set_tip( |
416 |
|
"On looped sounds, enabling this will cause the Decay 1 stage not to " |
417 |
|
"enter before the loop has been passed one time." |
418 |
|
); |
419 |
|
eAttenuationController.set_tip(_( |
420 |
|
"If you are not using the 'Layer' dimension, then this controller " |
421 |
|
"simply alters the volume. If you are using the 'Layer' dimension, " |
422 |
|
"then this controller is controlling the crossfade between Layers in " |
423 |
|
"real-time." |
424 |
|
)); |
425 |
|
|
426 |
|
eLFO1Sync.set_tip( |
427 |
|
"If not checked, every voice will use its own LFO instance, which " |
428 |
|
"causes voices triggered at different points in time to have different " |
429 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
430 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
431 |
|
"no matter when the individual notes have been triggered." |
432 |
|
); |
433 |
|
eLFO2Sync.set_tip( |
434 |
|
"If not checked, every voice will use its own LFO instance, which " |
435 |
|
"causes voices triggered at different points in time to have different " |
436 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
437 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
438 |
|
"no matter when the individual notes have been triggered." |
439 |
|
); |
440 |
|
eLFO3Sync.set_tip( |
441 |
|
"If not checked, every voice will use its own LFO instance, which " |
442 |
|
"causes voices triggered at different points in time to have different " |
443 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
444 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
445 |
|
"no matter when the individual notes have been triggered." |
446 |
|
); |
447 |
|
eLFO1FlipPhase.set_tip( |
448 |
|
"Inverts the LFO's generated wave vertically." |
449 |
|
); |
450 |
|
eLFO2FlipPhase.set_tip( |
451 |
|
"Inverts the LFO's generated wave vertically." |
452 |
|
); |
453 |
|
|
454 |
pageno = 0; |
pageno = 0; |
455 |
rowno = 0; |
rowno = 0; |
456 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
457 |
|
|
458 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
459 |
addString(_("Sample"), lSample, wSample); |
addString(_("Sample"), lSample, wSample, buttonNullSampleReference); |
460 |
|
buttonNullSampleReference->set_label("X"); |
461 |
|
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.")); |
462 |
|
buttonNullSampleReference->signal_clicked().connect( |
463 |
|
sigc::mem_fun(*this, &DimRegionEdit::nullOutSampleReference) |
464 |
|
); |
465 |
//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); |
466 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
#ifdef OLD_TOOLTIPS |
467 |
|
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
468 |
|
#else |
469 |
|
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
470 |
|
#endif |
471 |
addProp(eUnityNote); |
addProp(eUnityNote); |
472 |
|
addProp(eSampleGroup); |
473 |
|
addProp(eSampleFormatInfo); |
474 |
|
addProp(eSampleID); |
475 |
|
addProp(eChecksum); |
476 |
|
addRightHandSide(buttonSelectSample); |
477 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
478 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
479 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
503 |
addHeader(_("Amplitude Envelope (EG1)")); |
addHeader(_("Amplitude Envelope (EG1)")); |
504 |
addProp(eEG1PreAttack); |
addProp(eEG1PreAttack); |
505 |
addProp(eEG1Attack); |
addProp(eEG1Attack); |
506 |
|
addProp(eEG1Hold); |
507 |
addProp(eEG1Decay1); |
addProp(eEG1Decay1); |
508 |
addProp(eEG1Decay2); |
addProp(eEG1Decay2); |
509 |
addProp(eEG1InfiniteSustain); |
addProp(eEG1InfiniteSustain); |
510 |
addProp(eEG1Sustain); |
addProp(eEG1Sustain); |
511 |
addProp(eEG1Release); |
addProp(eEG1Release); |
|
addProp(eEG1Hold); |
|
512 |
addProp(eEG1Controller); |
addProp(eEG1Controller); |
513 |
addProp(eEG1ControllerInvert); |
addProp(eEG1ControllerInvert); |
514 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
545 |
addProp(eCrossfade_out_start); |
addProp(eCrossfade_out_start); |
546 |
addProp(eCrossfade_out_end); |
addProp(eCrossfade_out_end); |
547 |
|
|
548 |
|
Gtk::Frame* frame = new Gtk::Frame; |
549 |
|
frame->add(crossfade_curve); |
550 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
551 |
|
Gtk::SHRINK, Gtk::SHRINK); |
552 |
|
rowno++; |
553 |
|
|
554 |
|
eCrossfade_in_start.signal_value_changed().connect( |
555 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
556 |
|
eCrossfade_in_end.signal_value_changed().connect( |
557 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
558 |
|
eCrossfade_out_start.signal_value_changed().connect( |
559 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
560 |
|
eCrossfade_out_end.signal_value_changed().connect( |
561 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
562 |
|
|
563 |
nextPage(); |
nextPage(); |
564 |
|
|
565 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
610 |
addProp(eVCFVelocityCurve); |
addProp(eVCFVelocityCurve); |
611 |
addProp(eVCFVelocityScale); |
addProp(eVCFVelocityScale); |
612 |
addProp(eVCFVelocityDynamicRange); |
addProp(eVCFVelocityDynamicRange); |
613 |
|
|
614 |
|
eVCFCutoffController.signal_value_changed().connect( |
615 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
616 |
|
eVCFVelocityCurve.signal_value_changed().connect( |
617 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
618 |
|
eVCFVelocityScale.signal_value_changed().connect( |
619 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
620 |
|
eVCFVelocityDynamicRange.signal_value_changed().connect( |
621 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
622 |
|
|
623 |
|
frame = new Gtk::Frame; |
624 |
|
frame->add(cutoff_curve); |
625 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
626 |
|
Gtk::SHRINK, Gtk::SHRINK); |
627 |
|
rowno++; |
628 |
|
|
629 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
630 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
631 |
{ |
{ |
708 |
|
|
709 |
nextPage(); |
nextPage(); |
710 |
|
|
711 |
|
addHeader(_("Velocity Response")); |
712 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
713 |
addProp(eVelocityResponseCurve); |
addProp(eVelocityResponseCurve); |
714 |
addProp(eVelocityResponseDepth); |
addProp(eVelocityResponseDepth); |
715 |
addProp(eVelocityResponseCurveScaling); |
addProp(eVelocityResponseCurveScaling); |
716 |
|
|
717 |
|
eVelocityResponseCurve.signal_value_changed().connect( |
718 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
719 |
|
eVelocityResponseDepth.signal_value_changed().connect( |
720 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
721 |
|
eVelocityResponseCurveScaling.signal_value_changed().connect( |
722 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
723 |
|
|
724 |
|
frame = new Gtk::Frame; |
725 |
|
frame->add(velocity_curve); |
726 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
727 |
|
Gtk::SHRINK, Gtk::SHRINK); |
728 |
|
rowno++; |
729 |
|
|
730 |
|
addHeader(_("Release Velocity Response")); |
731 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
732 |
curve_type_values); |
curve_type_values); |
733 |
addProp(eReleaseVelocityResponseCurve); |
addProp(eReleaseVelocityResponseCurve); |
734 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
735 |
|
|
736 |
|
eReleaseVelocityResponseCurve.signal_value_changed().connect( |
737 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
738 |
|
eReleaseVelocityResponseDepth.signal_value_changed().connect( |
739 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
740 |
|
frame = new Gtk::Frame; |
741 |
|
frame->add(release_curve); |
742 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
743 |
|
Gtk::SHRINK, Gtk::SHRINK); |
744 |
|
rowno++; |
745 |
|
|
746 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
747 |
{ |
{ |
748 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
754 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
755 |
} |
} |
756 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
757 |
|
eSelfMask.widget.set_tooltip_text(_( |
758 |
|
"If enabled: new notes with higher velocity value will stop older " |
759 |
|
"notes with lower velocity values, that way you can save voices that " |
760 |
|
"would barely be audible. This is also useful for certain drum sounds." |
761 |
|
)); |
762 |
addProp(eSelfMask); |
addProp(eSelfMask); |
763 |
|
eSustainDefeat.widget.set_tooltip_text(_( |
764 |
|
"If enabled: sustain pedal will not hold a note. This way you can use " |
765 |
|
"the sustain pedal for other purposes, for example to switch among " |
766 |
|
"dimension regions." |
767 |
|
)); |
768 |
addProp(eSustainDefeat); |
addProp(eSustainDefeat); |
769 |
|
eMSDecode.widget.set_tooltip_text(_( |
770 |
|
"Defines if Mid/Side Recordings should be decoded. Mid/Side Recordings " |
771 |
|
"are an alternative way to record sounds in stereo. The sampler needs " |
772 |
|
"to decode such samples to actually make use of them. Note: this " |
773 |
|
"feature is currently not supported by LinuxSampler." |
774 |
|
)); |
775 |
addProp(eMSDecode); |
addProp(eMSDecode); |
776 |
|
|
777 |
nextPage(); |
nextPage(); |
835 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
836 |
{ |
{ |
837 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
838 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
839 |
|
|
840 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
841 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
848 |
rowno++; |
rowno++; |
849 |
} |
} |
850 |
|
|
851 |
|
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
852 |
|
Gtk::Entry*& widget, Gtk::Button*& button) |
853 |
|
{ |
854 |
|
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
855 |
|
label->set_alignment(Gtk::ALIGN_START); |
856 |
|
|
857 |
|
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
858 |
|
Gtk::FILL, Gtk::SHRINK); |
859 |
|
|
860 |
|
widget = new Gtk::Entry(); |
861 |
|
button = new Gtk::Button(); |
862 |
|
|
863 |
|
Gtk::HBox* hbox = new Gtk::HBox; |
864 |
|
hbox->pack_start(*widget); |
865 |
|
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
866 |
|
|
867 |
|
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
868 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
869 |
|
|
870 |
|
rowno++; |
871 |
|
} |
872 |
|
|
873 |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
Gtk::Label* DimRegionEdit::addHeader(const char* text) |
874 |
{ |
{ |
875 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
883 |
str += "</b>"; |
str += "</b>"; |
884 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
885 |
label->set_use_markup(); |
label->set_use_markup(); |
886 |
label->set_alignment(Gtk::ALIGN_LEFT); |
label->set_alignment(Gtk::ALIGN_START); |
887 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
888 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
889 |
rowno++; |
rowno++; |
927 |
rowno++; |
rowno++; |
928 |
} |
} |
929 |
|
|
930 |
|
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
931 |
|
{ |
932 |
|
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
933 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
934 |
|
rowno++; |
935 |
|
} |
936 |
|
|
937 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
938 |
{ |
{ |
939 |
dimregion = d; |
dimregion = d; |
940 |
|
velocity_curve.set_dim_region(d); |
941 |
|
release_curve.set_dim_region(d); |
942 |
|
cutoff_curve.set_dim_region(d); |
943 |
|
crossfade_curve.set_dim_region(d); |
944 |
|
|
945 |
set_sensitive(d); |
set_sensitive(d); |
946 |
if (!d) return; |
if (!d) return; |
1025 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1026 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1027 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1028 |
|
// show sample group name |
1029 |
|
{ |
1030 |
|
Glib::ustring s = "---"; |
1031 |
|
if (d->pSample && d->pSample->GetGroup()) |
1032 |
|
s = d->pSample->GetGroup()->Name; |
1033 |
|
eSampleGroup.text.set_text(s); |
1034 |
|
} |
1035 |
|
// assemble sample format info string |
1036 |
|
{ |
1037 |
|
Glib::ustring s; |
1038 |
|
if (d->pSample) { |
1039 |
|
switch (d->pSample->Channels) { |
1040 |
|
case 1: s = _("Mono"); break; |
1041 |
|
case 2: s = _("Stereo"); break; |
1042 |
|
default: |
1043 |
|
s = ToString(d->pSample->Channels) + _(" audio channels"); |
1044 |
|
break; |
1045 |
|
} |
1046 |
|
s += " " + ToString(d->pSample->BitDepth) + " Bits"; |
1047 |
|
s += " " + ToString(d->pSample->SamplesPerSecond/1000) + "." |
1048 |
|
+ ToString((d->pSample->SamplesPerSecond%1000)/100) + " kHz"; |
1049 |
|
} else { |
1050 |
|
s = _("No sample assigned to this dimension region."); |
1051 |
|
} |
1052 |
|
eSampleFormatInfo.text.set_text(s); |
1053 |
|
} |
1054 |
|
// generate sample's memory address pointer string |
1055 |
|
{ |
1056 |
|
Glib::ustring s; |
1057 |
|
if (d->pSample) { |
1058 |
|
char buf[64] = {}; |
1059 |
|
snprintf(buf, sizeof(buf), "%p", d->pSample); |
1060 |
|
s = buf; |
1061 |
|
} else { |
1062 |
|
s = "---"; |
1063 |
|
} |
1064 |
|
eSampleID.text.set_text(s); |
1065 |
|
} |
1066 |
|
// generate raw wave form data CRC-32 checksum string |
1067 |
|
{ |
1068 |
|
Glib::ustring s = "---"; |
1069 |
|
if (d->pSample) { |
1070 |
|
char buf[64] = {}; |
1071 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1072 |
|
s = buf; |
1073 |
|
} |
1074 |
|
eChecksum.text.set_text(s); |
1075 |
|
} |
1076 |
|
buttonSelectSample.set_sensitive(d && d->pSample); |
1077 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1078 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1079 |
eGainPlus6.set_value(d->Gain); |
eGainPlus6.set_value(d->Gain); |
1090 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
d->pSample ? d->pSample->LoopPlayCount : 0); |
1091 |
update_model--; |
update_model--; |
1092 |
|
|
1093 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) : |
1094 |
|
_("NULL")); |
1095 |
|
|
1096 |
update_loop_elements(); |
update_loop_elements(); |
1097 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
1106 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
1107 |
eVCFVelocityScale.set_sensitive(sensitive); |
eVCFVelocityScale.set_sensitive(sensitive); |
1108 |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
1109 |
|
cutoff_curve.set_sensitive(sensitive); |
1110 |
eVCFResonance.set_sensitive(sensitive); |
eVCFResonance.set_sensitive(sensitive); |
1111 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
1112 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
1199 |
eCrossfade_in_end.set_sensitive(hasController); |
eCrossfade_in_end.set_sensitive(hasController); |
1200 |
eCrossfade_out_start.set_sensitive(hasController); |
eCrossfade_out_start.set_sensitive(hasController); |
1201 |
eCrossfade_out_end.set_sensitive(hasController); |
eCrossfade_out_end.set_sensitive(hasController); |
1202 |
|
crossfade_curve.set_sensitive(hasController); |
1203 |
} |
} |
1204 |
|
|
1205 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
1313 |
update_model--; |
update_model--; |
1314 |
} |
} |
1315 |
|
|
1316 |
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) |
1317 |
|
{ |
1318 |
|
bool result = false; |
1319 |
|
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1320 |
|
itDimReg != dimregs.end(); ++itDimReg) |
1321 |
|
{ |
1322 |
|
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1323 |
|
} |
1324 |
|
return result; |
1325 |
|
} |
1326 |
|
|
1327 |
|
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1328 |
{ |
{ |
1329 |
if (dimregion) { |
if (dimreg) { |
1330 |
//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 |
1331 |
|
|
1332 |
// 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() |
1333 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1334 |
|
|
1335 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1336 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1337 |
int nbDimregs = 1; |
int nbDimregs = 1; |
1338 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1339 |
if (sample->Channels == 2) { |
if (sample->Channels == 2) { |
1340 |
gig::Region* region = dimregion->GetParent(); |
gig::Region* region = dimreg->GetParent(); |
1341 |
|
|
1342 |
int bitcount = 0; |
int bitcount = 0; |
1343 |
int stereo_bit = 0; |
int stereo_bit = 0; |
1352 |
if (stereo_bit) { |
if (stereo_bit) { |
1353 |
int dimregno; |
int dimregno; |
1354 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1355 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1356 |
break; |
break; |
1357 |
} |
} |
1358 |
} |
} |
1362 |
} |
} |
1363 |
} |
} |
1364 |
|
|
1365 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimreg->pSample; |
1366 |
|
|
1367 |
for (int i = 0 ; i < nbDimregs ; i++) { |
for (int i = 0 ; i < nbDimregs ; i++) { |
1368 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1369 |
|
|
1370 |
// copy sample information from Sample to DimensionRegion |
// copy sample information from Sample to DimensionRegion |
1371 |
|
if (copy_sample_unity) |
1372 |
d[i]->UnityNote = sample->MIDIUnityNote; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1373 |
d[i]->FineTune = sample->FineTune; |
if (copy_sample_tune) |
1374 |
|
d[i]->FineTune = sample->FineTune; |
1375 |
int loops = sample->Loops ? 1 : 0; |
if (copy_sample_loop) { |
1376 |
while (d[i]->SampleLoops > loops) { |
int loops = sample->Loops ? 1 : 0; |
1377 |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
while (d[i]->SampleLoops > loops) { |
1378 |
} |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1379 |
while (d[i]->SampleLoops < sample->Loops) { |
} |
1380 |
DLS::sample_loop_t loop; |
while (d[i]->SampleLoops < sample->Loops) { |
1381 |
d[i]->AddSampleLoop(&loop); |
DLS::sample_loop_t loop; |
1382 |
} |
d[i]->AddSampleLoop(&loop); |
1383 |
if (loops) { |
} |
1384 |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
if (loops) { |
1385 |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1386 |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1387 |
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1388 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1389 |
|
} |
1390 |
} |
} |
1391 |
} |
} |
1392 |
|
|
1393 |
// update ui |
// update ui |
1394 |
update_model++; |
update_model++; |
1395 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1396 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1397 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1398 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1399 |
update_loop_elements(); |
update_loop_elements(); |
1400 |
update_model--; |
update_model--; |
1401 |
|
|
1402 |
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); |
|
1403 |
return true; |
return true; |
1404 |
} |
} |
1405 |
return false; |
return false; |
1468 |
if (value) { |
if (value) { |
1469 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1470 |
if (!d->SampleLoops) { |
if (!d->SampleLoops) { |
1471 |
|
DimRegionChangeGuard(this, d); |
1472 |
|
|
1473 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1474 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1475 |
// loop the whole sample by default |
// loop the whole sample by default |
1476 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1477 |
loop.LoopLength = |
loop.LoopLength = |
1478 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
|
dimreg_to_be_changed_signal.emit(d); |
|
1479 |
d->AddSampleLoop(&loop); |
d->AddSampleLoop(&loop); |
|
dimreg_changed_signal.emit(d); |
|
1480 |
} |
} |
1481 |
} else { |
} else { |
1482 |
if (d->SampleLoops) { |
if (d->SampleLoops) { |
1483 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, d); |
1484 |
|
|
1485 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1486 |
while (d->SampleLoops) { |
while (d->SampleLoops) { |
1487 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1488 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1489 |
} |
} |
1490 |
} |
} |
1491 |
} |
} |
1529 |
{ |
{ |
1530 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d->pSample) d->pSample->LoopPlayCount = value; |
1531 |
} |
} |
1532 |
|
|
1533 |
|
void DimRegionEdit::nullOutSampleReference() { |
1534 |
|
if (!dimregion) return; |
1535 |
|
gig::Sample* oldref = dimregion->pSample; |
1536 |
|
if (!oldref) return; |
1537 |
|
|
1538 |
|
DimRegionChangeGuard(this, dimregion); |
1539 |
|
|
1540 |
|
// in case currently assigned sample is a stereo one, then remove both |
1541 |
|
// references (expected to be due to a "stereo dimension") |
1542 |
|
gig::DimensionRegion* d[2] = { dimregion, NULL }; |
1543 |
|
if (oldref->Channels == 2) { |
1544 |
|
gig::Region* region = dimregion->GetParent(); |
1545 |
|
{ |
1546 |
|
int stereo_bit = 0; |
1547 |
|
int bitcount = 0; |
1548 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1549 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1550 |
|
stereo_bit = 1 << bitcount; |
1551 |
|
break; |
1552 |
|
} |
1553 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1554 |
|
} |
1555 |
|
|
1556 |
|
if (stereo_bit) { |
1557 |
|
int dimregno; |
1558 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1559 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
1560 |
|
break; |
1561 |
|
} |
1562 |
|
} |
1563 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1564 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1565 |
|
} |
1566 |
|
} |
1567 |
|
} |
1568 |
|
|
1569 |
|
if (d[0]) d[0]->pSample = NULL; |
1570 |
|
if (d[1]) d[1]->pSample = NULL; |
1571 |
|
|
1572 |
|
// update UI elements |
1573 |
|
set_dim_region(dimregion); |
1574 |
|
|
1575 |
|
sample_ref_changed_signal.emit(oldref, NULL); |
1576 |
|
} |
1577 |
|
|
1578 |
|
void DimRegionEdit::onButtonSelectSamplePressed() { |
1579 |
|
if (!dimregion) return; |
1580 |
|
if (!dimregion->pSample) return; |
1581 |
|
select_sample_signal.emit(dimregion->pSample); |
1582 |
|
} |
1583 |
|
|
1584 |
|
sigc::signal<void, gig::Sample*>& DimRegionEdit::signal_select_sample() { |
1585 |
|
return select_sample_signal; |
1586 |
|
} |