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

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

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

revision 2151 by persson, Sun Nov 21 12:38:41 2010 UTC revision 3737 by schoenebeck, Sat Feb 1 20:39:39 2020 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2010 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
# Line 20  Line 20 
20  #ifndef GIGEDIT_DIMREGIONEDIT_H  #ifndef GIGEDIT_DIMREGIONEDIT_H
21  #define GIGEDIT_DIMREGIONEDIT_H  #define GIGEDIT_DIMREGIONEDIT_H
22    
23  #include <gig.h>  #ifdef LIBGIG_HEADER_FILE
24    # include LIBGIG_HEADER_FILE(gig.h)
25    #else
26    # include <gig.h>
27    #endif
28    
29    #include "compat.h"
30    
31    #include <cairomm/context.h>
32    #include <gtkmm/box.h>
33    #include <gtkmm/drawingarea.h>
34  #include <gtkmm/entry.h>  #include <gtkmm/entry.h>
35  #include <gtkmm/label.h>  #include <gtkmm/label.h>
36  #include <gtkmm/notebook.h>  #include <gtkmm/notebook.h>
37  #include <gtkmm/table.h>  #if USE_GTKMM_GRID
38    # include <gtkmm/grid.h>
39    #else
40    # include <gtkmm/table.h>
41    #endif
42    
43    #ifdef LIBLINUXSAMPLER_HEADER_FILE
44    # include LIBLINUXSAMPLER_HEADER_FILE(engines/LFO.h)
45    #else
46    # include <linuxsampler/engines/LFO.h>
47    #endif
48    
49  #include <set>  #include <set>
50    
51  #include "paramedit.h"  #include "paramedit.h"
52    #include "global.h"
53    #include "ScriptPatchVars.h"
54    #include "wrapLabel.hh"
55    
56    class VelocityCurve : public Gtk::DrawingArea {
57    public:
58        VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t));
59        void set_dim_region(gig::DimensionRegion* d) { dimreg = d; }
60    
61    protected:
62    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
63        bool on_expose_event(GdkEventExpose* e);
64    #else
65        bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
66    #endif
67    
68    private:
69        double (gig::DimensionRegion::* const getter)(uint8_t);
70        gig::DimensionRegion* dimreg;
71    };
72    
73    class CrossfadeCurve : public Gtk::DrawingArea {
74    public:
75        CrossfadeCurve();
76        void set_dim_region(gig::DimensionRegion* d) { dimreg = d; }
77    
78    protected:
79    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
80        bool on_expose_event(GdkEventExpose* e);
81    #else
82        bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
83    #endif
84    
85    private:
86        gig::DimensionRegion* dimreg;
87        void draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr,
88                            const gig::DimensionRegion* d,
89                            bool sensitive);
90    };
91    
92    class LFOGraph : public Gtk::DrawingArea {
93    public:
94        LFOGraph();
95        void set_dim_region(gig::DimensionRegion* d) { dimreg = d; }
96    
97    protected:
98    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
99        bool on_expose_event(GdkEventExpose* e);
100    #else
101        bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
102    #endif
103    
104        virtual LinuxSampler::LFO::wave_t waveType() const = 0;
105        virtual float frequency() const = 0;
106        virtual float phase() const = 0;
107        virtual uint internalDepth() const = 0;
108        virtual uint controllerDepth() const = 0;
109        virtual bool flipPolarity() const = 0;
110        virtual bool signedRange() const = 0;
111        virtual LinuxSampler::LFO::start_level_t startLevel() const = 0;
112        virtual bool hasControllerAssigned() const = 0;
113    
114        gig::DimensionRegion* dimreg;
115        LinuxSampler::LFO lfo;
116    };
117    
118    class LFO1Graph : public LFOGraph {
119    public:
120        LinuxSampler::LFO::wave_t waveType() const OVERRIDE {
121            // simply assuming here libgig's and LS's enums are equally value mapped
122            return (LinuxSampler::LFO::wave_t) dimreg->LFO1WaveForm;
123        }
124        float frequency() const OVERRIDE { return dimreg->LFO1Frequency; }
125        float phase() const OVERRIDE { return dimreg->LFO1Phase; }
126        uint internalDepth() const OVERRIDE {
127            const gig::lfo1_ctrl_t ctrl = dimreg->LFO1Controller;
128            const bool hasInternalDepth = (
129                ctrl != gig::lfo1_ctrl_modwheel && ctrl != gig::lfo1_ctrl_breath
130            );
131            return (hasInternalDepth) ? dimreg->LFO1InternalDepth : 0;
132        }
133        uint controllerDepth() const OVERRIDE { return dimreg->LFO1ControlDepth; }
134        bool flipPolarity() const OVERRIDE { return dimreg->LFO1FlipPhase; }
135        bool signedRange() const OVERRIDE { return false; }
136        virtual LinuxSampler::LFO::start_level_t startLevel() const OVERRIDE { return LinuxSampler::LFO::start_level_mid; } // see https://sourceforge.net/p/linuxsampler/mailman/linuxsampler-devel/thread/2189307.cNP0Xbctxq%40silver/#msg36774029
137        bool hasControllerAssigned() const OVERRIDE { return dimreg->LFO1Controller; }
138    };
139    
140    class LFO2Graph : public LFOGraph {
141    public:
142        LinuxSampler::LFO::wave_t waveType() const OVERRIDE {
143            // simply assuming here libgig's and LS's enums are equally value mapped
144            return (LinuxSampler::LFO::wave_t) dimreg->LFO2WaveForm;
145        }
146        float frequency() const OVERRIDE { return dimreg->LFO2Frequency; }
147        float phase() const OVERRIDE { return dimreg->LFO2Phase; }
148        uint internalDepth() const OVERRIDE {
149            const gig::lfo2_ctrl_t ctrl = dimreg->LFO2Controller;
150            const bool hasInternalDepth = (
151                ctrl != gig::lfo2_ctrl_modwheel && ctrl != gig::lfo2_ctrl_foot
152            );
153            return (hasInternalDepth) ? dimreg->LFO2InternalDepth : 0;
154        }
155        uint controllerDepth() const OVERRIDE { return dimreg->LFO2ControlDepth; }
156        bool flipPolarity() const OVERRIDE { return dimreg->LFO2FlipPhase; }
157        bool signedRange() const OVERRIDE { return false; }
158        virtual LinuxSampler::LFO::start_level_t startLevel() const OVERRIDE { return LinuxSampler::LFO::start_level_mid; } // see https://sourceforge.net/p/linuxsampler/mailman/linuxsampler-devel/thread/2189307.cNP0Xbctxq%40silver/#msg36774029
159        bool hasControllerAssigned() const OVERRIDE { return dimreg->LFO2Controller; }
160    };
161    
162    class LFO3Graph : public LFOGraph {
163    public:
164        LinuxSampler::LFO::wave_t waveType() const OVERRIDE {
165            // simply assuming here libgig's and LS's enums are equally value mapped
166            return (LinuxSampler::LFO::wave_t) dimreg->LFO3WaveForm;
167        }
168        float frequency() const OVERRIDE { return dimreg->LFO3Frequency; }
169        float phase() const OVERRIDE { return dimreg->LFO3Phase; }
170        uint internalDepth() const OVERRIDE {
171            const gig::lfo3_ctrl_t ctrl = dimreg->LFO3Controller;
172            const bool hasInternalDepth = (
173                ctrl != gig::lfo3_ctrl_modwheel && ctrl != gig::lfo3_ctrl_aftertouch
174            );
175            return (hasInternalDepth) ? dimreg->LFO3InternalDepth : 0;
176        }
177        uint controllerDepth() const OVERRIDE { return dimreg->LFO3ControlDepth; }
178        bool flipPolarity() const OVERRIDE { return dimreg->LFO3FlipPhase; }
179        bool signedRange() const OVERRIDE { return true; }
180        virtual LinuxSampler::LFO::start_level_t startLevel() const OVERRIDE { return LinuxSampler::LFO::start_level_max; } // see https://sourceforge.net/p/linuxsampler/mailman/linuxsampler-devel/thread/2189307.cNP0Xbctxq%40silver/#msg36774029
181        bool hasControllerAssigned() const OVERRIDE { return dimreg->LFO3Controller; }
182    };
183    
184    class EGStateOptions : public HBox {
185    public:
186        Gtk::Label label;
187        BoolBox checkBoxAttack;
188        BoolBox checkBoxAttackHold;
189        BoolBox checkBoxDecay1;
190        BoolBox checkBoxDecay2;
191        BoolBox checkBoxRelease;
192    
193        EGStateOptions();
194        void on_show_tooltips_changed();
195    };
196    
197  class DimRegionEdit : public Gtk::Notebook  class DimRegionEdit : public Gtk::Notebook
198  {  {
# Line 37  public: Line 200  public:
200      DimRegionEdit();      DimRegionEdit();
201      virtual ~DimRegionEdit();      virtual ~DimRegionEdit();
202      void set_dim_region(gig::DimensionRegion* d);      void set_dim_region(gig::DimensionRegion* d);
203      bool set_sample(gig::Sample* sample);      bool set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop);
204        bool set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop);
205      Gtk::Entry* wSample;      Gtk::Entry* wSample;
206        Gtk::Button* buttonNullSampleReference;
207      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
208      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
209      sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed();      sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed();
210        sigc::signal<void, gig::Sample*>& signal_select_sample();
211    
212      std::set<gig::DimensionRegion*> dimregs;      std::set<gig::DimensionRegion*> dimregs;
213    
214        ScriptPatchVars scriptVars;
215        Gtk::Button editScriptSlotsButton;
216    
217  protected:  protected:
218      sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;
219      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
220      sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal;      sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal;
221      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
222        sigc::signal<void, gig::Sample*> select_sample_signal;
223    
224        /**
225         * Ensures that the 2 signals DimRegionEdit::dimreg_to_be_changed_signal and
226         * DimRegionEdit::dimreg_changed_signal are always triggered correctly as a
227         * pair. It behaves similar to a "mutex lock guard" design pattern.
228         */
229        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
230        public:
231            DimRegionChangeGuard(DimRegionEdit* edit, gig::DimensionRegion* pDimReg) :
232                SignalGuard<gig::DimensionRegion*>(edit->dimreg_to_be_changed_signal, edit->dimreg_changed_signal, pDimReg)
233            {
234            }
235        };
236    
237      gig::DimensionRegion* dimregion;      gig::DimensionRegion* dimregion;
238    
# Line 57  protected: Line 240  protected:
240      Gtk::Tooltips tooltips;      Gtk::Tooltips tooltips;
241  #endif  #endif
242    
243      Gtk::Table* table[7];      static const int tableSize = 10;
244    #if USE_GTKMM_GRID
245        Gtk::Grid* table[tableSize];
246    #else
247        Gtk::Table* table[tableSize];
248    #endif
249    
250      Gtk::Label* lSample;      Gtk::Label* lSample;
251    
252        VelocityCurve velocity_curve;
253        VelocityCurve release_curve;
254        VelocityCurve cutoff_curve;
255        CrossfadeCurve crossfade_curve;
256        LFO1Graph lfo1Graph; ///< Graphic of Amplitude (Volume) LFO waveform.
257        LFO2Graph lfo2Graph; ///< Graphic of Filter Cutoff LFO waveform.
258        LFO3Graph lfo3Graph; ///< Graphic of Pitch LFO waveform.
259    
260      NumEntryPermille eEG1PreAttack;      NumEntryPermille eEG1PreAttack;
261      NumEntryTemp<double> eEG1Attack;      NumEntryTemp<double> eEG1Attack;
262      NumEntryTemp<double> eEG1Decay1;      NumEntryTemp<double> eEG1Decay1;
# Line 74  protected: Line 270  protected:
270      NumEntryTemp<uint8_t> eEG1ControllerAttackInfluence;      NumEntryTemp<uint8_t> eEG1ControllerAttackInfluence;
271      NumEntryTemp<uint8_t> eEG1ControllerDecayInfluence;      NumEntryTemp<uint8_t> eEG1ControllerDecayInfluence;
272      NumEntryTemp<uint8_t> eEG1ControllerReleaseInfluence;      NumEntryTemp<uint8_t> eEG1ControllerReleaseInfluence;
273        EGStateOptions eEG1StateOptions;
274        ChoiceEntryLfoWave eLFO1Wave;
275      NumEntryTemp<double> eLFO1Frequency;      NumEntryTemp<double> eLFO1Frequency;
276        NumEntryTemp<double> eLFO1Phase;
277      NumEntryTemp<uint16_t> eLFO1InternalDepth;      NumEntryTemp<uint16_t> eLFO1InternalDepth;
278      NumEntryTemp<uint16_t> eLFO1ControlDepth;      NumEntryTemp<uint16_t> eLFO1ControlDepth;
279      ChoiceEntry<gig::lfo1_ctrl_t> eLFO1Controller;      ChoiceEntry<gig::lfo1_ctrl_t> eLFO1Controller;
# Line 92  protected: Line 291  protected:
291      NumEntryTemp<uint8_t> eEG2ControllerAttackInfluence;      NumEntryTemp<uint8_t> eEG2ControllerAttackInfluence;
292      NumEntryTemp<uint8_t> eEG2ControllerDecayInfluence;      NumEntryTemp<uint8_t> eEG2ControllerDecayInfluence;
293      NumEntryTemp<uint8_t> eEG2ControllerReleaseInfluence;      NumEntryTemp<uint8_t> eEG2ControllerReleaseInfluence;
294        EGStateOptions eEG2StateOptions;
295        ChoiceEntryLfoWave eLFO2Wave;
296      NumEntryTemp<double> eLFO2Frequency;      NumEntryTemp<double> eLFO2Frequency;
297        NumEntryTemp<double> eLFO2Phase;
298      NumEntryTemp<uint16_t> eLFO2InternalDepth;      NumEntryTemp<uint16_t> eLFO2InternalDepth;
299      NumEntryTemp<uint16_t> eLFO2ControlDepth;      NumEntryTemp<uint16_t> eLFO2ControlDepth;
300      ChoiceEntry<gig::lfo2_ctrl_t> eLFO2Controller;      ChoiceEntry<gig::lfo2_ctrl_t> eLFO2Controller;
# Line 100  protected: Line 302  protected:
302      BoolEntry eLFO2Sync;      BoolEntry eLFO2Sync;
303      NumEntryTemp<double> eEG3Attack;      NumEntryTemp<double> eEG3Attack;
304      NumEntryTemp<int16_t> eEG3Depth;      NumEntryTemp<int16_t> eEG3Depth;
305        ChoiceEntryLfoWave eLFO3Wave;
306      NumEntryTemp<double> eLFO3Frequency;      NumEntryTemp<double> eLFO3Frequency;
307        NumEntryTemp<double> eLFO3Phase;
308      NumEntryTemp<int16_t> eLFO3InternalDepth;      NumEntryTemp<int16_t> eLFO3InternalDepth;
309      NumEntryTemp<int16_t> eLFO3ControlDepth;      NumEntryTemp<int16_t> eLFO3ControlDepth;
310      ChoiceEntry<gig::lfo3_ctrl_t> eLFO3Controller;      ChoiceEntry<gig::lfo3_ctrl_t> eLFO3Controller;
311        BoolEntry eLFO3FlipPhase;
312      BoolEntry eLFO3Sync;      BoolEntry eLFO3Sync;
313      BoolEntry eVCFEnabled;      BoolEntry eVCFEnabled;
314      ChoiceEntry<gig::vcf_type_t> eVCFType;      ChoiceEntry<gig::vcf_type_t> eVCFType;
# Line 129  protected: Line 334  protected:
334      NumEntryTemp<uint8_t> eCrossfade_out_start;      NumEntryTemp<uint8_t> eCrossfade_out_start;
335      NumEntryTemp<uint8_t> eCrossfade_out_end;      NumEntryTemp<uint8_t> eCrossfade_out_end;
336      BoolEntry ePitchTrack;      BoolEntry ePitchTrack;
337        ChoiceEntry<gig::sust_rel_trg_t> eSustainReleaseTrigger;
338        BoolEntry eNoNoteOffReleaseTrigger;
339      ChoiceEntry<gig::dim_bypass_ctrl_t> eDimensionBypass;      ChoiceEntry<gig::dim_bypass_ctrl_t> eDimensionBypass;
340      NumEntryTemp<int8_t> ePan;      NumEntryTemp<int8_t> ePan;
341      BoolEntry eSelfMask;      BoolEntry eSelfMask;
# Line 140  protected: Line 347  protected:
347      BoolEntry eMSDecode;      BoolEntry eMSDecode;
348      NumEntryTemp<uint16_t> eSampleStartOffset;      NumEntryTemp<uint16_t> eSampleStartOffset;
349      NoteEntry eUnityNote;      NoteEntry eUnityNote;
350        ReadOnlyLabelWidget eSampleGroup;
351        ReadOnlyLabelWidget eSampleFormatInfo;
352        ReadOnlyLabelWidget eSampleID;
353        ReadOnlyLabelWidget eChecksum;
354      NumEntryTemp<int16_t> eFineTune;      NumEntryTemp<int16_t> eFineTune;
355      NumEntryGain eGain;      NumEntryGain eGain;
     BoolEntryPlus6 eGainPlus6;  
