/[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 3068 by schoenebeck, Mon Jan 2 22:13:01 2017 UTC revision 3449 by schoenebeck, Sun Dec 23 23:06:56 2018 UTC
# Line 26  Line 26 
26  # include <gig.h>  # include <gig.h>
27  #endif  #endif
28    
29    #include "compat.h"
30    
31  #include <cairomm/context.h>  #include <cairomm/context.h>
32  #include <gtkmm/box.h>  #include <gtkmm/box.h>
33  #include <gtkmm/drawingarea.h>  #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  #include <set>  #include <set>
44    
45  #include "paramedit.h"  #include "paramedit.h"
46    #include "global.h"
47    
48  class VelocityCurve : public Gtk::DrawingArea {  class VelocityCurve : public Gtk::DrawingArea {
49  public:  public:
# Line 74  private: Line 81  private:
81                          bool sensitive);                          bool sensitive);
82  };  };
83    
84    class EGStateOptions : public HBox {
85    public:
86        Gtk::Label label;
87        BoolBox checkBoxAttack;
88        BoolBox checkBoxAttackHold;
89        BoolBox checkBoxDecay1;
90        BoolBox checkBoxDecay2;
91        BoolBox checkBoxRelease;
92    
93        EGStateOptions();
94        void on_show_tooltips_changed();
95    };
96    
97  class DimRegionEdit : public Gtk::Notebook  class DimRegionEdit : public Gtk::Notebook
98  {  {
99  public:  public:
# Line 98  protected: Line 118  protected:
118      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
119      sigc::signal<void, gig::Sample*> select_sample_signal;      sigc::signal<void, gig::Sample*> select_sample_signal;
120    
121        /**
122         * Ensures that the 2 signals DimRegionEdit::dimreg_to_be_changed_signal and
123         * DimRegionEdit::dimreg_changed_signal are always triggered correctly as a
124         * pair. It behaves similar to a "mutex lock guard" design pattern.
125         */
126        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
127        public:
128            DimRegionChangeGuard(DimRegionEdit* edit, gig::DimensionRegion* pDimReg) :
129                SignalGuard<gig::DimensionRegion*>(edit->dimreg_to_be_changed_signal, edit->dimreg_changed_signal, pDimReg)
130            {
131            }
132        };
133    
134      gig::DimensionRegion* dimregion;      gig::DimensionRegion* dimregion;
135    
136  #ifdef OLD_TOOLTIPS  #ifdef OLD_TOOLTIPS
137      Gtk::Tooltips tooltips;      Gtk::Tooltips tooltips;
138  #endif  #endif
139    
140    #if USE_GTKMM_GRID
141        Gtk::Grid* table[7];
142    #else
143      Gtk::Table* table[7];      Gtk::Table* table[7];
144    #endif
145    
146      Gtk::Label* lSample;      Gtk::Label* lSample;
147    
# Line 126  protected: Line 163  protected:
163      NumEntryTemp<uint8_t> eEG1ControllerAttackInfluence;      NumEntryTemp<uint8_t> eEG1ControllerAttackInfluence;
164      NumEntryTemp<uint8_t> eEG1ControllerDecayInfluence;      NumEntryTemp<uint8_t> eEG1ControllerDecayInfluence;
165      NumEntryTemp<uint8_t> eEG1ControllerReleaseInfluence;      NumEntryTemp<uint8_t> eEG1ControllerReleaseInfluence;
166        EGStateOptions eEG1StateOptions;
167      NumEntryTemp<double> eLFO1Frequency;      NumEntryTemp<double> eLFO1Frequency;
168      NumEntryTemp<uint16_t> eLFO1InternalDepth;      NumEntryTemp<uint16_t> eLFO1InternalDepth;
169      NumEntryTemp<uint16_t> eLFO1ControlDepth;      NumEntryTemp<uint16_t> eLFO1ControlDepth;
# Line 144  protected: Line 182  protected:
182      NumEntryTemp<uint8_t> eEG2ControllerAttackInfluence;      NumEntryTemp<uint8_t> eEG2ControllerAttackInfluence;
183      NumEntryTemp<uint8_t> eEG2ControllerDecayInfluence;      NumEntryTemp<uint8_t> eEG2ControllerDecayInfluence;
184      NumEntryTemp<uint8_t> eEG2ControllerReleaseInfluence;      NumEntryTemp<uint8_t> eEG2ControllerReleaseInfluence;
185        EGStateOptions eEG2StateOptions;
186      NumEntryTemp<double> eLFO2Frequency;      NumEntryTemp<double> eLFO2Frequency;
187      NumEntryTemp<uint16_t> eLFO2InternalDepth;      NumEntryTemp<uint16_t> eLFO2InternalDepth;
188      NumEntryTemp<uint16_t> eLFO2ControlDepth;      NumEntryTemp<uint16_t> eLFO2ControlDepth;
# Line 181  protected: Line 220  protected:
220      NumEntryTemp<uint8_t> eCrossfade_out_start;      NumEntryTemp<uint8_t> eCrossfade_out_start;
221      NumEntryTemp<uint8_t> eCrossfade_out_end;      NumEntryTemp<uint8_t> eCrossfade_out_end;
222      BoolEntry ePitchTrack;      BoolEntry ePitchTrack;
223        ChoiceEntry<gig::sust_rel_trg_t> eSustainReleaseTrigger;
224        BoolEntry eNoNoteOffReleaseTrigger;
225      ChoiceEntry<gig::dim_bypass_ctrl_t> eDimensionBypass;      ChoiceEntry<gig::dim_bypass_ctrl_t> eDimensionBypass;
226      NumEntryTemp<int8_t> ePan;      NumEntryTemp<int8_t> ePan;
227      BoolEntry eSelfMask;      BoolEntry eSelfMask;
# Line 218  protected: Line 259  protected:
259      void addProp(BoolEntry& boolentry);      void addProp(BoolEntry& boolentry);
260      void addProp(BoolEntryPlus6& boolentry);      void addProp(BoolEntryPlus6& boolentry);
261      void addProp(LabelWidget& labelwidget);      void addProp(LabelWidget& labelwidget);
262        void addLine(HBox& line);
263      void addString(const char* labelText, Gtk::Label*& label,      void addString(const char* labelText, Gtk::Label*& label,
264                     Gtk::Entry*& widget);                     Gtk::Entry*& widget);
265      void addString(const char* labelText, Gtk::Label*& label,      void addString(const char* labelText, Gtk::Label*& label,
# Line 246  protected: Line 288  protected:
288      void loop_length_changed();      void loop_length_changed();
289      void loop_infinite_toggled();      void loop_infinite_toggled();
290      void nullOutSampleReference();      void nullOutSampleReference();
291        void on_show_tooltips_changed();
292    
293      int update_model;      int update_model;
294    
295        /**
296         * Workaround for the circumstance that C++ does not allow to cast to
297         * member pointers.
298         */
299        template<typename classT, typename memberT>
300        union ClassMemberPtr {
301            memberT classT::*pmember;
302            void* pvoid;
303    
304            ClassMemberPtr(size_t s) : pvoid((void*)s) {}
305            ClassMemberPtr(void* p) : pvoid(p) {}
306        };
307    
308      // connect a widget to a setter function in DimRegionEdit      // connect a widget to a setter function in DimRegionEdit
309      template<typename C, typename T>      template<typename C, typename T>
310      void connect(C& widget,      void connect(C& widget,
# Line 290  protected: Line 346  protected:
346              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;
347                   i != dimregs.end() ; ++i)                   i != dimregs.end() ; ++i)
348              {              {
349                  dimreg_changed_signal(*i);                  DimRegionChangeGuard(this, *i);
350                  setter(this, *i, value);                  setter(this, *i, value);
351              }              }
352          }          }

Legend:
Removed from v.3068  
changed lines
  Added in v.3449

  ViewVC Help
Powered by ViewVC