/[svn]/gigedit/trunk/src/gigedit/dimregionedit.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/dimregionedit.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1798 by persson, Thu Dec 4 20:35:33 2008 UTC revision 2392 by persson, Mon Jan 7 20:41:16 2013 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006-2008 Andreas Persson   * Copyright (C) 2006-2013 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
# Line 20  Line 20 
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 (int x = 0 ; x < w ; x++) {
46                    int vel = int(x * 126.0 / w + 1.5);
47                    int y = int((1 - (dimreg->*getter)(vel)) * (h - 1));
48    
49                    if (x == 0) {
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 - 1, h - 1);
57                    cr->line_to(0, h - 1);
58                    cr->set_source_rgba(0.5, 0.44, 1.0, 0.2);
59                    cr->fill();
60                } else {
61                    cr->set_line_width(3);
62                    cr->set_source_rgb(0.5, 0.44, 1.0);
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 && dimreg->Crossfade.out_end) {
86            int w = get_width();
87            int h = get_height();
88            
89            for (int pass = 0 ; pass < 2 ; pass++) {
90                cr->move_to(dimreg->Crossfade.in_start / 127.0 * (w - 4) + 2, h);
91                cr->line_to(dimreg->Crossfade.in_end / 127.0 * (w - 4) + 2, 2);
92                cr->line_to(dimreg->Crossfade.out_start / 127.0 * (w - 4) + 2, 2);
93                cr->line_to(dimreg->Crossfade.out_end / 127.0 * (w - 4) + 2, h);
94    
95                if (pass == 0) {
96                    cr->line_to(dimreg->Crossfade.in_start / 127.0 * (w - 4) + 2,
97                                h);
98                    cr->set_source_rgba(0.5, 0.44, 1.0, 0.2);
99                    cr->fill();
100                } else {
101                    cr->set_line_width(3);
102                    cr->set_source_rgb(0.5, 0.44, 1.0);
103                    cr->stroke();
104                }
105            }
106        }
107        return true;
108    }
109    
110    
111  DimRegionEdit::DimRegionEdit() :  DimRegionEdit::DimRegionEdit() :
112      eEG1PreAttack("Pre-attack", 0, 100, 2),      velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation),
113      eEG1Attack("Attack", 0, 60, 3),      release_curve(&gig::DimensionRegion::GetVelocityRelease),
114      eEG1Decay1("Decay 1", 0.005, 60, 3),      cutoff_curve(&gig::DimensionRegion::GetVelocityCutoff),
115      eEG1Decay2("Decay 2", 0, 60, 3),      eEG1PreAttack(_("Pre-attack"), 0, 100, 2),
116      eEG1InfiniteSustain("Infinite sustain"),      eEG1Attack(_("Attack"), 0, 60, 3),
117      eEG1Sustain("Sustain", 0, 100, 2),      eEG1Decay1(_("Decay 1"), 0.005, 60, 3),
118      eEG1Release("Release", 0, 60, 3),      eEG1Decay2(_("Decay 2"), 0, 60, 3),
119      eEG1Hold("Hold"),      eEG1InfiniteSustain(_("Infinite sustain")),
120      eEG1Controller("Controller"),      eEG1Sustain(_("Sustain"), 0, 100, 2),
121      eEG1ControllerInvert("Controller invert"),      eEG1Release(_("Release"), 0, 60, 3),
122      eEG1ControllerAttackInfluence("Controller attack influence", 0, 3),      eEG1Hold(_("Hold")),
123      eEG1ControllerDecayInfluence("Controller decay influence", 0, 3),      eEG1Controller(_("Controller")),
124      eEG1ControllerReleaseInfluence("Controller release influence", 0, 3),      eEG1ControllerInvert(_("Controller invert")),
125      eLFO1Frequency("Frequency", 0.1, 10, 2),      eEG1ControllerAttackInfluence(_("Controller attack influence"), 0, 3),
126      eLFO1InternalDepth("Internal depth", 0, 1200),      eEG1ControllerDecayInfluence(_("Controller decay influence"), 0, 3),
127      eLFO1ControlDepth("Control depth", 0, 1200),      eEG1ControllerReleaseInfluence(_("Controller release influence"), 0, 3),
128      eLFO1Controller("Controller"),      eLFO1Frequency(_("Frequency"), 0.1, 10, 2),
129      eLFO1FlipPhase("Flip phase"),      eLFO1InternalDepth(_("Internal depth"), 0, 1200),
130      eLFO1Sync("Sync"),      eLFO1ControlDepth(_("Control depth"), 0, 1200),
131      eEG2PreAttack("Pre-attack", 0, 100, 2),      eLFO1Controller(_("Controller")),
132      eEG2Attack("Attack", 0, 60, 3),      eLFO1FlipPhase(_("Flip phase")),
133      eEG2Decay1("Decay 1", 0.005, 60, 3),      eLFO1Sync(_("Sync")),
134      eEG2Decay2("Decay 2", 0, 60, 3),      eEG2PreAttack(_("Pre-attack"), 0, 100, 2),
135      eEG2InfiniteSustain("Infinite sustain"),      eEG2Attack(_("Attack"), 0, 60, 3),
136      eEG2Sustain("Sustain", 0, 100, 2),      eEG2Decay1(_("Decay 1"), 0.005, 60, 3),
137      eEG2Release("Release", 0, 60, 3),      eEG2Decay2(_("Decay 2"), 0, 60, 3),
138      eEG2Controller("Controller"),      eEG2InfiniteSustain(_("Infinite sustain")),
139      eEG2ControllerInvert("Controller invert"),      eEG2Sustain(_("Sustain"), 0, 100, 2),
140      eEG2ControllerAttackInfluence("Controller attack influence", 0, 3),      eEG2Release(_("Release"), 0, 60, 3),
141      eEG2ControllerDecayInfluence("Controller decay influence", 0, 3),      eEG2Controller(_("Controller")),
142      eEG2ControllerReleaseInfluence("Controller release influence", 0, 3),      eEG2ControllerInvert(_("Controller invert")),
143      eLFO2Frequency("Frequency", 0.1, 10, 2),      eEG2ControllerAttackInfluence(_("Controller attack influence"), 0, 3),
144      eLFO2InternalDepth("Internal depth", 0, 1200),      eEG2ControllerDecayInfluence(_("Controller decay influence"), 0, 3),
145      eLFO2ControlDepth("Control depth", 0, 1200),      eEG2ControllerReleaseInfluence(_("Controller release influence"), 0, 3),
146      eLFO2Controller("Controller"),      eLFO2Frequency(_("Frequency"), 0.1, 10, 2),
147      eLFO2FlipPhase("Flip phase"),      eLFO2InternalDepth(_("Internal depth"), 0, 1200),
148      eLFO2Sync("Sync"),      eLFO2ControlDepth(_("Control depth"), 0, 1200),
149      eEG3Attack("Attack", 0, 10, 3),      eLFO2Controller(_("Controller")),
150      eEG3Depth("Depth", -1200, 1200),      eLFO2FlipPhase(_("Flip phase")),
151      eLFO3Frequency("Frequency", 0.1, 10, 2),      eLFO2Sync(_("Sync")),
152      eLFO3InternalDepth("Internal depth", 0, 1200),      eEG3Attack(_("Attack"), 0, 10, 3),
153      eLFO3ControlDepth("Control depth", 0, 1200),      eEG3Depth(_("Depth"), -1200, 1200),
154      eLFO3Controller("Controller"),      eLFO3Frequency(_("Frequency"), 0.1, 10, 2),
155      eLFO3Sync("Sync"),      eLFO3InternalDepth(_("Internal depth"), 0, 1200),
156      eVCFEnabled("Enabled"),      eLFO3ControlDepth(_("Control depth"), 0, 1200),
157      eVCFType("Type"),      eLFO3Controller(_("Controller")),
158      eVCFCutoffController("Cutoff controller"),      eLFO3Sync(_("Sync")),
159      eVCFCutoffControllerInvert("Cutoff controller invert"),      eVCFEnabled(_("Enabled")),
160      eVCFCutoff("Cutoff"),      eVCFType(_("Type")),
161      eVCFVelocityCurve("Velocity curve"),      eVCFCutoffController(_("Cutoff controller")),
162      eVCFVelocityScale("Velocity scale"),      eVCFCutoffControllerInvert(_("Cutoff controller invert")),
163      eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4),      eVCFCutoff(_("Cutoff")),
164      eVCFResonance("Resonance"),      eVCFVelocityCurve(_("Velocity curve")),
165      eVCFResonanceDynamic("Resonance dynamic"),      eVCFVelocityScale(_("Velocity scale")),
166      eVCFResonanceController("Resonance controller"),      eVCFVelocityDynamicRange(_("Velocity dynamic range"), 0, 4),
167      eVCFKeyboardTracking("Keyboard tracking"),      eVCFResonance(_("Resonance")),
168      eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"),      eVCFResonanceDynamic(_("Resonance dynamic")),
169      eVelocityResponseCurve("Velocity response curve"),      eVCFResonanceController(_("Resonance controller")),
170      eVelocityResponseDepth("Velocity response depth", 0, 4),      eVCFKeyboardTracking(_("Keyboard tracking")),
171      eVelocityResponseCurveScaling("Velocity response curve scaling"),      eVCFKeyboardTrackingBreakpoint(_("Keyboard tracking breakpoint")),
172      eReleaseVelocityResponseCurve("Release velocity response curve"),      eVelocityResponseCurve(_("Velocity response curve")),
173      eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4),      eVelocityResponseDepth(_("Velocity response depth"), 0, 4),
174      eReleaseTriggerDecay("Release trigger decay", 0, 8),      eVelocityResponseCurveScaling(_("Velocity response curve scaling")),
175      eCrossfade_in_start("Crossfade-in start"),      eReleaseVelocityResponseCurve(_("Release velocity response curve")),
176      eCrossfade_in_end("Crossfade-in end"),      eReleaseVelocityResponseDepth(_("Release velocity response depth"), 0, 4),
177      eCrossfade_out_start("Crossfade-out start"),      eReleaseTriggerDecay(_("Release trigger decay"), 0, 8),
178      eCrossfade_out_end("Crossfade-out end"),      eCrossfade_in_start(_("Crossfade-in start")),
179      ePitchTrack("Pitch track"),      eCrossfade_in_end(_("Crossfade-in end")),
180      eDimensionBypass("Dimension bypass"),      eCrossfade_out_start(_("Crossfade-out start")),
181      ePan("Pan", -64, 63),      eCrossfade_out_end(_("Crossfade-out end")),
182      eSelfMask("Self mask"),      ePitchTrack(_("Pitch track")),
183      eAttenuationController("Attenuation controller"),      eDimensionBypass(_("Dimension bypass")),
184      eInvertAttenuationController("Invert attenuation controller"),      ePan(_("Pan"), -64, 63),
185      eAttenuationControllerThreshold("Attenuation controller threshold"),      eSelfMask(_("Self mask")),
186      eChannelOffset("Channel offset", 0, 9),      eAttenuationController(_("Attenuation controller")),
187      eSustainDefeat("Sustain defeat"),      eInvertAttenuationController(_("Invert attenuation controller")),
188      eMSDecode("MS decode"),      eAttenuationControllerThreshold(_("Attenuation controller threshold")),
189      eSampleStartOffset("Sample start offset", 0, 2000),      eChannelOffset(_("Channel offset"), 0, 9),
190      eUnityNote("Unity note"),      eSustainDefeat(_("Sustain defeat")),
191      eFineTune("Fine tune", -49, 50),      eMSDecode(_("MS decode")),
192      eGain("Gain", -96, 0, 2, -655360),      eSampleStartOffset(_("Sample start offset"), 0, 2000),
193      eGainPlus6("Gain +6dB", eGain, 6 * -655360),      eUnityNote(_("Unity note")),
194      eSampleLoopEnabled("Enabled"),      eFineTune(_("Fine tune"), -49, 50),
195      eSampleLoopStart("Loop start positon"),      eGain(_("Gain"), -96, 0, 2, -655360),
196      eSampleLoopLength("Loop size"),      eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360),
197      eSampleLoopType("Loop type"),      eSampleLoopEnabled(_("Enabled")),
198      eSampleLoopInfinite("Infinite loop"),      eSampleLoopStart(_("Loop start positon")),
199      eSampleLoopPlayCount("Playback count", 1),      eSampleLoopLength(_("Loop size")),
200        eSampleLoopType(_("Loop type")),
201        eSampleLoopInfinite(_("Infinite loop")),
202        eSampleLoopPlayCount(_("Playback count"), 1),
203      update_model(0)      update_model(0)
204  {  {
205      connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack);      connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack);
# Line 265  DimRegionEdit::DimRegionEdit() : Line 355  DimRegionEdit::DimRegionEdit() :
355      firstRowInBlock = 0;      firstRowInBlock = 0;
356    
357      addHeader(_("Mandatory Settings"));      addHeader(_("Mandatory Settings"));
358      addString("Sample", lSample, wSample);      addString(_("Sample"), lSample, wSample);
359      //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);
360    #ifdef OLD_TOOLTIPS
361      tooltips.set_tip(*wSample, _("Drop a sample here"));      tooltips.set_tip(*wSample, _("Drop a sample here"));
362    #else
363        wSample->set_tooltip_text(_("Drop a sample here"));
364    #endif
365      addProp(eUnityNote);      addProp(eUnityNote);
366      addHeader(_("Optional Settings"));      addHeader(_("Optional Settings"));
367      addProp(eSampleStartOffset);      addProp(eSampleStartOffset);
368      addProp(eChannelOffset);      addProp(eChannelOffset);
369      addHeader("Loops");      addHeader(_("Loops"));
370      addProp(eSampleLoopEnabled);      addProp(eSampleLoopEnabled);
371      addProp(eSampleLoopStart);      addProp(eSampleLoopStart);
372      addProp(eSampleLoopLength);      addProp(eSampleLoopLength);
373      {      {
374          const char* choices[] = { "normal", "bidirectional", "backward", 0 };          const char* choices[] = { _("normal"), _("bidirectional"), _("backward"), 0 };
375          static const uint32_t values[] = {          static const uint32_t values[] = {
376              gig::loop_type_normal,              gig::loop_type_normal,
377              gig::loop_type_bidirectional,              gig::loop_type_bidirectional,
# Line 317  DimRegionEdit::DimRegionEdit() : Line 411  DimRegionEdit::DimRegionEdit() :
411      addProp(eLFO1InternalDepth);      addProp(eLFO1InternalDepth);
412      addProp(eLFO1ControlDepth);      addProp(eLFO1ControlDepth);
413      {      {
414          const char* choices[] = { "internal", "modwheel", "breath",          const char* choices[] = { _("internal"), _("modwheel"), _("breath"),
415                                    "internal+modwheel", "internal+breath", 0 };                                    _("internal+modwheel"), _("internal+breath"), 0 };
416          static const gig::lfo1_ctrl_t values[] = {          static const gig::lfo1_ctrl_t values[] = {
417              gig::lfo1_ctrl_internal,              gig::lfo1_ctrl_internal,
418              gig::lfo1_ctrl_modwheel,              gig::lfo1_ctrl_modwheel,
# Line 331  DimRegionEdit::DimRegionEdit() : Line 425  DimRegionEdit::DimRegionEdit() :
425      addProp(eLFO1Controller);      addProp(eLFO1Controller);
426      addProp(eLFO1FlipPhase);      addProp(eLFO1FlipPhase);
427      addProp(eLFO1Sync);      addProp(eLFO1Sync);
428      addHeader("Crossfade");      addHeader(_("Crossfade"));
429      addProp(eAttenuationController);      addProp(eAttenuationController);
430      addProp(eInvertAttenuationController);      addProp(eInvertAttenuationController);
431      addProp(eAttenuationControllerThreshold);      addProp(eAttenuationControllerThreshold);
# Line 340  DimRegionEdit::DimRegionEdit() : Line 434  DimRegionEdit::DimRegionEdit() :
434      addProp(eCrossfade_out_start);      addProp(eCrossfade_out_start);
435      addProp(eCrossfade_out_end);      addProp(eCrossfade_out_end);
436    
437        Gtk::Frame* frame = new Gtk::Frame;
438        frame->add(crossfade_curve);
439        table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
440                              Gtk::SHRINK, Gtk::SHRINK);
441        rowno++;
442    
443        eCrossfade_in_start.signal_value_changed().connect(
444            sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw));
445        eCrossfade_in_end.signal_value_changed().connect(
446            sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw));
447        eCrossfade_out_start.signal_value_changed().connect(
448            sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw));
449        eCrossfade_out_end.signal_value_changed().connect(
450            sigc::mem_fun(crossfade_curve, &CrossfadeCurve::queue_draw));
451    
452      nextPage();      nextPage();
453    
454      addHeader(_("General Filter Settings"));      addHeader(_("General Filter Settings"));
455      addProp(eVCFEnabled);      addProp(eVCFEnabled);
456      {      {
457          const char* choices[] = { "lowpass", "lowpassturbo", "bandpass",          const char* choices[] = { _("lowpass"), _("lowpassturbo"), _("bandpass"),
458                                    "highpass", "bandreject", 0 };                                    _("highpass"), _("bandreject"), 0 };
459          static const gig::vcf_type_t values[] = {          static const gig::vcf_type_t values[] = {
460              gig::vcf_type_lowpass,              gig::vcf_type_lowpass,
461              gig::vcf_type_lowpassturbo,              gig::vcf_type_lowpassturbo,
# Line 358  DimRegionEdit::DimRegionEdit() : Line 467  DimRegionEdit::DimRegionEdit() :
467      }      }
468      addProp(eVCFType);      addProp(eVCFType);
469      {      {
470          const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2",          const char* choices[] = { _("none"), _("none2"), _("modwheel"), _("effect1"), _("effect2"),
471                                    "breath", "foot", "sustainpedal", "softpedal",                                    _("breath"), _("foot"), _("sustainpedal"), _("softpedal"),
472                                    "genpurpose7", "genpurpose8", "aftertouch", 0 };                                    _("genpurpose7"), _("genpurpose8"), _("aftertouch"), 0 };
473          static const gig::vcf_cutoff_ctrl_t values[] = {          static const gig::vcf_cutoff_ctrl_t values[] = {
474              gig::vcf_cutoff_ctrl_none,              gig::vcf_cutoff_ctrl_none,
475              gig::vcf_cutoff_ctrl_none2,              gig::vcf_cutoff_ctrl_none2,
# Line 380  DimRegionEdit::DimRegionEdit() : Line 489  DimRegionEdit::DimRegionEdit() :
489      addProp(eVCFCutoffController);      addProp(eVCFCutoffController);
490      addProp(eVCFCutoffControllerInvert);      addProp(eVCFCutoffControllerInvert);
491      addProp(eVCFCutoff);      addProp(eVCFCutoff);
492      const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 };      const char* curve_type_texts[] = { _("nonlinear"), _("linear"), _("special"), 0 };
493      static const gig::curve_type_t curve_type_values[] = {      static const gig::curve_type_t curve_type_values[] = {
494          gig::curve_type_nonlinear,          gig::curve_type_nonlinear,
495          gig::curve_type_linear,          gig::curve_type_linear,
# Line 390  DimRegionEdit::DimRegionEdit() : Line 499  DimRegionEdit::DimRegionEdit() :
499      addProp(eVCFVelocityCurve);      addProp(eVCFVelocityCurve);
500      addProp(eVCFVelocityScale);      addProp(eVCFVelocityScale);
501      addProp(eVCFVelocityDynamicRange);      addProp(eVCFVelocityDynamicRange);
502    
503        eVCFCutoffController.signal_value_changed().connect(
504            sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw));
505        eVCFVelocityCurve.signal_value_changed().connect(
506            sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw));
507        eVCFVelocityScale.signal_value_changed().connect(
508            sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw));
509        eVCFVelocityDynamicRange.signal_value_changed().connect(
510            sigc::mem_fun(cutoff_curve, &VelocityCurve::queue_draw));
511    
512        frame = new Gtk::Frame;
513        frame->add(cutoff_curve);
514        table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
515                              Gtk::SHRINK, Gtk::SHRINK);
516        rowno++;
517    
518      addProp(eVCFResonance);      addProp(eVCFResonance);
519      addProp(eVCFResonanceDynamic);      addProp(eVCFResonanceDynamic);
520      {      {
521          const char* choices[] = { "none", "genpurpose3", "genpurpose4",          const char* choices[] = { _("none"), _("genpurpose3"), _("genpurpose4"),
522                                    "genpurpose5", "genpurpose6", 0 };                                    _("genpurpose5"), _("genpurpose6"), 0 };
523          static const gig::vcf_res_ctrl_t values[] = {          static const gig::vcf_res_ctrl_t values[] = {
524              gig::vcf_res_ctrl_none,              gig::vcf_res_ctrl_none,
525              gig::vcf_res_ctrl_genpurpose3,              gig::vcf_res_ctrl_genpurpose3,
# Line 428  DimRegionEdit::DimRegionEdit() : Line 553  DimRegionEdit::DimRegionEdit() :
553      addProp(eLFO2InternalDepth);      addProp(eLFO2InternalDepth);
554      addProp(eLFO2ControlDepth);      addProp(eLFO2ControlDepth);
555      {      {
556          const char* choices[] = { "internal", "modwheel", "foot",          const char* choices[] = { _("internal"), _("modwheel"), _("foot"),
557                                    "internal+modwheel", "internal+foot", 0 };                                    _("internal+modwheel"), _("internal+foot"), 0 };
558          static const gig::lfo2_ctrl_t values[] = {          static const gig::lfo2_ctrl_t values[] = {
559              gig::lfo2_ctrl_internal,              gig::lfo2_ctrl_internal,
560              gig::lfo2_ctrl_modwheel,              gig::lfo2_ctrl_modwheel,
# Line 456  DimRegionEdit::DimRegionEdit() : Line 581  DimRegionEdit::DimRegionEdit() :
581      addProp(eLFO3InternalDepth);      addProp(eLFO3InternalDepth);
582      addProp(eLFO3ControlDepth);      addProp(eLFO3ControlDepth);
583      {      {
584          const char* choices[] = { "internal", "modwheel", "aftertouch",          const char* choices[] = { _("internal"), _("modwheel"), _("aftertouch"),
585                                    "internal+modwheel", "internal+aftertouch", 0 };                                    _("internal+modwheel"), _("internal+aftertouch"), 0 };
586          static const gig::lfo3_ctrl_t values[] = {          static const gig::lfo3_ctrl_t values[] = {
587              gig::lfo3_ctrl_internal,              gig::lfo3_ctrl_internal,
588              gig::lfo3_ctrl_modwheel,              gig::lfo3_ctrl_modwheel,
# Line 472  DimRegionEdit::DimRegionEdit() : Line 597  DimRegionEdit::DimRegionEdit() :
597    
598      nextPage();      nextPage();
599    
600        addHeader(_("Velocity Reponse"));
601      eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values);      eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values);
602      addProp(eVelocityResponseCurve);      addProp(eVelocityResponseCurve);
603      addProp(eVelocityResponseDepth);      addProp(eVelocityResponseDepth);
604      addProp(eVelocityResponseCurveScaling);      addProp(eVelocityResponseCurveScaling);
605    
606        eVelocityResponseCurve.signal_value_changed().connect(
607            sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw));
608        eVelocityResponseDepth.signal_value_changed().connect(
609            sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw));
610        eVelocityResponseCurveScaling.signal_value_changed().connect(
611            sigc::mem_fun(velocity_curve, &VelocityCurve::queue_draw));
612    
613        frame = new Gtk::Frame;
614        frame->add(velocity_curve);
615        table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
616                              Gtk::SHRINK, Gtk::SHRINK);
617        rowno++;
618    
619        addHeader(_("Release Velocity Reponse"));
620      eReleaseVelocityResponseCurve.set_choices(curve_type_texts,      eReleaseVelocityResponseCurve.set_choices(curve_type_texts,
621                                                curve_type_values);                                                curve_type_values);
622      addProp(eReleaseVelocityResponseCurve);      addProp(eReleaseVelocityResponseCurve);
623      addProp(eReleaseVelocityResponseDepth);      addProp(eReleaseVelocityResponseDepth);
624    
625        eReleaseVelocityResponseCurve.signal_value_changed().connect(
626            sigc::mem_fun(release_curve, &VelocityCurve::queue_draw));
627        eReleaseVelocityResponseDepth.signal_value_changed().connect(
628            sigc::mem_fun(release_curve, &VelocityCurve::queue_draw));
629        frame = new Gtk::Frame;
630        frame->add(release_curve);
631        table[pageno]->attach(*frame, 1, 3, rowno, rowno + 1,
632                              Gtk::SHRINK, Gtk::SHRINK);
633        rowno++;
634    
635      addProp(eReleaseTriggerDecay);      addProp(eReleaseTriggerDecay);
636      {      {
637          const char* choices[] = { "none", "effect4depth", "effect5depth", 0 };          const char* choices[] = { _("none"), _("effect4depth"), _("effect5depth"), 0 };
638          static const gig::dim_bypass_ctrl_t values[] = {          static const gig::dim_bypass_ctrl_t values[] = {
639              gig::dim_bypass_ctrl_none,              gig::dim_bypass_ctrl_none,
640              gig::dim_bypass_ctrl_94,              gig::dim_bypass_ctrl_94,
# Line 539  DimRegionEdit::DimRegionEdit() : Line 691  DimRegionEdit::DimRegionEdit() :
691      eSampleLoopInfinite.signal_value_changed().connect(      eSampleLoopInfinite.signal_value_changed().connect(
692          sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled));          sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled));
693    
694      append_page(*table[0], "Sample");      append_page(*table[0], _("Sample"));
695      append_page(*table[1], "Amplitude (1)");      append_page(*table[1], _("Amplitude (1)"));
696      append_page(*table[2], "Amplitude (2)");      append_page(*table[2], _("Amplitude (2)"));
697      append_page(*table[3], "Filter (1)");      append_page(*table[3], _("Filter (1)"));
698      append_page(*table[4], "Filter (2)");      append_page(*table[4], _("Filter (2)"));
699      append_page(*table[5], "Pitch");      append_page(*table[5], _("Pitch"));
700      append_page(*table[6], "Misc");      append_page(*table[6], _("Misc"));
701  }  }
702    
703  DimRegionEdit::~DimRegionEdit()  DimRegionEdit::~DimRegionEdit()
# Line 556  void DimRegionEdit::addString(const char Line 708  void DimRegionEdit::addString(const char
708                                Gtk::Entry*& widget)                                Gtk::Entry*& widget)
709  {  {
710      label = new Gtk::Label(Glib::ustring(labelText) + ":");      label = new Gtk::Label(Glib::ustring(labelText) + ":");
711      label->set_alignment(Gtk::ALIGN_LEFT);      label->set_alignment(Gtk::ALIGN_START);
712    
713      table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,      table[pageno]->attach(*label, 1, 2, rowno, rowno + 1,
714                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
# Line 582  Gtk::Label* DimRegionEdit::addHeader(con Line 734  Gtk::Label* DimRegionEdit::addHeader(con
734      str += "</b>";      str += "</b>";
735      Gtk::Label* label = new Gtk::Label(str);      Gtk::Label* label = new Gtk::Label(str);
736      label->set_use_markup();      label->set_use_markup();
737      label->set_alignment(Gtk::ALIGN_LEFT);      label->set_alignment(Gtk::ALIGN_START);
738      table[pageno]->attach(*label, 0, 3, rowno, rowno + 1,      table[pageno]->attach(*label, 0, 3, rowno, rowno + 1,
739                            Gtk::FILL, Gtk::SHRINK);                            Gtk::FILL, Gtk::SHRINK);
740      rowno++;      rowno++;
# Line 630  void DimRegionEdit::addProp(LabelWidget& Line 782  void DimRegionEdit::addProp(LabelWidget&
782  void DimRegionEdit::set_dim_region(gig::DimensionRegion* d)  void DimRegionEdit::set_dim_region(gig::DimensionRegion* d)
783  {  {
784      dimregion = d;      dimregion = d;
785        velocity_curve.set_dim_region(d);
786        release_curve.set_dim_region(d);
787        cutoff_curve.set_dim_region(d);
788        crossfade_curve.set_dim_region(d);
789    
790      set_sensitive(d);      set_sensitive(d);
791      if (!d) return;      if (!d) return;
# Line 730  void DimRegionEdit::set_dim_region(gig:: Line 886  void DimRegionEdit::set_dim_region(gig::
886          d->pSample ? d->pSample->LoopPlayCount : 0);          d->pSample ? d->pSample->LoopPlayCount : 0);
887      update_model--;      update_model--;
888    
889      wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : "NULL");      wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL"));
890    
891      update_loop_elements();      update_loop_elements();
892      VCFEnabled_toggled();      VCFEnabled_toggled();
# Line 793  void DimRegionEdit::VCFCutoffController_ Line 949  void DimRegionEdit::VCFCutoffController_
949      eVCFCutoffControllerInvert.set_sensitive(hasController);      eVCFCutoffControllerInvert.set_sensitive(hasController);
950      eVCFCutoff.set_sensitive(!hasController);      eVCFCutoff.set_sensitive(!hasController);
951      eVCFResonanceDynamic.set_sensitive(!hasController);      eVCFResonanceDynamic.set_sensitive(!hasController);
952      eVCFVelocityScale.label.set_text(hasController ? "Minimum cutoff:" :      eVCFVelocityScale.label.set_text(hasController ? _("Minimum cutoff:") :
953                                       "Velocity scale:");                                       _("Velocity scale:"));
954  }  }
955    
956  void DimRegionEdit::VCFResonanceController_changed()  void DimRegionEdit::VCFResonanceController_changed()

Legend:
Removed from v.1798  
changed lines
  Added in v.2392

  ViewVC Help
Powered by ViewVC