1 |
/* |
/* |
2 |
* Copyright (C) 2006-2017 Andreas Persson |
* Copyright (C) 2006-2019 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 |
28 |
# include <gtkmm/table.h> |
# include <gtkmm/table.h> |
29 |
#endif |
#endif |
30 |
|
|
31 |
|
#include "Settings.h" |
32 |
|
|
33 |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) : |
34 |
getter(getter), dimreg(0) { |
getter(getter), dimreg(0) { |
35 |
set_size_request(80, 80); |
set_size_request(80, 80); |
39 |
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
bool VelocityCurve::on_expose_event(GdkEventExpose* e) { |
40 |
const Cairo::RefPtr<Cairo::Context>& cr = |
const Cairo::RefPtr<Cairo::Context>& cr = |
41 |
get_window()->create_cairo_context(); |
get_window()->create_cairo_context(); |
|
#if 0 |
|
|
} |
|
|
#endif |
|
42 |
#else |
#else |
43 |
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
bool VelocityCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
44 |
#endif |
#endif |
81 |
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
bool CrossfadeCurve::on_expose_event(GdkEventExpose* e) { |
82 |
const Cairo::RefPtr<Cairo::Context>& cr = |
const Cairo::RefPtr<Cairo::Context>& cr = |
83 |
get_window()->create_cairo_context(); |
get_window()->create_cairo_context(); |
|
#if 0 |
|
|
} |
|
|
#endif |
|
84 |
#else |
#else |
85 |
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
bool CrossfadeCurve::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
86 |
#endif |
#endif |
149 |
} |
} |
150 |
|
|
151 |
|
|
152 |
|
LFOGraph::LFOGraph() : dimreg(0) { |
153 |
|
set_size_request(500, 100); |
154 |
|
} |
155 |
|
|
156 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
157 |
|
bool LFOGraph::on_expose_event(GdkEventExpose* e) { |
158 |
|
const Cairo::RefPtr<Cairo::Context>& cr = |
159 |
|
get_window()->create_cairo_context(); |
160 |
|
#else |
161 |
|
bool LFOGraph::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { |
162 |
|
#endif |
163 |
|
if (dimreg) { |
164 |
|
const int w = get_width(); |
165 |
|
const int h = get_height(); |
166 |
|
const bool sensitive = is_sensitive(); |
167 |
|
const bool signedRange = this->signedRange(); |
168 |
|
const float visiblePeriods = 5.f; // such that minimum LFO frequency 0.1 Hz draws exactly a half period |
169 |
|
|
170 |
|
// short-hand functions for setting colors |
171 |
|
auto setGrayColor = [&] { |
172 |
|
cr->set_source_rgba(0.88, 0.88, 0.88, sensitive ? 1.0 : 0.3); |
173 |
|
}; |
174 |
|
auto setBlackColor = [&] { |
175 |
|
cr->set_source_rgba(0, 0, 0, sensitive ? 1.0 : 0.3); |
176 |
|
}; |
177 |
|
auto setGreenColor = [&] { |
178 |
|
cr->set_source_rgba(94/255.f, 219/255.f, 80/255.f, sensitive ? 1.0 : 0.3); |
179 |
|
}; |
180 |
|
auto setRedColor = [&] { |
181 |
|
cr->set_source_rgba(255.f, 44/255.f, 44/255.f, sensitive ? 1.0 : 0.3); |
182 |
|
}; |
183 |
|
/*auto setBlueColor = [&] { |
184 |
|
cr->set_source_rgba(53/255.f, 167/255.f, 255.f, sensitive ? 1.0 : 0.3); |
185 |
|
};*/ |
186 |
|
auto setOrangeColor = [&] { |
187 |
|
cr->set_source_rgba(255.f, 177/255.f, 82/255.f, sensitive ? 1.0 : 0.3); |
188 |
|
}; |
189 |
|
|
190 |
|
// draw horizontal center line (dashed gray) if LFO range is signed |
191 |
|
if (signedRange) { |
192 |
|
cr->move_to(0, h/2); |
193 |
|
cr->line_to(w, h/2); |
194 |
|
cr->set_line_width(2); |
195 |
|
setGrayColor(); |
196 |
|
cr->set_dash(std::vector<double>{ 7, 5 }, 0 /*offset*/); |
197 |
|
cr->stroke(); |
198 |
|
} |
199 |
|
|
200 |
|
// draw a vertical line for each second |
201 |
|
for (int period = 1; period < visiblePeriods; ++period) { |
202 |
|
int x = float(w) / float(visiblePeriods) * period; |
203 |
|
cr->move_to(x, 0); |
204 |
|
cr->line_to(x, h); |
205 |
|
cr->set_line_width(2); |
206 |
|
setGrayColor(); |
207 |
|
cr->set_dash(std::vector<double>{ 5, 3 }, 0 /*offset*/); |
208 |
|
cr->stroke(); |
209 |
|
} |
210 |
|
|
211 |
|
// how many curves shall we draw, two or one? |
212 |
|
const int runs = (hasControllerAssigned()) ? 2 : 1; |
213 |
|
// only draw the two curves in dashed style if they're very close to each other |
214 |
|
const bool dashedCurves = (runs == 2 && controllerDepth() < 63); |
215 |
|
// draw the required amount of curves |
216 |
|
for (int run = 0; run < runs; ++run) { |
217 |
|
// setup the LFO generator with the relevant parameters |
218 |
|
lfo.setup({ |
219 |
|
.waveType = LinuxSampler::LFO::wave_sine, // see https://sourceforge.net/p/linuxsampler/mailman/linuxsampler-devel/thread/2189307.cNP0Xbctxq%40silver/#msg36774029 |
220 |
|
.rangeType = (signedRange) ? LinuxSampler::LFO::range_signed : LinuxSampler::LFO::range_unsigned, |
221 |
|
.frequency = frequency(), |
222 |
|
//.phase = TODO |
223 |
|
.startLevel = startLevel(), |
224 |
|
.internalDepth = internalDepth(), |
225 |
|
.midiControllerDepth = controllerDepth(), |
226 |
|
.flipPolarity = flipPolarity(), |
227 |
|
.samplerate = w / visiblePeriods, |
228 |
|
.maxValue = (signedRange) ? h/2 : h, |
229 |
|
}); |
230 |
|
// 1st curve reflects min. CC value, 2nd curve max. CC value |
231 |
|
lfo.setMIDICtrlValue( (run == 0) ? 0 : 127 ); |
232 |
|
|
233 |
|
// the actual render/draw loop |
234 |
|
for (int x = 0; x < w ; ++x) { |
235 |
|
const float y = |
236 |
|
(signedRange) ? |
237 |
|
h/2 - lfo.render() : |
238 |
|
h - lfo.render(); |
239 |
|
if (x == 0) |
240 |
|
cr->move_to(x, y); |
241 |
|
else |
242 |
|
cr->line_to(x, y); |
243 |
|
} |
244 |
|
cr->set_line_width( (frequency() <= 4.f) ? 2 : 1 ); |
245 |
|
if (runs == 1) |
246 |
|
setOrangeColor(); |
247 |
|
else if (run == 0) |
248 |
|
setGreenColor(); |
249 |
|
else |
250 |
|
setRedColor(); |
251 |
|
if (dashedCurves) |
252 |
|
cr->set_dash(std::vector<double>{ 3, 3 }, (run == 0) ? 0 : 3 /*offset*/); |
253 |
|
else |
254 |
|
cr->set_dash(std::vector<double>(), 0 /*offset*/); |
255 |
|
cr->stroke(); |
256 |
|
} |
257 |
|
|
258 |
|
// draw text legend |
259 |
|
if (runs == 2) { |
260 |
|
setRedColor(); |
261 |
|
cr->move_to(2, 10); |
262 |
|
cr->show_text("CC Max."); |
263 |
|
|
264 |
|
setGreenColor(); |
265 |
|
cr->move_to(2, 23); |
266 |
|
cr->show_text("CC Min."); |
267 |
|
} else { // no controller assigned, internal depth only ... |
268 |
|
setOrangeColor(); |
269 |
|
cr->move_to(2, 10); |
270 |
|
cr->show_text("Const. Depth"); |
271 |
|
} |
272 |
|
// draw text legend for each second ("1s", "2s", ...) |
273 |
|
for (int period = 1; period < visiblePeriods; ++period) { |
274 |
|
int x = float(w) / float(visiblePeriods) * period; |
275 |
|
setBlackColor(); |
276 |
|
cr->move_to(x - 13, h - 3); |
277 |
|
cr->show_text(ToString(period) + "s"); |
278 |
|
} |
279 |
|
} |
280 |
|
return true; |
281 |
|
} |
282 |
|
|
283 |
|
|
284 |
EGStateOptions::EGStateOptions() : HBox(), |
EGStateOptions::EGStateOptions() : HBox(), |
285 |
label(_("May be cancelled: ")), |
label(_("May be cancelled: ")), |
286 |
checkBoxAttack(_("Attack")), |
checkBoxAttack(_("Attack")), |
315 |
)); |
)); |
316 |
} |
} |
317 |
|
|
318 |
|
void EGStateOptions::on_show_tooltips_changed() { |
319 |
|
const bool b = Settings::singleton()->showTooltips; |
320 |
|
|
321 |
|
checkBoxAttack.set_has_tooltip(b); |
322 |
|
checkBoxAttackHold.set_has_tooltip(b); |
323 |
|
checkBoxDecay1.set_has_tooltip(b); |
324 |
|
checkBoxDecay2.set_has_tooltip(b); |
325 |
|
checkBoxRelease.set_has_tooltip(b); |
326 |
|
} |
327 |
|
|
328 |
|
|
329 |
DimRegionEdit::DimRegionEdit() : |
DimRegionEdit::DimRegionEdit() : |
330 |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation), |
398 |
eCrossfade_out_start(_("Crossfade-out start")), |
eCrossfade_out_start(_("Crossfade-out start")), |
399 |
eCrossfade_out_end(_("Crossfade-out end")), |
eCrossfade_out_end(_("Crossfade-out end")), |
400 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
401 |
|
eSustainReleaseTrigger(_("Sustain Release Trigger")), |
402 |
|
eNoNoteOffReleaseTrigger(_("No note-off release trigger")), |
403 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
404 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
405 |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
eSelfMask(_("Kill lower velocity voices (a.k.a \"Self mask\")")), |
447 |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
&gig::DimensionRegion::EG1ControllerDecayInfluence); |
448 |
connect(eEG1ControllerReleaseInfluence, |
connect(eEG1ControllerReleaseInfluence, |
449 |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
&gig::DimensionRegion::EG1ControllerReleaseInfluence); |
450 |
{ |
connect(eEG1StateOptions.checkBoxAttack, &gig::DimensionRegion::EG1Options, |
451 |
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackCancel)); |
&gig::eg_opt_t::AttackCancel); |
452 |
connect(eEG1StateOptions.checkBoxAttack, mp.pmember); |
connect(eEG1StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG1Options, |
453 |
} |
&gig::eg_opt_t::AttackHoldCancel); |
454 |
{ |
connect(eEG1StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG1Options, |
455 |
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.AttackHoldCancel)); |
&gig::eg_opt_t::Decay1Cancel); |
456 |
connect(eEG1StateOptions.checkBoxAttackHold, mp.pmember); |
connect(eEG1StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG1Options, |
457 |
} |
&gig::eg_opt_t::Decay2Cancel); |
458 |
{ |
connect(eEG1StateOptions.checkBoxRelease, &gig::DimensionRegion::EG1Options, |
459 |
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay1Cancel)); |
&gig::eg_opt_t::ReleaseCancel); |
|
connect(eEG1StateOptions.checkBoxDecay1, mp.pmember); |
|
|
} |
|
|
{ |
|
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.Decay2Cancel)); |
|
|
connect(eEG1StateOptions.checkBoxDecay2, mp.pmember); |
|
|
} |
|
|
{ |
|
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG1Options.ReleaseCancel)); |
|
|
connect(eEG1StateOptions.checkBoxRelease, mp.pmember); |
|
|
} |
|
460 |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency); |
461 |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth); |
462 |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth); |
478 |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
&gig::DimensionRegion::EG2ControllerDecayInfluence); |
479 |
connect(eEG2ControllerReleaseInfluence, |
connect(eEG2ControllerReleaseInfluence, |
480 |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
&gig::DimensionRegion::EG2ControllerReleaseInfluence); |
481 |
{ |
connect(eEG2StateOptions.checkBoxAttack, &gig::DimensionRegion::EG2Options, |
482 |
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackCancel)); |
&gig::eg_opt_t::AttackCancel); |
483 |
connect(eEG2StateOptions.checkBoxAttack, mp.pmember); |
connect(eEG2StateOptions.checkBoxAttackHold, &gig::DimensionRegion::EG2Options, |
484 |
} |
&gig::eg_opt_t::AttackHoldCancel); |
485 |
{ |
connect(eEG2StateOptions.checkBoxDecay1, &gig::DimensionRegion::EG2Options, |
486 |
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.AttackHoldCancel)); |
&gig::eg_opt_t::Decay1Cancel); |
487 |
connect(eEG2StateOptions.checkBoxAttackHold, mp.pmember); |
connect(eEG2StateOptions.checkBoxDecay2, &gig::DimensionRegion::EG2Options, |
488 |
} |
&gig::eg_opt_t::Decay2Cancel); |
489 |
{ |
connect(eEG2StateOptions.checkBoxRelease, &gig::DimensionRegion::EG2Options, |
490 |
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay1Cancel)); |
&gig::eg_opt_t::ReleaseCancel); |
|
connect(eEG2StateOptions.checkBoxDecay1, mp.pmember); |
|
|
} |
|
|
{ |
|
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.Decay2Cancel)); |
|
|
connect(eEG2StateOptions.checkBoxDecay2, mp.pmember); |
|
|
} |
|
|
{ |
|
|
ClassMemberPtr<gig::DimensionRegion, bool> mp(offsetof(gig::DimensionRegion, EG2Options.ReleaseCancel)); |
|
|
connect(eEG2StateOptions.checkBoxRelease, mp.pmember); |
|
|
} |
|
491 |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency); |
492 |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth); |
493 |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth); |
535 |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start); |
536 |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end); |
537 |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
connect(ePitchTrack, &gig::DimensionRegion::PitchTrack); |
538 |
|
connect(eSustainReleaseTrigger, &gig::DimensionRegion::SustainReleaseTrigger); |
539 |
|
connect(eNoNoteOffReleaseTrigger, &gig::DimensionRegion::NoNoteOffReleaseTrigger); |
540 |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass); |
541 |
connect(ePan, &gig::DimensionRegion::Pan); |
connect(ePan, &gig::DimensionRegion::Pan); |
542 |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
connect(eSelfMask, &gig::DimensionRegion::SelfMask); |
564 |
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
sigc::mem_fun(*this, &DimRegionEdit::onButtonSelectSamplePressed) |
565 |
); |
); |
566 |
|
|
567 |
for (int i = 0 ; i < 7 ; i++) { |
for (int i = 0 ; i < 9 ; i++) { |
568 |
#if USE_GTKMM_GRID |
#if USE_GTKMM_GRID |
569 |
table[i] = new Gtk::Grid; |
table[i] = new Gtk::Grid; |
570 |
table[i]->set_column_spacing(7); |
table[i]->set_column_spacing(7); |
756 |
addProp(eLFO1Controller); |
addProp(eLFO1Controller); |
757 |
addProp(eLFO1FlipPhase); |
addProp(eLFO1FlipPhase); |
758 |
addProp(eLFO1Sync); |
addProp(eLFO1Sync); |
759 |
|
{ |
760 |
|
Gtk::Frame* frame = new Gtk::Frame; |
761 |
|
frame->add(lfo1Graph); |
762 |
|
// on Gtk 3 there is no margin at all by default |
763 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
764 |
|
frame->set_margin_top(12); |
765 |
|
frame->set_margin_bottom(12); |
766 |
|
#endif |
767 |
|
#if USE_GTKMM_GRID |
768 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
769 |
|
#else |
770 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
771 |
|
Gtk::SHRINK, Gtk::SHRINK); |
772 |
|
#endif |
773 |
|
rowno++; |
774 |
|
} |
775 |
|
eLFO1FlipPhase.signal_value_changed().connect( |
776 |
|
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw) |
777 |
|
); |
778 |
|
|
779 |
|
nextPage(); |
780 |
|
|
781 |
addHeader(_("Crossfade")); |
addHeader(_("Crossfade")); |
782 |
addProp(eAttenuationController); |
addProp(eAttenuationController); |
783 |
addProp(eInvertAttenuationController); |
addProp(eInvertAttenuationController); |
920 |
addProp(eEG2ControllerDecayInfluence); |
addProp(eEG2ControllerDecayInfluence); |
921 |
addProp(eEG2ControllerReleaseInfluence); |
addProp(eEG2ControllerReleaseInfluence); |
922 |
addLine(eEG2StateOptions); |
addLine(eEG2StateOptions); |
923 |
|
|
924 |
|
nextPage(); |
925 |
|
|
926 |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
lLFO2 = addHeader(_("Filter Cutoff Oscillator (LFO2)")); |
927 |
addProp(eLFO2Frequency); |
addProp(eLFO2Frequency); |
928 |
addProp(eLFO2InternalDepth); |
addProp(eLFO2InternalDepth); |
942 |
addProp(eLFO2Controller); |
addProp(eLFO2Controller); |
943 |
addProp(eLFO2FlipPhase); |
addProp(eLFO2FlipPhase); |
944 |
addProp(eLFO2Sync); |
addProp(eLFO2Sync); |
945 |
|
{ |
946 |
|
Gtk::Frame* frame = new Gtk::Frame; |
947 |
|
frame->add(lfo2Graph); |
948 |
|
// on Gtk 3 there is no margin at all by default |
949 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
950 |
|
frame->set_margin_top(12); |
951 |
|
frame->set_margin_bottom(12); |
952 |
|
#endif |
953 |
|
#if USE_GTKMM_GRID |
954 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
955 |
|
#else |
956 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
957 |
|
Gtk::SHRINK, Gtk::SHRINK); |
958 |
|
#endif |
959 |
|
rowno++; |
960 |
|
} |
961 |
|
eLFO2FlipPhase.signal_value_changed().connect( |
962 |
|
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw) |
963 |
|
); |
964 |
|
|
965 |
nextPage(); |
nextPage(); |
966 |
|
|
988 |
} |
} |
989 |
addProp(eLFO3Controller); |
addProp(eLFO3Controller); |
990 |
addProp(eLFO3Sync); |
addProp(eLFO3Sync); |
991 |
|
{ |
992 |
|
Gtk::Frame* frame = new Gtk::Frame; |
993 |
|
frame->add(lfo3Graph); |
994 |
|
// on Gtk 3 there is no margin at all by default |
995 |
|
#if GTKMM_MAJOR_VERSION >= 3 |
996 |
|
frame->set_margin_top(12); |
997 |
|
frame->set_margin_bottom(12); |
998 |
|
#endif |
999 |
|
#if USE_GTKMM_GRID |
1000 |
|
table[pageno]->attach(*frame, 1, rowno, 2); |
1001 |
|
#else |
1002 |
|
table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1, |
1003 |
|
Gtk::SHRINK, Gtk::SHRINK); |
1004 |
|
#endif |
1005 |
|
rowno++; |
1006 |
|
} |
1007 |
|
|
1008 |
nextPage(); |
nextPage(); |
1009 |
|
|
1062 |
|
|
1063 |
addProp(eReleaseTriggerDecay); |
addProp(eReleaseTriggerDecay); |
1064 |
{ |
{ |
1065 |
|
const char* choices[] = { _("off"), _("on (max. velocity)"), _("on (key velocity)"), 0 }; |
1066 |
|
static const gig::sust_rel_trg_t values[] = { |
1067 |
|
gig::sust_rel_trg_none, |
1068 |
|
gig::sust_rel_trg_maxvelocity, |
1069 |
|
gig::sust_rel_trg_keyvelocity |
1070 |
|
}; |
1071 |
|
eSustainReleaseTrigger.set_choices(choices, values); |
1072 |
|
} |
1073 |
|
eSustainReleaseTrigger.set_tip(_( |
1074 |
|
"By default release trigger samples are played on note-off events only. " |
1075 |
|
"This option allows to play release trigger sample on sustain pedal up " |
1076 |
|
"events as well. NOTE: This is a format extension!" |
1077 |
|
)); |
1078 |
|
addProp(eSustainReleaseTrigger); |
1079 |
|
{ |
1080 |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 }; |
1081 |
static const gig::dim_bypass_ctrl_t values[] = { |
static const gig::dim_bypass_ctrl_t values[] = { |
1082 |
gig::dim_bypass_ctrl_none, |
gig::dim_bypass_ctrl_none, |
1085 |
}; |
}; |
1086 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
1087 |
} |
} |
1088 |
|
eNoNoteOffReleaseTrigger.set_tip(_( |
1089 |
|
"By default release trigger samples are played on note-off events only. " |
1090 |
|
"If this option is checked, then no release trigger sample is played " |
1091 |
|
"when releasing a note. NOTE: This is a format extension!" |
1092 |
|
)); |
1093 |
|
addProp(eNoNoteOffReleaseTrigger); |
1094 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
1095 |
eSelfMask.widget.set_tooltip_text(_( |
eSelfMask.widget.set_tooltip_text(_( |
1096 |
"If enabled: new notes with higher velocity value will stop older " |
"If enabled: new notes with higher velocity value will stop older " |
1157 |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled)); |
1158 |
|
|
1159 |
append_page(*table[0], _("Sample")); |
append_page(*table[0], _("Sample")); |
1160 |
append_page(*table[1], _("Amplitude (1)")); |
append_page(*table[1], _("Amp (1)")); |
1161 |
append_page(*table[2], _("Amplitude (2)")); |
append_page(*table[2], _("Amp (2)")); |
1162 |
append_page(*table[3], _("Filter (1)")); |
append_page(*table[3], _("Amp (3)")); |
1163 |
append_page(*table[4], _("Filter (2)")); |
append_page(*table[4], _("Filter (1)")); |
1164 |
append_page(*table[5], _("Pitch")); |
append_page(*table[5], _("Filter (2)")); |
1165 |
append_page(*table[6], _("Misc")); |
append_page(*table[6], _("Filter (3)")); |
1166 |
|
append_page(*table[7], _("Pitch")); |
1167 |
|
append_page(*table[8], _("Misc")); |
1168 |
|
|
1169 |
|
Settings::singleton()->showTooltips.get_proxy().signal_changed().connect( |
1170 |
|
sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed) |
1171 |
|
); |
1172 |
|
|
1173 |
|
on_show_tooltips_changed(); |
1174 |
} |
} |
1175 |
|
|
1176 |
DimRegionEdit::~DimRegionEdit() |
DimRegionEdit::~DimRegionEdit() |
1278 |
return label; |
return label; |
1279 |
} |
} |
1280 |
|
|
1281 |
|
void DimRegionEdit::on_show_tooltips_changed() { |
1282 |
|
const bool b = Settings::singleton()->showTooltips; |
1283 |
|
|
1284 |
|
buttonSelectSample.set_has_tooltip(b); |
1285 |
|
buttonNullSampleReference->set_has_tooltip(b); |
1286 |
|
wSample->set_has_tooltip(b); |
1287 |
|
|
1288 |
|
eEG1StateOptions.on_show_tooltips_changed(); |
1289 |
|
eEG2StateOptions.on_show_tooltips_changed(); |
1290 |
|
|
1291 |
|
set_has_tooltip(b); |
1292 |
|
} |
1293 |
|
|
1294 |
void DimRegionEdit::nextPage() |
void DimRegionEdit::nextPage() |
1295 |
{ |
{ |
1296 |
if (firstRowInBlock < rowno - 1) |
if (firstRowInBlock < rowno - 1) |
1373 |
release_curve.set_dim_region(d); |
release_curve.set_dim_region(d); |
1374 |
cutoff_curve.set_dim_region(d); |
cutoff_curve.set_dim_region(d); |
1375 |
crossfade_curve.set_dim_region(d); |
crossfade_curve.set_dim_region(d); |
1376 |
|
lfo1Graph.set_dim_region(d); |
1377 |
|
lfo2Graph.set_dim_region(d); |
1378 |
|
lfo3Graph.set_dim_region(d); |
1379 |
|
|
1380 |
set_sensitive(d); |
set_sensitive(d); |
1381 |
if (!d) return; |
if (!d) return; |
1459 |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
eCrossfade_out_start.set_value(d->Crossfade.out_start); |
1460 |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
eCrossfade_out_end.set_value(d->Crossfade.out_end); |
1461 |
ePitchTrack.set_value(d->PitchTrack); |
ePitchTrack.set_value(d->PitchTrack); |
1462 |
|
eSustainReleaseTrigger.set_value(d->SustainReleaseTrigger); |
1463 |
|
eNoNoteOffReleaseTrigger.set_value(d->NoNoteOffReleaseTrigger); |
1464 |
eDimensionBypass.set_value(d->DimensionBypass); |
eDimensionBypass.set_value(d->DimensionBypass); |
1465 |
ePan.set_value(d->Pan); |
ePan.set_value(d->Pan); |
1466 |
eSelfMask.set_value(d->SelfMask); |
eSelfMask.set_value(d->SelfMask); |
1577 |
eLFO2Controller.set_sensitive(sensitive); |
eLFO2Controller.set_sensitive(sensitive); |
1578 |
eLFO2FlipPhase.set_sensitive(sensitive); |
eLFO2FlipPhase.set_sensitive(sensitive); |
1579 |
eLFO2Sync.set_sensitive(sensitive); |
eLFO2Sync.set_sensitive(sensitive); |
1580 |
|
lfo2Graph.set_sensitive(sensitive); |
1581 |
if (sensitive) { |
if (sensitive) { |
1582 |
VCFCutoffController_changed(); |
VCFCutoffController_changed(); |
1583 |
VCFResonanceController_changed(); |
VCFResonanceController_changed(); |
1867 |
} |
} |
1868 |
|
|
1869 |
|
|
1870 |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion* d, uint8_t value) |
void DimRegionEdit::set_UnityNote(gig::DimensionRegion& d, uint8_t value) |
1871 |
{ |
{ |
1872 |
d->UnityNote = value; |
d.UnityNote = value; |
1873 |
} |
} |
1874 |
|
|
1875 |
void DimRegionEdit::set_FineTune(gig::DimensionRegion* d, int16_t value) |
void DimRegionEdit::set_FineTune(gig::DimensionRegion& d, int16_t value) |
1876 |
{ |
{ |
1877 |
d->FineTune = value; |
d.FineTune = value; |
1878 |
} |
} |
1879 |
|
|
1880 |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_in_start(gig::DimensionRegion& d, |
1881 |
uint8_t value) |
uint8_t value) |
1882 |
{ |
{ |
1883 |
d->Crossfade.in_start = value; |
d.Crossfade.in_start = value; |
1884 |
if (d->Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
if (d.Crossfade.in_end < value) set_Crossfade_in_end(d, value); |
1885 |
} |
} |
1886 |
|
|
1887 |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_in_end(gig::DimensionRegion& d, |
1888 |
uint8_t value) |
uint8_t value) |
1889 |
{ |
{ |
1890 |
d->Crossfade.in_end = value; |
d.Crossfade.in_end = value; |
1891 |
if (value < d->Crossfade.in_start) set_Crossfade_in_start(d, value); |
if (value < d.Crossfade.in_start) set_Crossfade_in_start(d, value); |
1892 |
if (value > d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
if (value > d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
1893 |
} |
} |
1894 |
|
|
1895 |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_out_start(gig::DimensionRegion& d, |
1896 |
uint8_t value) |
uint8_t value) |
1897 |
{ |
{ |
1898 |
d->Crossfade.out_start = value; |
d.Crossfade.out_start = value; |
1899 |
if (value < d->Crossfade.in_end) set_Crossfade_in_end(d, value); |
if (value < d.Crossfade.in_end) set_Crossfade_in_end(d, value); |
1900 |
if (value > d->Crossfade.out_end) set_Crossfade_out_end(d, value); |
if (value > d.Crossfade.out_end) set_Crossfade_out_end(d, value); |
1901 |
} |
} |
1902 |
|
|
1903 |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion* d, |
void DimRegionEdit::set_Crossfade_out_end(gig::DimensionRegion& d, |
1904 |
uint8_t value) |
uint8_t value) |
1905 |
{ |
{ |
1906 |
d->Crossfade.out_end = value; |
d.Crossfade.out_end = value; |
1907 |
if (value < d->Crossfade.out_start) set_Crossfade_out_start(d, value); |
if (value < d.Crossfade.out_start) set_Crossfade_out_start(d, value); |
1908 |
} |
} |
1909 |
|
|
1910 |
void DimRegionEdit::set_Gain(gig::DimensionRegion* d, int32_t value) |
void DimRegionEdit::set_Gain(gig::DimensionRegion& d, int32_t value) |
1911 |
{ |
{ |
1912 |
d->SetGain(value); |
d.SetGain(value); |
1913 |
} |
} |
1914 |
|
|
1915 |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion* d, bool value) |
void DimRegionEdit::set_LoopEnabled(gig::DimensionRegion& d, bool value) |
1916 |
{ |
{ |
1917 |
if (value) { |
if (value) { |
1918 |
// create a new sample loop in case there is none yet |
// create a new sample loop in case there is none yet |
1919 |
if (!d->SampleLoops) { |
if (!d.SampleLoops) { |
1920 |
DimRegionChangeGuard(this, d); |
DimRegionChangeGuard(this, &d); |
1921 |
|
|
1922 |
DLS::sample_loop_t loop; |
DLS::sample_loop_t loop; |
1923 |
loop.LoopType = gig::loop_type_normal; |
loop.LoopType = gig::loop_type_normal; |
1924 |
// loop the whole sample by default |
// loop the whole sample by default |
1925 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
1926 |
loop.LoopLength = |
loop.LoopLength = |
1927 |
(d->pSample) ? d->pSample->SamplesTotal : 0; |
(d.pSample) ? d.pSample->SamplesTotal : 0; |
1928 |
d->AddSampleLoop(&loop); |
d.AddSampleLoop(&loop); |
1929 |
} |
} |
1930 |
} else { |
} else { |
1931 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1932 |
DimRegionChangeGuard(this, d); |
DimRegionChangeGuard(this, &d); |
1933 |
|
|
1934 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
1935 |
while (d->SampleLoops) { |
while (d.SampleLoops) { |
1936 |
d->DeleteSampleLoop(&d->pSampleLoops[0]); |
d.DeleteSampleLoop(&d.pSampleLoops[0]); |
1937 |
} |
} |
1938 |
} |
} |
1939 |
} |
} |
1940 |
} |
} |
1941 |
|
|
1942 |
void DimRegionEdit::set_LoopType(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopType(gig::DimensionRegion& d, uint32_t value) |
1943 |
{ |
{ |
1944 |
if (d->SampleLoops) d->pSampleLoops[0].LoopType = value; |
if (d.SampleLoops) d.pSampleLoops[0].LoopType = value; |
1945 |
} |
} |
1946 |
|
|
1947 |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopStart(gig::DimensionRegion& d, uint32_t value) |
1948 |
{ |
{ |
1949 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1950 |
d->pSampleLoops[0].LoopStart = |
d.pSampleLoops[0].LoopStart = |
1951 |
d->pSample ? |
d.pSample ? |
1952 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
1953 |
d->pSampleLoops[0].LoopLength)) : |
d.pSampleLoops[0].LoopLength)) : |
1954 |
0; |
0; |
1955 |
} |
} |
1956 |
} |
} |
1957 |
|
|
1958 |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopLength(gig::DimensionRegion& d, uint32_t value) |
1959 |
{ |
{ |
1960 |
if (d->SampleLoops) { |
if (d.SampleLoops) { |
1961 |
d->pSampleLoops[0].LoopLength = |
d.pSampleLoops[0].LoopLength = |
1962 |
d->pSample ? |
d.pSample ? |
1963 |
std::min(value, uint32_t(d->pSample->SamplesTotal - |
std::min(value, uint32_t(d.pSample->SamplesTotal - |
1964 |
d->pSampleLoops[0].LoopStart)) : |
d.pSampleLoops[0].LoopStart)) : |
1965 |
0; |
0; |
1966 |
} |
} |
1967 |
} |
} |
1968 |
|
|
1969 |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion* d, bool value) |
void DimRegionEdit::set_LoopInfinite(gig::DimensionRegion& d, bool value) |
1970 |
{ |
{ |
1971 |
if (d->pSample) { |
if (d.pSample) { |
1972 |
if (value) d->pSample->LoopPlayCount = 0; |
if (value) d.pSample->LoopPlayCount = 0; |
1973 |
else if (d->pSample->LoopPlayCount == 0) d->pSample->LoopPlayCount = 1; |
else if (d.pSample->LoopPlayCount == 0) d.pSample->LoopPlayCount = 1; |
1974 |
} |
} |
1975 |
} |
} |
1976 |
|
|
1977 |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value) |
void DimRegionEdit::set_LoopPlayCount(gig::DimensionRegion& d, uint32_t value) |
1978 |
{ |
{ |
1979 |
if (d->pSample) d->pSample->LoopPlayCount = value; |
if (d.pSample) d.pSample->LoopPlayCount = value; |
1980 |
} |
} |
1981 |
|
|
1982 |
void DimRegionEdit::nullOutSampleReference() { |
void DimRegionEdit::nullOutSampleReference() { |