356      BoolEntry eSampleLoopEnabled;      BoolEntry eSampleLoopEnabled;
357      NumEntryTemp<uint32_t> eSampleLoopStart;      NumEntryTemp<uint32_t> eSampleLoopStart;
358      NumEntryTemp<uint32_t> eSampleLoopLength;      NumEntryTemp<uint32_t> eSampleLoopLength;
# Line 152  protected: Line 362  protected:
362      Gtk::Label* lEG2;      Gtk::Label* lEG2;
363      Gtk::Label* lLFO2;      Gtk::Label* lLFO2;
364    
365        Gtk::Button buttonSelectSample;
366    
367        Gtk::HBox scriptVarsDescrBox;
368    #if GTKMM_MAJOR_VERSION < 3
369        view::WrapLabel m_labelPatchVarsDescr;
370    #else
371        MultiLineLabel  m_labelPatchVarsDescr;
372    #endif
373    
374      int rowno;      int rowno;
375      int pageno;      int pageno;
376      int firstRowInBlock;      int firstRowInBlock;
377    
378    
379      void addProp(BoolEntry& boolentry);      void addProp(BoolEntry& boolentry);
     void addProp(BoolEntryPlus6& boolentry);  
380      void addProp(LabelWidget& labelwidget);      void addProp(LabelWidget& labelwidget);
381        void addLine(HBox& line);
382      void addString(const char* labelText, Gtk::Label*& label,      void addString(const char* labelText, Gtk::Label*& label,
383                     Gtk::Entry*& widget);                     Gtk::Entry*& widget);
384        void addString(const char* labelText, Gtk::Label*& label,
385                       Gtk::Entry*& widget, Gtk::Button*& button);
386      Gtk::Label* addHeader(const char* text);      Gtk::Label* addHeader(const char* text);
387        void addRightHandSide(Gtk::Widget& widget);
388      void nextPage();      void nextPage();
389    
390      void VCFEnabled_toggled();      void VCFEnabled_toggled();
# Line 184  protected: Line 406  protected:
406      void loop_start_changed();      void loop_start_changed();
407      void loop_length_changed();      void loop_length_changed();
408      void loop_infinite_toggled();      void loop_infinite_toggled();
409        void nullOutSampleReference();
410        void on_show_tooltips_changed();
411    
412      int update_model;      int update_model;
413    
414      // connect a widget to a setter function in DimRegionEdit      // connect a widget to a setter function in DimRegionEdit
415      template<typename C, typename T>      template<typename C, typename T>
416      void connect(C& widget,      void connect(C& widget,
417                   void (DimRegionEdit::*setter)(gig::DimensionRegion*, T)) {                   void (DimRegionEdit::*setter)(gig::DimensionRegion&, T)) {
418          connect<C, T>(widget,          connect<C, T>(widget,
419                        sigc::mem_fun(setter));                        sigc::mem_fun(setter));
420      }      }
# Line 202  protected: Line 426  protected:
426                        sigc::bind(sigc::mem_fun(&DimRegionEdit::set_member<T>), member));                        sigc::bind(sigc::mem_fun(&DimRegionEdit::set_member<T>), member));
427      }      }
428    
429        // connect a widget to a member of a struct member in gig::DimensionRegion
430        template<typename C, typename T, typename S>
431        void connect(C& widget, S gig::DimensionRegion::* member, T S::* member2) {
432            connect<C, T>(widget,
433                          sigc::bind(sigc::mem_fun(&DimRegionEdit::set_sub_member<T, S>), member, member2));
434        }
435    
436      // connect a widget to a setter function in gig::DimensionRegion      // connect a widget to a setter function in gig::DimensionRegion
437      template<typename C, typename T>      template<typename C, typename T>
438      void connect(C& widget,      void connect(C& widget,
# Line 213  protected: Line 444  protected:
444      // helper function for the connect functions above      // helper function for the connect functions above
445      template<typename C, typename T>      template<typename C, typename T>
446      void connect(C& widget,      void connect(C& widget,
447                   sigc::slot<void, DimRegionEdit*, gig::DimensionRegion*, T> setter) {                   sigc::slot<void, DimRegionEdit&, gig::DimensionRegion&, T> setter) {
448          widget.signal_value_changed().connect(          widget.signal_value_changed().connect(
449              sigc::compose(sigc::bind(sigc::mem_fun(*this, &DimRegionEdit::set_many<T>), setter),              sigc::compose(sigc::bind(sigc::mem_fun(*this, &DimRegionEdit::set_many<T>), setter),
450                            sigc::mem_fun(widget, &C::get_value)));                            sigc::mem_fun(widget, &C::get_value)));
451      }      }
452    
453      // loop through all dimregions being edited ant set a value in      // loop through all dimregions being edited and set a value in
454      // each of them      // each of them
455      template<typename T>      template<typename T>
456      void set_many(T value,      void set_many(T value,
457                    sigc::slot<void, DimRegionEdit*, gig::DimensionRegion*, T> setter) {                    sigc::slot<void, DimRegionEdit&, gig::DimensionRegion&, T> setter) {
458          if (update_model == 0) {          if (update_model == 0) {
459              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;
460                   i != dimregs.end() ; i++)                   i != dimregs.end() ; ++i)
461              {              {
462                  dimreg_changed_signal(*i);                  DimRegionChangeGuard(this, *i);
463                  setter(this, *i, value);                  setter(*this, **i, value);
464              }              }
465          }          }
466      }      }
467    
468      // set a value of a member variable in the given dimregion      // set a value of a member variable in the given dimregion
469      template<typename T>      template<typename T>
470      void set_member(gig::DimensionRegion* d, T value,      void set_member(gig::DimensionRegion& d, T value,
471                      T gig::DimensionRegion::* member) {                      T gig::DimensionRegion::* member) {
472          d->*member = value;          d.*member = value;
473        }
474    
475        // set a value of a member of a struct member variable in the given dimregion
476        template<typename T, typename S>
477        void set_sub_member(gig::DimensionRegion& d, T value,
478                            S gig::DimensionRegion::* member, T S::* member2) {
479            d.*member.*member2 = value;
480      }      }
481    
482      // setters for specific dimregion parameters      // setters for specific dimregion parameters
483    
484      void set_UnityNote(gig::DimensionRegion* d, uint8_t value);      void set_UnityNote(gig::DimensionRegion& d, uint8_t value);
485      void set_FineTune(gig::DimensionRegion* d, int16_t value);      void set_FineTune(gig::DimensionRegion& d, int16_t value);
486      void set_Crossfade_in_start(gig::DimensionRegion* d, uint8_t value);      void set_Crossfade_in_start(gig::DimensionRegion& d, uint8_t value);
487      void set_Crossfade_in_end(gig::DimensionRegion* d, uint8_t value);      void set_Crossfade_in_end(gig::DimensionRegion& d, uint8_t value);
488      void set_Crossfade_out_start(gig::DimensionRegion* d, uint8_t value);      void set_Crossfade_out_start(gig::DimensionRegion& d, uint8_t value);
489      void set_Crossfade_out_end(gig::DimensionRegion* d, uint8_t value);      void set_Crossfade_out_end(gig::DimensionRegion& d, uint8_t value);
490      void set_Gain(gig::DimensionRegion* d, int32_t value);      void set_Gain(gig::DimensionRegion& d, int32_t value);
491      void set_LoopEnabled(gig::DimensionRegion* d, bool value);      void set_LoopEnabled(gig::DimensionRegion& d, bool value);
492      void set_LoopType(gig::DimensionRegion* d, uint32_t value);      void set_LoopType(gig::DimensionRegion& d, uint32_t value);
493      void set_LoopStart(gig::DimensionRegion* d, uint32_t value);      void set_LoopStart(gig::DimensionRegion& d, uint32_t value);
494      void set_LoopLength(gig::DimensionRegion* d, uint32_t value);      void set_LoopLength(gig::DimensionRegion& d, uint32_t value);
495      void set_LoopInfinite(gig::DimensionRegion* d, bool value);      void set_LoopInfinite(gig::DimensionRegion& d, bool value);
496      void set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value);      void set_LoopPlayCount(gig::DimensionRegion& d, uint32_t value);
497    
498        void onButtonSelectSamplePressed();
499  };  };
500    
501  #endif  #endif

Legend:
Removed from v.2151  
changed lines
  Added in v.3737

  ViewVC Help
Powered by ViewVC