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 |
17 |
* 02110-1301 USA. |
* 02110-1301 USA. |
18 |
*/ |
*/ |
19 |
|
|
20 |
|
#include "global.h" |
21 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
22 |
|
|
23 |
#include "global.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 |
|
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
32 |
|
getter(getter), dimreg(0) { |
33 |
|
set_size_request(80, 80); |
34 |
|
} |
35 |
|
|
36 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
37 |
|
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
38 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
39 |
|
get_window()->create_cairo_context(); |
40 |
|
#if 0 |
41 |
|
} |
42 |
|
#endif |
43 |
|
#else |
44 |
|
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
45 |
|
#endif |
46 |
|
if (dimreg) { |
47 |
|
int w = get_width(); |
48 |
|
int h = get_height(); |
49 |
|
|
50 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
51 |
|
for (double x = 0 ; x <= w ; x++) { |
52 |
|
int vel = int(x * (127 - 1e-10) / w + 1); |
53 |
|
double y = (1 - (dimreg->*getter)(vel)) * (h - 3) + 1.5; |
54 |
|
|
55 |
|
if (x < 1e-10) { |
56 |
|
cr->move_to(x, y); |
57 |
|
} else { |
58 |
|
cr->line_to(x, y); |
59 |
|
} |
60 |
|
} |
61 |
|
if (pass == 0) { |
62 |
|
cr->line_to(w, h); |
63 |
|
cr->line_to(0, h); |
64 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 0.2 : 0.1); |
65 |
|
cr->fill(); |
66 |
|
} else { |
67 |
|
cr->set_line_width(3); |
68 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, is_sensitive() ? 1.0 : 0.3); |
69 |
|
cr->stroke(); |
70 |
|
} |
71 |
|
} |
72 |
|
} |
73 |
|
return true; |
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
|
CrossfadeCurve::CrossfadeCurve() : dimreg(0) { |
78 |
|
set_size_request(280, 80); |
79 |
|
} |
80 |
|
|
81 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
82 |
|
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
83 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
84 |
|
get_window()->create_cairo_context(); |
85 |
|
#if 0 |
86 |
|
} |
87 |
|
#endif |
88 |
|
#else |
89 |
|
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
90 |
|
#endif |
91 |
|
if (dimreg) { |
92 |
|
cr->translate(1.5, 0); |
93 |
|
|
94 |
|
// first, draw curves for the other layers |
95 |
|
gig::Region* region = dimreg->GetParent(); |
96 |
|
int dimregno; |
97 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
98 |
|
if (region->pDimensionRegions[dimregno] == dimreg) { |
99 |
|
break; |
100 |
|
} |
101 |
|
} |
102 |
|
int bitcount = 0; |
103 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
104 |
|
if (region->pDimensionDefinitions[dim].dimension == |
105 |
|
gig::dimension_layer) { |
106 |
|
int mask = |
107 |
|
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
108 |
|
bitcount); |
109 |
|
int c = dimregno & mask; // mask away the layer dimension |
110 |
|
|
111 |
|
for (int i = 0 ; i < region->pDimensionDefinitions[dim].zones ; |
112 |
|
i++) { |
113 |
|
gig::DimensionRegion* d = |
114 |
|
region->pDimensionRegions[c + (i << bitcount)]; |
115 |
|
if (d != dimreg) { |
116 |
|
draw_one_curve(cr, d, false); |
117 |
|
} |
118 |
|
} |
119 |
|
break; |
120 |
|
} |
121 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
122 |
|
} |
123 |
|
|
124 |
|
// then, draw the currently selected layer |
125 |
|
draw_one_curve(cr, dimreg, is_sensitive()); |
126 |
|
} |
127 |
|
return true; |
128 |
|
} |
129 |
|
|
130 |
|
void CrossfadeCurve::draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr, |
131 |
|
const gig::DimensionRegion* d, |
132 |
|
bool sensitive) { |
133 |
|
int w = get_width(); |
134 |
|
int h = get_height(); |
135 |
|
|
136 |
|
if (d->Crossfade.out_end) { |
137 |
|
for (int pass = 0 ; pass < 2 ; pass++) { |
138 |
|
cr->move_to(d->Crossfade.in_start / 127.0 * (w - 3), h); |
139 |
|
cr->line_to(d->Crossfade.in_end / 127.0 * (w - 3), 1.5); |
140 |
|
cr->line_to(d->Crossfade.out_start / 127.0 * (w - 3), 1.5); |
141 |
|
cr->line_to(d->Crossfade.out_end / 127.0 * (w - 3), h); |
142 |
|
|
143 |
|
if (pass == 0) { |
144 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 0.2 : 0.1); |
145 |
|
cr->fill(); |
146 |
|
} else { |
147 |
|
cr->set_line_width(3); |
148 |
|
cr->set_source_rgba(0.5, 0.44, 1.0, sensitive ? 1.0 : 0.3); |
149 |
|
cr->stroke(); |
150 |
|
} |
151 |
|
} |
152 |
|
} |
153 |
|
} |
154 |
|
|
155 |
|
|
156 |
|
EGStateOptions::EGStateOptions() : HBox(), |
157 |
|
label(_("May be cancelled: ")), |
158 |
|
checkBoxAttack(_("Attack")), |
159 |
|
checkBoxAttackHold(_("Attack Hold")), |
160 |
|
checkBoxDecay1(_("Decay 1")), |
161 |
|
checkBoxDecay2(_("Decay 2")), |
162 |
|
checkBoxRelease(_("Release")) |
163 |
|
{ |
164 |
|
set_spacing(6); |
165 |
|
|
166 |
|
pack_start(label); |
167 |
|
pack_start(checkBoxAttack, Gtk::PACK_SHRINK); |
168 |
|
pack_start(checkBoxAttackHold, Gtk::PACK_SHRINK); |
169 |
|
pack_start(checkBoxDecay1, Gtk::PACK_SHRINK); |
170 |
|
pack_start(checkBoxDecay2, Gtk::PACK_SHRINK); |
171 |
|
pack_start(checkBoxRelease, Gtk::PACK_SHRINK); |
172 |
|
|
173 |
|
checkBoxAttack.set_tooltip_text(_( |
174 |
|
"If checked: a note-off aborts the 'attack' stage." |
175 |
|
)); |
176 |
|
checkBoxAttackHold.set_tooltip_text(_( |
177 |
|
"If checked: a note-off aborts the 'attack hold' stage." |
178 |
|
)); |
179 |
|
checkBoxDecay1.set_tooltip_text(_( |
180 |
|
"If checked: a note-off aborts the 'decay 1' stage." |
181 |
|
)); |
182 |
|
checkBoxDecay2.set_tooltip_text(_( |
183 |
|
"If checked: a note-off aborts the 'decay 2' stage." |
184 |
|
)); |
185 |
|
checkBoxRelease.set_tooltip_text(_( |
186 |
|
"If checked: a note-on reverts back from the 'release' stage." |
187 |
|
)); |
188 |
|
} |
189 |
|
|
190 |
|
|
191 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
192 |
eEG1PreAttack(_("Pre-attack"), 0, 100, 2), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
193 |
eEG1Attack(_("Attack"), 0, 60, 3), |
release_curve(&gig::DimensionRegion::GetVelocityRelease), |
194 |
eEG1Decay1(_("Decay 1"), 0.005, 60, 3), |
cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff), |
195 |
eEG1Decay2(_("Decay 2"), 0, 60, 3), |
eEG1PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
196 |
|
eEG1Attack(_("Attack Time (seconds)"), 0, 60, 3), |
197 |
|
eEG1Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
198 |
|
eEG1Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
199 |
eEG1InfiniteSustain(_("Infinite sustain")), |
eEG1InfiniteSustain(_("Infinite sustain")), |
200 |
eEG1Sustain(_("Sustain"), 0, 100, 2), |
eEG1Sustain(_("Sustain Level (%)"), 0, 100, 2), |
201 |
eEG1Release(_("Release"), 0, 60, 3), |
eEG1Release(_("Release Time (seconds)"), 0, 60, 3), |
202 |
eEG1Hold(_("Hold")), |
eEG1Hold(_("Hold Attack Stage until Loop End")), |
203 |
eEG1Controller(_("Controller")), |
eEG1Controller(_("Controller")), |
204 |
eEG1ControllerInvert(_("Controller invert")), |
eEG1ControllerInvert(_("Controller invert")), |
205 |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
211 |
eLFO1Controller(_("Controller")), |
eLFO1Controller(_("Controller")), |
212 |
eLFO1FlipPhase(_("Flip phase")), |
eLFO1FlipPhase(_("Flip phase")), |
213 |
eLFO1Sync(_("Sync")), |
eLFO1Sync(_("Sync")), |
214 |
eEG2PreAttack(_("Pre-attack"), 0, 100, 2), |
eEG2PreAttack(_("Pre-attack Level (%)"), 0, 100, 2), |
215 |
eEG2Attack(_("Attack"), 0, 60, 3), |
eEG2Attack(_("Attack Time (seconds)"), 0, 60, 3), |
216 |
eEG2Decay1(_("Decay 1"), 0.005, 60, 3), |
eEG2Decay1(_("Decay 1 Time (seconds)"), 0.005, 60, 3), |
217 |
eEG2Decay2(_("Decay 2"), 0, 60, 3), |
eEG2Decay2(_("Decay 2 Time (seconds)"), 0, 60, 3), |
218 |
eEG2InfiniteSustain(_("Infinite sustain")), |
eEG2InfiniteSustain(_("Infinite sustain")), |
219 |
eEG2Sustain(_("Sustain"), 0, 100, 2), |
eEG2Sustain(_("Sustain Level (%)"), 0, 100, 2), |
220 |
eEG2Release(_("Release"), 0, 60, 3), |
eEG2Release(_("Release Time (seconds)"), 0, 60, 3), |
221 |
eEG2Controller(_("Controller")), |
eEG2Controller(_("Controller")), |
222 |
eEG2ControllerInvert(_("Controller invert")), |
eEG2ControllerInvert(_("Controller invert")), |
223 |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3), |
262 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
263 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
264 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
265 |
eSelfMask(_("Self mask")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
266 |
eAttenuationController(_("Attenuation controller")), |
eAttenuationController(_("Attenuation controller")), |
267 |
eInvertAttenuationController(_("Invert attenuation controller")), |
eInvertAttenuationController(_("Invert attenuation controller")), |
268 |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
269 |
eChannelOffset(_("Channel offset"), 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
270 |
eSustainDefeat(_("Sustain defeat")), |
eSustainDefeat(_("Ignore Hold Pedal (a.k.a. \"Sustain defeat\")")), |
271 |
eMSDecode(_("MS decode")), |
eMSDecode(_("Decode Mid/Side Recordings")), |
272 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
273 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
274 |
|
eSampleGroup(_("Sample Group")), |
275 |
|
eSampleFormatInfo(_("Sample Format")), |
276 |
|
eSampleID("Sample ID"), |
277 |
|
eChecksum("Wave Data CRC-32"), |
278 |
eFineTune(_("Fine tune"), -49, 50), |
eFineTune(_("Fine tune"), -49, 50), |
279 |
eGain(_("Gain"), -96, 0, 2, -655360), |
eGain(_("Gain"), -96, 0, 2, -655360), |
280 |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360), |
284 |
eSampleLoopType(_("Loop type")), |
eSampleLoopType(_("Loop type")), |
285 |
eSampleLoopInfinite(_("Infinite loop")), |
eSampleLoopInfinite(_("Infinite loop")), |
286 |
eSampleLoopPlayCount(_("Playback count"), 1), |
eSampleLoopPlayCount(_("Playback count"), 1), |
287 |
|
buttonSelectSample(UNICODE_LEFT_ARROW + " " + _("Select Sample")), |
288 |
update_model(0) |
update_model(0) |
289 |
{ |
{ |
290 |
|
// make synthesis parameter page tabs scrollable |
291 |
|
// (workaround for GTK3: default theme uses huge tabs which breaks layout) |
292 |
|
set_scrollable(); |
293 |
|
|
294 |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack); |
295 |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
connect(eEG1Attack, &gig::DimensionRegion::EG1Attack); |
296 |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1); |
307 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
308 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
309 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
310 |
|
{ |
311 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackCancel)); |
312 |
|
connect(eEG1StateOptions.checkBoxAttack, mp.pmember); |
313 |
|
} |
314 |
|
{ |
315 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackHoldCancel)); |
316 |
|
connect(eEG1StateOptions.checkBoxAttackHold, mp.pmember); |
317 |
|
} |
318 |
|
{ |
319 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay1Cancel)); |
320 |
|
connect(eEG1StateOptions.checkBoxDecay1, mp.pmember); |
321 |
|
} |
322 |
|
{ |
323 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay2Cancel)); |
324 |
|
connect(eEG1StateOptions.checkBoxDecay2, mp.pmember); |
325 |
|
} |
326 |
|
{ |
327 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.ReleaseCancel)); |
328 |
|
connect(eEG1StateOptions.checkBoxRelease, mp.pmember); |
329 |
|
} |
330 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
331 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
332 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
348 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
349 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
350 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
351 |
|
{ |
352 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackCancel)); |
353 |
|
connect(eEG2StateOptions.checkBoxAttack, mp.pmember); |
354 |
|
} |
355 |
|
{ |
356 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackHoldCancel)); |
357 |
|
connect(eEG2StateOptions.checkBoxAttackHold, mp.pmember); |
358 |
|
} |
359 |
|
{ |
360 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay1Cancel)); |
361 |
|
connect(eEG2StateOptions.checkBoxDecay1, mp.pmember); |
362 |
|
} |
363 |
|
{ |
364 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay2Cancel)); |
365 |
|
connect(eEG2StateOptions.checkBoxDecay2, mp.pmember); |
366 |
|
} |
367 |
|
{ |
368 |
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.ReleaseCancel)); |
369 |
|
connect(eEG2StateOptions.checkBoxRelease, mp.pmember); |
370 |
|
} |
371 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
372 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
373 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
438 |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength); |
439 |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite); |
440 |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount); |
441 |
|
buttonSelectSample.signal_clicked().connect( |
442 |
|
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
443 |
|
); |
444 |
|
|
445 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 7 ; i++) { |
446 |
|
#if USE_GTKMM_GRID |
447 |
|
table[i] = new Gtk::Grid; |
448 |
|
table[i]->set_column_spacing(7); |
449 |
|
#else |
450 |
table[i] = new Gtk::Table(3, 1); |
table[i] = new Gtk::Table(3, 1); |
451 |
table[i]->set_col_spacings(7); |
table[i]->set_col_spacings(7); |
452 |
|
#endif |
453 |
|
|
454 |
|
// on Gtk 3 there is absolutely no margin by default |
455 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
456 |
|
# if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12 |
457 |
|
table[i]->set_margin_left(12); |
458 |
|
table[i]->set_margin_right(12); |
459 |
|
# else |
460 |
|
table[i]->set_margin_start(12); |
461 |
|
table[i]->set_margin_end(12); |
462 |
|
# endif |
463 |
|
#endif |
464 |
} |
} |
465 |
|
|
466 |
// set tooltips |
// set tooltips |
467 |
eUnityNote.set_tip( |
eUnityNote.set_tip( |
468 |
_("Note this sample is associated with (a.k.a. 'root note')") |
_("Note this sample is associated with (a.k.a. 'root note')") |
469 |
); |
); |
470 |
|
buttonSelectSample.set_tooltip_text( |
471 |
|
_("Selects the sample of this dimension region on the left hand side's sample tree view.") |
472 |
|
); |
473 |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
eSampleStartOffset.set_tip(_("Sample position at which playback should be started")); |
474 |
ePan.set_tip(_("Stereo balance (left/right)")); |
ePan.set_tip(_("Stereo balance (left/right)")); |
475 |
eChannelOffset.set_tip( |
eChannelOffset.set_tip( |
500 |
"Caution: this setting is stored on Sample side, thus is shared " |
"Caution: this setting is stored on Sample side, thus is shared " |
501 |
"among all dimension regions that use this sample!") |
"among all dimension regions that use this sample!") |
502 |
); |
); |
503 |
|
|
504 |
|
eEG1PreAttack.set_tip( |
505 |
|
"Very first level this EG starts with. It rises then in Attack Time " |
506 |
|
"seconds from this initial level to 100%." |
507 |
|
); |
508 |
|
eEG1Attack.set_tip( |
509 |
|
"Duration of the EG's Attack stage, which raises its level from " |
510 |
|
"Pre-Attack Level to 100%." |
511 |
|
); |
512 |
|
eEG1Hold.set_tip( |
513 |
|
"On looped sounds, enabling this will cause the Decay 1 stage not to " |
514 |
|
"enter before the loop has been passed one time." |
515 |
|
); |
516 |
|
eAttenuationController.set_tip(_( |
517 |
|
"If you are not using the 'Layer' dimension, then this controller " |
518 |
|
"simply alters the volume. If you are using the 'Layer' dimension, " |
519 |
|
"then this controller is controlling the crossfade between Layers in " |
520 |
|
"real-time." |
521 |
|
)); |
522 |
|
|
523 |
|
eLFO1Sync.set_tip( |
524 |
|
"If not checked, every voice will use its own LFO instance, which " |
525 |
|
"causes voices triggered at different points in time to have different " |
526 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
527 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
528 |
|
"no matter when the individual notes have been triggered." |
529 |
|
); |
530 |
|
eLFO2Sync.set_tip( |
531 |
|
"If not checked, every voice will use its own LFO instance, which " |
532 |
|
"causes voices triggered at different points in time to have different " |
533 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
534 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
535 |
|
"no matter when the individual notes have been triggered." |
536 |
|
); |
537 |
|
eLFO3Sync.set_tip( |
538 |
|
"If not checked, every voice will use its own LFO instance, which " |
539 |
|
"causes voices triggered at different points in time to have different " |
540 |
|
"LFO levels. By enabling 'Sync' here the voices will instead use and " |
541 |
|
"share one single LFO, causing all voices to have the same LFO level, " |
542 |
|
"no matter when the individual notes have been triggered." |
543 |
|
); |
544 |
|
eLFO1FlipPhase.set_tip( |
545 |
|
"Inverts the LFO's generated wave vertically." |
546 |
|
); |
547 |
|
eLFO2FlipPhase.set_tip( |
548 |
|
"Inverts the LFO's generated wave vertically." |
549 |
|
); |
550 |
|
|
551 |
pageno = 0; |
pageno = 0; |
552 |
rowno = 0; |
rowno = 0; |
553 |
firstRowInBlock = 0; |
firstRowInBlock = 0; |
554 |
|
|
555 |
addHeader(_("Mandatory Settings")); |
addHeader(_("Mandatory Settings")); |
556 |
addString(_("Sample"), lSample, wSample); |
addString(_("Sample"), lSample, wSample, buttonNullSampleReference); |
557 |
|
buttonNullSampleReference->set_label("X"); |
558 |
|
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.")); |
559 |
|
buttonNullSampleReference->signal_clicked().connect( |
560 |
|
sigc::mem_fun(*this, &DimRegionEdit::nullOutSampleReference) |
561 |
|
); |
562 |
//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); |
563 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
#ifdef OLD_TOOLTIPS |
564 |
|
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
565 |
|
#else |
566 |
|
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
567 |
|
#endif |
568 |
addProp(eUnityNote); |
addProp(eUnityNote); |
569 |
|
addProp(eSampleGroup); |
570 |
|
addProp(eSampleFormatInfo); |
571 |
|
addProp(eSampleID); |
572 |
|
addProp(eChecksum); |
573 |
|
addRightHandSide(buttonSelectSample); |
574 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
575 |
addProp(eSampleStartOffset); |
addProp(eSampleStartOffset); |
576 |
addProp(eChannelOffset); |
addProp(eChannelOffset); |
600 |
addHeader(_("Amplitude Envelope (EG1)")); |
addHeader(_("Amplitude Envelope (EG1)")); |
601 |
addProp(eEG1PreAttack); |
addProp(eEG1PreAttack); |
602 |
addProp(eEG1Attack); |
addProp(eEG1Attack); |
603 |
|
addProp(eEG1Hold); |
604 |
addProp(eEG1Decay1); |
addProp(eEG1Decay1); |
605 |
addProp(eEG1Decay2); |
addProp(eEG1Decay2); |
606 |
addProp(eEG1InfiniteSustain); |
addProp(eEG1InfiniteSustain); |
607 |
addProp(eEG1Sustain); |
addProp(eEG1Sustain); |
608 |
addProp(eEG1Release); |
addProp(eEG1Release); |
|
addProp(eEG1Hold); |
|
609 |
addProp(eEG1Controller); |
addProp(eEG1Controller); |
610 |
addProp(eEG1ControllerInvert); |
addProp(eEG1ControllerInvert); |
611 |
addProp(eEG1ControllerAttackInfluence); |
addProp(eEG1ControllerAttackInfluence); |
612 |
addProp(eEG1ControllerDecayInfluence); |
addProp(eEG1ControllerDecayInfluence); |
613 |
addProp(eEG1ControllerReleaseInfluence); |
addProp(eEG1ControllerReleaseInfluence); |
614 |
|
addLine(eEG1StateOptions); |
615 |
|
|
616 |
nextPage(); |
nextPage(); |
617 |
|
|
643 |
addProp(eCrossfade_out_start); |
addProp(eCrossfade_out_start); |
644 |
addProp(eCrossfade_out_end); |
addProp(eCrossfade_out_end); |
645 |
|
|
646 |
|
Gtk::Frame* frame = new Gtk::Frame; |
647 |
|
frame->add(crossfade_curve); |
648 |
|
// on Gtk 3 there is no margin at all by default |
649 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
650 |
|
frame->set_margin_top(12); |
651 |
|
frame->set_margin_bottom(12); |
652 |
|
#endif |
653 |
|
#if USE_GTKMM_GRID |
654 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
655 |
|
#else |
656 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
657 |
|
Gtk::SHRINK, Gtk::SHRINK); |
658 |
|
#endif |
659 |
|
rowno++; |
660 |
|
|
661 |
|
eCrossfade_in_start.signal_value_changed().connect( |
662 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
663 |
|
eCrossfade_in_end.signal_value_changed().connect( |
664 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
665 |
|
eCrossfade_out_start.signal_value_changed().connect( |
666 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
667 |
|
eCrossfade_out_end.signal_value_changed().connect( |
668 |
|
sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw)); |
669 |
|
|
670 |
nextPage(); |
nextPage(); |
671 |
|
|
672 |
addHeader(_("General Filter Settings")); |
addHeader(_("General Filter Settings")); |
717 |
addProp(eVCFVelocityCurve); |
addProp(eVCFVelocityCurve); |
718 |
addProp(eVCFVelocityScale); |
addProp(eVCFVelocityScale); |
719 |
addProp(eVCFVelocityDynamicRange); |
addProp(eVCFVelocityDynamicRange); |
720 |
|
|
721 |
|
eVCFCutoffController.signal_value_changed().connect( |
722 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
723 |
|
eVCFVelocityCurve.signal_value_changed().connect( |
724 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
725 |
|
eVCFVelocityScale.signal_value_changed().connect( |
726 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
727 |
|
eVCFVelocityDynamicRange.signal_value_changed().connect( |
728 |
|
sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw)); |
729 |
|
|
730 |
|
frame = new Gtk::Frame; |
731 |
|
frame->add(cutoff_curve); |
732 |
|
// on Gtk 3 there is no margin at all by default |
733 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
734 |
|
frame->set_margin_top(12); |
735 |
|
frame->set_margin_bottom(12); |
736 |
|
#endif |
737 |
|
#if USE_GTKMM_GRID |
738 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
739 |
|
#else |
740 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
741 |
|
Gtk::SHRINK, Gtk::SHRINK); |
742 |
|
#endif |
743 |
|
rowno++; |
744 |
|
|
745 |
addProp(eVCFResonance); |
addProp(eVCFResonance); |
746 |
addProp(eVCFResonanceDynamic); |
addProp(eVCFResonanceDynamic); |
747 |
{ |
{ |
775 |
addProp(eEG2ControllerAttackInfluence); |
addProp(eEG2ControllerAttackInfluence); |
776 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
777 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
778 |
|
addLine(eEG2StateOptions); |
779 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
780 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
781 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
825 |
|
|
826 |
nextPage(); |
nextPage(); |
827 |
|
|
828 |
|
addHeader(_("Velocity Response")); |
829 |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values); |
830 |
addProp(eVelocityResponseCurve); |
addProp(eVelocityResponseCurve); |
831 |
addProp(eVelocityResponseDepth); |
addProp(eVelocityResponseDepth); |
832 |
addProp(eVelocityResponseCurveScaling); |
addProp(eVelocityResponseCurveScaling); |
833 |
|
|
834 |
|
eVelocityResponseCurve.signal_value_changed().connect( |
835 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
836 |
|
eVelocityResponseDepth.signal_value_changed().connect( |
837 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
838 |
|
eVelocityResponseCurveScaling.signal_value_changed().connect( |
839 |
|
sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw)); |
840 |
|
|
841 |
|
frame = new Gtk::Frame; |
842 |
|
frame->add(velocity_curve); |
843 |
|
// on Gtk 3 there is no margin at all by default |
844 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
845 |
|
frame->set_margin_top(12); |
846 |
|
frame->set_margin_bottom(12); |
847 |
|
#endif |
848 |
|
#if USE_GTKMM_GRID |
849 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
850 |
|
#else |
851 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
852 |
|
Gtk::SHRINK, Gtk::SHRINK); |
853 |
|
#endif |
854 |
|
rowno++; |
855 |
|
|
856 |
|
addHeader(_("Release Velocity Response")); |
857 |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
eReleaseVelocityResponseCurve.set_choices(curve_type_texts, |
858 |
curve_type_values); |
curve_type_values); |
859 |
addProp(eReleaseVelocityResponseCurve); |
addProp(eReleaseVelocityResponseCurve); |
860 |
addProp(eReleaseVelocityResponseDepth); |
addProp(eReleaseVelocityResponseDepth); |
861 |
|
|
862 |
|
eReleaseVelocityResponseCurve.signal_value_changed().connect( |
863 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
864 |
|
eReleaseVelocityResponseDepth.signal_value_changed().connect( |
865 |
|
sigc::mem_fun(release_curve, &VelocityCurve::queue_draw)); |
866 |
|
frame = new Gtk::Frame; |
867 |
|
frame->add(release_curve); |
868 |
|
// on Gtk 3 there is no margin at all by default |
869 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
870 |
|
frame->set_margin_top(12); |
871 |
|
frame->set_margin_bottom(12); |
872 |
|
#endif |
873 |
|
#if USE_GTKMM_GRID |
874 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
875 |
|
#else |
876 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
877 |
|
Gtk::SHRINK, Gtk::SHRINK); |
878 |
|
#endif |
879 |
|
rowno++; |
880 |
|
|
881 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
882 |
{ |
{ |
883 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
889 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
890 |
} |
} |
891 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
892 |
|
eSelfMask.widget.set_tooltip_text(_( |
893 |
|
"If enabled: new notes with higher velocity value will stop older " |
894 |
|
"notes with lower velocity values, that way you can save voices that " |
895 |
|
"would barely be audible. This is also useful for certain drum sounds." |
896 |
|
)); |
897 |
addProp(eSelfMask); |
addProp(eSelfMask); |
898 |
|
eSustainDefeat.widget.set_tooltip_text(_( |
899 |
|
"If enabled: sustain pedal will not hold a note. This way you can use " |
900 |
|
"the sustain pedal for other purposes, for example to switch among " |
901 |
|
"dimension regions." |
902 |
|
)); |
903 |
addProp(eSustainDefeat); |
addProp(eSustainDefeat); |
904 |
|
eMSDecode.widget.set_tooltip_text(_( |
905 |
|
"Defines if Mid/Side Recordings should be decoded. Mid/Side Recordings " |
906 |
|
"are an alternative way to record sounds in stereo. The sampler needs " |
907 |
|
"to decode such samples to actually make use of them. Note: this " |
908 |
|
"feature is currently not supported by LinuxSampler." |
909 |
|
)); |
910 |
addProp(eMSDecode); |
addProp(eMSDecode); |
911 |
|
|
912 |
nextPage(); |
nextPage(); |
970 |
Gtk::Entry*& widget) |
Gtk::Entry*& widget) |
971 |
{ |
{ |
972 |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
973 |
label->set_alignment(Gtk::ALIGN_LEFT); |
#if HAS_GTKMM_ALIGNMENT |
974 |
|
label->set_alignment(Gtk::ALIGN_START); |
975 |
|
#else |
976 |
|
label->set_halign(Gtk::Align::START); |
977 |
|
#endif |
978 |
|
|
979 |
|
#if USE_GTKMM_GRID |
980 |
|
table[pageno]->attach(*label, 1, rowno); |
981 |
|
#else |
982 |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
983 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
984 |
|
#endif |
985 |
|
|
986 |
widget = new Gtk::Entry(); |
widget = new Gtk::Entry(); |
987 |
|
|
988 |
|
#if USE_GTKMM_GRID |
989 |
|
table[pageno]->attach(*widget, 2, rowno); |
990 |
|
#else |
991 |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(*widget, 2, 3, rowno, rowno + 1, |
992 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
993 |
|
#endif |
994 |
|
|
995 |
|
rowno++; |
996 |
|
} |
997 |
|
|
998 |
|
void DimRegionEdit::addString(const char* labelText, Gtk::Label*& label, |
999 |
|
Gtk::Entry*& widget, Gtk::Button*& button) |
1000 |
|
{ |
1001 |
|
label = new Gtk::Label(Glib::ustring(labelText) + ":"); |
1002 |
|
#if HAS_GTKMM_ALIGNMENT |
1003 |
|
label->set_alignment(Gtk::ALIGN_START); |
1004 |
|
#else |
1005 |
|
label->set_halign(Gtk::Align::START); |
1006 |
|
#endif |
1007 |
|
|
1008 |
|
#if USE_GTKMM_GRID |
1009 |
|
table[pageno]->attach(*label, 1, rowno); |
1010 |
|
#else |
1011 |
|
table[pageno]->attach(*label, 1, 2, rowno, rowno + 1, |
1012 |
|
Gtk::FILL, Gtk::SHRINK); |
1013 |
|
#endif |
1014 |
|
|
1015 |
|
widget = new Gtk::Entry(); |
1016 |
|
button = new Gtk::Button(); |
1017 |
|
|
1018 |
|
HBox* hbox = new HBox; |
1019 |
|
hbox->pack_start(*widget); |
1020 |
|
hbox->pack_start(*button, Gtk::PACK_SHRINK); |
1021 |
|
|
1022 |
|
#if USE_GTKMM_GRID |
1023 |
|
table[pageno]->attach(*hbox, 2, rowno); |
1024 |
|
#else |
1025 |
|
table[pageno]->attach(*hbox, 2, 3, rowno, rowno + 1, |
1026 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1027 |
|
#endif |
1028 |
|
|
1029 |
rowno++; |
rowno++; |
1030 |
} |
} |
1034 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1035 |
{ |
{ |
1036 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1037 |
|
#if USE_GTKMM_GRID |
1038 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1039 |
|
#else |
1040 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1041 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1042 |
|
#endif |
1043 |
} |
} |
1044 |
Glib::ustring str = "<b>"; |
Glib::ustring str = "<b>"; |
1045 |
str += text; |
str += text; |
1046 |
str += "</b>"; |
str += "</b>"; |
1047 |
Gtk::Label* label = new Gtk::Label(str); |
Gtk::Label* label = new Gtk::Label(str); |
1048 |
label->set_use_markup(); |
label->set_use_markup(); |
1049 |
label->set_alignment(Gtk::ALIGN_LEFT); |
#if HAS_GTKMM_ALIGNMENT |
1050 |
|
label->set_alignment(Gtk::ALIGN_START); |
1051 |
|
#else |
1052 |
|
label->set_halign(Gtk::Align::START); |
1053 |
|
#endif |
1054 |
|
// on GTKMM 3 there is absolutely no margin by default |
1055 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
1056 |
|
label->set_margin_top(18); |
1057 |
|
label->set_margin_bottom(13); |
1058 |
|
#endif |
1059 |
|
#if USE_GTKMM_GRID |
1060 |
|
table[pageno]->attach(*label, 0, rowno, 3); |
1061 |
|
#else |
1062 |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
table[pageno]->attach(*label, 0, 3, rowno, rowno + 1, |
1063 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1064 |
|
#endif |
1065 |
rowno++; |
rowno++; |
1066 |
firstRowInBlock = rowno; |
firstRowInBlock = rowno; |
1067 |
return label; |
return label; |
1072 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1073 |
{ |
{ |
1074 |
Gtk::Label* filler = new Gtk::Label(" "); |
Gtk::Label* filler = new Gtk::Label(" "); |
1075 |
|
#if USE_GTKMM_GRID |
1076 |
|
table[pageno]->attach(*filler, 0, firstRowInBlock); |
1077 |
|
#else |
1078 |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
table[pageno]->attach(*filler, 0, 1, firstRowInBlock, rowno, |
1079 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1080 |
|
#endif |
1081 |
} |
} |
1082 |
pageno++; |
pageno++; |
1083 |
rowno = 0; |
rowno = 0; |
1086 |
|
|
1087 |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
void DimRegionEdit::addProp(BoolEntry& boolentry) |
1088 |
{ |
{ |
1089 |
|
#if USE_GTKMM_GRID |
1090 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1091 |
|
#else |
1092 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1093 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1094 |
|
#endif |
1095 |
rowno++; |
rowno++; |
1096 |
} |
} |
1097 |
|
|
1098 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
1099 |
{ |
{ |
1100 |
|
#if USE_GTKMM_GRID |
1101 |
|
table[pageno]->attach(boolentry.widget, 1, rowno, 2); |
1102 |
|
#else |
1103 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
1104 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1105 |
|
#endif |
1106 |
rowno++; |
rowno++; |
1107 |
} |
} |
1108 |
|
|
1109 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
1110 |
{ |
{ |
1111 |
|
#if USE_GTKMM_GRID |
1112 |
|
table[pageno]->attach(prop.label, 1, rowno); |
1113 |
|
table[pageno]->attach(prop.widget, 2, rowno); |
1114 |
|
#else |
1115 |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
table[pageno]->attach(prop.label, 1, 2, rowno, rowno + 1, |
1116 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
1117 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
1118 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1119 |
|
#endif |
1120 |
|
rowno++; |
1121 |
|
} |
1122 |
|
|
1123 |
|
void DimRegionEdit::addLine(HBox& line) |
1124 |
|
{ |
1125 |
|
#if USE_GTKMM_GRID |
1126 |
|
table[pageno]->attach(line, 1, rowno, 2); |
1127 |
|
#else |
1128 |
|
table[pageno]->attach(line, 1, 3, rowno, rowno + 1, |
1129 |
|
Gtk::FILL, Gtk::SHRINK); |
1130 |
|
#endif |
1131 |
rowno++; |
rowno++; |
1132 |
} |
} |
1133 |
|
|
1134 |
|
void DimRegionEdit::addRightHandSide(Gtk::Widget& widget) |
1135 |
|
{ |
1136 |
|
#if USE_GTKMM_GRID |
1137 |
|
table[pageno]->attach(widget, 2, rowno); |
1138 |
|
#else |
1139 |
|
table[pageno]->attach(widget, 2, 3, rowno, rowno + 1, |
1140 |
|
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
1141 |
|
#endif |
1142 |
|
rowno++; |
1143 |
|
} |
1144 |
|
|
1145 |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
void DimRegionEdit::set_dim_region(gig::DimensionRegion* d) |
1146 |
{ |
{ |
1147 |
dimregion = d; |
dimregion = d; |
1148 |
|
velocity_curve.set_dim_region(d); |
1149 |
|
release_curve.set_dim_region(d); |
1150 |
|
cutoff_curve.set_dim_region(d); |
1151 |
|
crossfade_curve.set_dim_region(d); |
1152 |
|
|
1153 |
set_sensitive(d); |
set_sensitive(d); |
1154 |
if (!d) return; |
if (!d) return; |
1167 |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
eEG1ControllerAttackInfluence.set_value(d->EG1ControllerAttackInfluence); |
1168 |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
eEG1ControllerDecayInfluence.set_value(d->EG1ControllerDecayInfluence); |
1169 |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
eEG1ControllerReleaseInfluence.set_value(d->EG1ControllerReleaseInfluence); |
1170 |
|
eEG1StateOptions.checkBoxAttack.set_value(d->EG1Options.AttackCancel); |
1171 |
|
eEG1StateOptions.checkBoxAttackHold.set_value(d->EG1Options.AttackHoldCancel); |
1172 |
|
eEG1StateOptions.checkBoxDecay1.set_value(d->EG1Options.Decay1Cancel); |
1173 |
|
eEG1StateOptions.checkBoxDecay2.set_value(d->EG1Options.Decay2Cancel); |
1174 |
|
eEG1StateOptions.checkBoxRelease.set_value(d->EG1Options.ReleaseCancel); |
1175 |
eLFO1Frequency.set_value(d->LFO1Frequency); |
eLFO1Frequency.set_value(d->LFO1Frequency); |
1176 |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
eLFO1InternalDepth.set_value(d->LFO1InternalDepth); |
1177 |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
eLFO1ControlDepth.set_value(d->LFO1ControlDepth); |
1190 |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
eEG2ControllerAttackInfluence.set_value(d->EG2ControllerAttackInfluence); |
1191 |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
eEG2ControllerDecayInfluence.set_value(d->EG2ControllerDecayInfluence); |
1192 |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
eEG2ControllerReleaseInfluence.set_value(d->EG2ControllerReleaseInfluence); |
1193 |
|
eEG2StateOptions.checkBoxAttack.set_value(d->EG2Options.AttackCancel); |
1194 |
|
eEG2StateOptions.checkBoxAttackHold.set_value(d->EG2Options.AttackHoldCancel); |
1195 |
|
eEG2StateOptions.checkBoxDecay1.set_value(d->EG2Options.Decay1Cancel); |
1196 |
|
eEG2StateOptions.checkBoxDecay2.set_value(d->EG2Options.Decay2Cancel); |
1197 |
|
eEG2StateOptions.checkBoxRelease.set_value(d->EG2Options.ReleaseCancel); |
1198 |
eLFO2Frequency.set_value(d->LFO2Frequency); |
eLFO2Frequency.set_value(d->LFO2Frequency); |
1199 |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
eLFO2InternalDepth.set_value(d->LFO2InternalDepth); |
1200 |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
eLFO2ControlDepth.set_value(d->LFO2ControlDepth); |
1243 |
eMSDecode.set_value(d->MSDecode); |
eMSDecode.set_value(d->MSDecode); |
1244 |
eSampleStartOffset.set_value(d->SampleStartOffset); |
eSampleStartOffset.set_value(d->SampleStartOffset); |
1245 |
eUnityNote.set_value(d->UnityNote); |
eUnityNote.set_value(d->UnityNote); |
1246 |
|
// show sample group name |
1247 |
|
{ |
1248 |
|
Glib::ustring s = "---"; |
1249 |
|
if (d->pSample && d->pSample->GetGroup()) |
1250 |
|
s = d->pSample->GetGroup()->Name; |
1251 |
|
eSampleGroup.text.set_text(s); |
1252 |
|
} |
1253 |
|
// assemble sample format info string |
1254 |
|
{ |
1255 |
|
Glib::ustring s; |
1256 |
|
if (d->pSample) { |
1257 |
|
switch (d->pSample->Channels) { |
1258 |
|
case 1: s = _("Mono"); break; |
1259 |
|
case 2: s = _("Stereo"); break; |
1260 |
|
default: |
1261 |
|
s = ToString(d->pSample->Channels) + _(" audio channels"); |
1262 |
|
break; |
1263 |
|
} |
1264 |
|
s += " " + ToString(d->pSample->BitDepth) + " Bits"; |
1265 |
|
s += " " + ToString(d->pSample->SamplesPerSecond/1000) + "." |
1266 |
|
+ ToString((d->pSample->SamplesPerSecond%1000)/100) + " kHz"; |
1267 |
|
} else { |
1268 |
|
s = _("No sample assigned to this dimension region."); |
1269 |
|
} |
1270 |
|
eSampleFormatInfo.text.set_text(s); |
1271 |
|
} |
1272 |
|
// generate sample's memory address pointer string |
1273 |
|
{ |
1274 |
|
Glib::ustring s; |
1275 |
|
if (d->pSample) { |
1276 |
|
char buf[64] = {}; |
1277 |
|
snprintf(buf, sizeof(buf), "%p", d->pSample); |
1278 |
|
s = buf; |
1279 |
|
} else { |
1280 |
|
s = "---"; |
1281 |
|
} |
1282 |
|
eSampleID.text.set_text(s); |
1283 |
|
} |
1284 |
|
// generate raw wave form data CRC-32 checksum string |
1285 |
|
{ |
1286 |
|
Glib::ustring s = "---"; |
1287 |
|
if (d->pSample) { |
1288 |
|
char buf[64] = {}; |
1289 |
|
snprintf(buf, sizeof(buf), "%x", d->pSample->GetWaveDataCRC32Checksum()); |
1290 |
|
s = buf; |
1291 |
|
} |
1292 |
|
eChecksum.text.set_text(s); |
1293 |
|
} |
1294 |
|
buttonSelectSample.set_sensitive(d && d->pSample); |
1295 |
eFineTune.set_value(d->FineTune); |
eFineTune.set_value(d->FineTune); |
1296 |
eGain.set_value(d->Gain); |
eGain.set_value(d->Gain); |
1297 |
eGainPlus6.set_value(d->Gain); |
eGainPlus6.set_value(d->Gain); |
1308 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
d->pSample ? d->pSample->LoopPlayCount : 0); |
1309 |
update_model--; |
update_model--; |
1310 |
|
|
1311 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) : |
1312 |
|
_("NULL")); |
1313 |
|
|
1314 |
update_loop_elements(); |
update_loop_elements(); |
1315 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
1324 |
eVCFVelocityCurve.set_sensitive(sensitive); |
eVCFVelocityCurve.set_sensitive(sensitive); |
1325 |
eVCFVelocityScale.set_sensitive(sensitive); |
eVCFVelocityScale.set_sensitive(sensitive); |
1326 |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
eVCFVelocityDynamicRange.set_sensitive(sensitive); |
1327 |
|
cutoff_curve.set_sensitive(sensitive); |
1328 |
eVCFResonance.set_sensitive(sensitive); |
eVCFResonance.set_sensitive(sensitive); |
1329 |
eVCFResonanceController.set_sensitive(sensitive); |
eVCFResonanceController.set_sensitive(sensitive); |
1330 |
eVCFKeyboardTracking.set_sensitive(sensitive); |
eVCFKeyboardTracking.set_sensitive(sensitive); |
1340 |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
eEG2ControllerAttackInfluence.set_sensitive(sensitive); |
1341 |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
eEG2ControllerDecayInfluence.set_sensitive(sensitive); |
1342 |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
eEG2ControllerReleaseInfluence.set_sensitive(sensitive); |
1343 |
|
eEG2StateOptions.set_sensitive(sensitive); |
1344 |
lLFO2->set_sensitive(sensitive); |
lLFO2->set_sensitive(sensitive); |
1345 |
eLFO2Frequency.set_sensitive(sensitive); |
eLFO2Frequency.set_sensitive(sensitive); |
1346 |
eLFO2InternalDepth.set_sensitive(sensitive); |
eLFO2InternalDepth.set_sensitive(sensitive); |
1418 |
eCrossfade_in_end.set_sensitive(hasController); |
eCrossfade_in_end.set_sensitive(hasController); |
1419 |
eCrossfade_out_start.set_sensitive(hasController); |
eCrossfade_out_start.set_sensitive(hasController); |
1420 |
eCrossfade_out_end.set_sensitive(hasController); |
eCrossfade_out_end.set_sensitive(hasController); |
1421 |
|
crossfade_curve.set_sensitive(hasController); |
1422 |
} |
} |
1423 |
|
|
1424 |
void DimRegionEdit::LFO1Controller_changed() |
void DimRegionEdit::LFO1Controller_changed() |
1532 |
update_model--; |
update_model--; |
1533 |
} |
} |
1534 |
|
|
1535 |
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) |
1536 |
|
{ |
1537 |
|
bool result = false; |
1538 |
|
for (std::set<gig::DimensionRegion*>::iterator itDimReg = dimregs.begin(); |
1539 |
|
itDimReg != dimregs.end(); ++itDimReg) |
1540 |
|
{ |
1541 |
|
result |= set_sample(*itDimReg, sample, copy_sample_unity, copy_sample_tune, copy_sample_loop); |
1542 |
|
} |
1543 |
|
return result; |
1544 |
|
} |
1545 |
|
|
1546 |
|
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1547 |
{ |
{ |
1548 |
if (dimregion) { |
if (dimreg) { |
1549 |
//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 |
1550 |
|
|
1551 |
// 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() |
1552 |
//dimreg_to_be_changed_signal.emit(dimregion); |
//DimRegionChangeGuard(this, dimregion); |
1553 |
|
|
1554 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1555 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1556 |
int nbDimregs = 1; |
int nbDimregs = 1; |
1557 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1558 |
if (sample->Channels == 2) { |
if (sample->Channels == 2) { |
1559 |
gig::Region* region = dimregion->GetParent(); |
gig::Region* region = dimreg->GetParent(); |
1560 |
|
|
1561 |
int bitcount = 0; |
int bitcount = 0; |
1562 |
int stereo_bit = 0; |
int stereo_bit = 0; |
1571 |
if (stereo_bit) { |
if (stereo_bit) { |
1572 |
int dimregno; |
int dimregno; |
1573 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1574 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1575 |
break; |
break; |
1576 |
} |
} |
1577 |
} |
} |
1581 |
} |
} |
1582 |
} |
} |
1583 |
|
|
1584 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimreg->pSample; |
1585 |
|
|
1586 |
for (int i = 0 ; i < nbDimregs ; i++) { |
for (int i = 0 ; i < nbDimregs ; i++) { |
1587 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1588 |
|
|
1589 |
// copy sample information from Sample to DimensionRegion |
// copy sample information from Sample to DimensionRegion |
1590 |
|
if (copy_sample_unity) |
1591 |
d[i]->UnityNote = sample->MIDIUnityNote; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1592 |
d[i]->FineTune = sample->FineTune; |
if (copy_sample_tune) |
1593 |
|
d[i]->FineTune = sample->FineTune; |
1594 |
int loops = sample->Loops ? 1 : 0; |
if (copy_sample_loop) { |
1595 |
while (d[i]->SampleLoops > loops) { |
int loops = sample->Loops ? 1 : 0; |
1596 |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
while (d[i]->SampleLoops > loops) { |
1597 |
} |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1598 |
while (d[i]->SampleLoops < sample->Loops) { |
} |
1599 |
DLS::sample_loop_t loop; |
while (d[i]->SampleLoops < sample->Loops) { |
1600 |
d[i]->AddSampleLoop(&loop); |
DLS::sample_loop_t loop; |
1601 |
} |
d[i]->AddSampleLoop(&loop); |
1602 |
if (loops) { |
} |
1603 |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
if (loops) { |
1604 |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1605 |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1606 |
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1607 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1608 |
|
} |
1609 |
} |
} |
1610 |
} |
} |
1611 |
|
|
1612 |
// update ui |
// update ui |
1613 |
update_model++; |
update_model++; |
1614 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1615 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1616 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1617 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1618 |
update_loop_elements(); |
update_loop_elements(); |
1619 |
update_model--; |
update_model--; |
1620 |
|
|
1621 |
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); |
|
1622 |
return true; |
return true; |
1623 |
} |
} |
1624 |
return false; |
return false; |
1687 |
if (value) { |
if (value) { |
1688 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1689 |
if (!d->SampleLoops) { |
if (!d->SampleLoops) { |
1690 |
|
DimRegionChangeGuard(this, d); |
1691 |
|
|
1692 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1693 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1694 |
// loop the whole sample by default |
// loop the whole sample by default |
1695 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1696 |
loop.LoopLength = |
loop.LoopLength = |
1697 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
|
dimreg_to_be_changed_signal.emit(d); |
|
1698 |
d->AddSampleLoop(&loop); |
d->AddSampleLoop(&loop); |
|
dimreg_changed_signal.emit(d); |
|
1699 |
} |
} |
1700 |
} else { |
} else { |
1701 |
if (d->SampleLoops) { |
if (d->SampleLoops) { |
1702 |
dimreg_to_be_changed_signal.emit(d); |
DimRegionChangeGuard(this, d); |
1703 |
|
|
1704 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1705 |
while (d->SampleLoops) { |
while (d->SampleLoops) { |
1706 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
1707 |
} |
} |
|
dimreg_changed_signal.emit(d); |
|
1708 |
} |
} |
1709 |
} |
} |
1710 |
} |
} |
1748 |
{ |
{ |
1749 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d->pSample) d->pSample->LoopPlayCount = value; |
1750 |
} |
} |
1751 |
|
|
1752 |
|
void DimRegionEdit::nullOutSampleReference() { |
1753 |
|
if (!dimregion) return; |
1754 |
|
gig::Sample* oldref = dimregion->pSample; |
1755 |
|
if (!oldref) return; |
1756 |
|
|
1757 |
|
DimRegionChangeGuard(this, dimregion); |
1758 |
|
|
1759 |
|
// in case currently assigned sample is a stereo one, then remove both |
1760 |
|
// references (expected to be due to a "stereo dimension") |
1761 |
|
gig::DimensionRegion* d[2] = { dimregion, NULL }; |
1762 |
|
if (oldref->Channels == 2) { |
1763 |
|
gig::Region* region = dimregion->GetParent(); |
1764 |
|
{ |
1765 |
|
int stereo_bit = 0; |
1766 |
|
int bitcount = 0; |
1767 |
|
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
1768 |
|
if (region->pDimensionDefinitions[dim].dimension == gig::dimension_samplechannel) { |
1769 |
|
stereo_bit = 1 << bitcount; |
1770 |
|
break; |
1771 |
|
} |
1772 |
|
bitcount += region->pDimensionDefinitions[dim].bits; |
1773 |
|
} |
1774 |
|
|
1775 |
|
if (stereo_bit) { |
1776 |
|
int dimregno; |
1777 |
|
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1778 |
|
if (region->pDimensionRegions[dimregno] == dimregion) { |
1779 |
|
break; |
1780 |
|
} |
1781 |
|
} |
1782 |
|
d[0] = region->pDimensionRegions[dimregno & ~stereo_bit]; |
1783 |
|
d[1] = region->pDimensionRegions[dimregno | stereo_bit]; |
1784 |
|
} |
1785 |
|
} |
1786 |
|
} |
1787 |
|
|
1788 |
|
if (d[0]) d[0]->pSample = NULL; |
1789 |
|
if (d[1]) d[1]->pSample = NULL; |
1790 |
|
|
1791 |
|
// update UI elements |
1792 |
|
set_dim_region(dimregion); |
1793 |
|
|
1794 |
|
sample_ref_changed_signal.emit(oldref, NULL); |
1795 |
|
} |
1796 |
|
|
1797 |
|
void DimRegionEdit::onButtonSelectSamplePressed() { |
1798 |
|
if (!dimregion) return; |
1799 |
|
if (!dimregion->pSample) return; |
1800 |
|
select_sample_signal.emit(dimregion->pSample); |
1801 |
|
} |
1802 |
|
|
1803 |
|
sigc::signal<void, gig::Sample*>& DimRegionEdit::signal_select_sample() { |
1804 |
|
return select_sample_signal; |
1805 |
|
} |