/[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 2991 by schoenebeck, Sat Sep 24 15:08:37 2016 UTC revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2015 Andreas Persson   * Copyright (C) 2006-2017 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# 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>  #include <cairomm/context.h>
32  #include <gtkmm/box.h>  #include <gtkmm/box.h>
# Line 28  Line 34 
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 70  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    };
95    
96  class DimRegionEdit : public Gtk::Notebook  class DimRegionEdit : public Gtk::Notebook
97  {  {
98  public:  public:
# Line 94  protected: Line 117  protected:
117      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
118      sigc::signal<void, gig::Sample*> select_sample_signal;      sigc::signal<void, gig::Sample*> select_sample_signal;
119    
120        /**
121         * Ensures that the 2 signals DimRegionEdit::dimreg_to_be_changed_signal and
122         * DimRegionEdit::dimreg_changed_signal are always triggered correctly as a
123         * pair. It behaves similar to a "mutex lock guard" design pattern.
124         */
125        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
126        public:
127            DimRegionChangeGuard(DimRegionEdit* edit, gig::DimensionRegion* pDimReg) :
128                SignalGuard<gig::DimensionRegion*>(edit->dimreg_to_be_changed_signal, edit->dimreg_changed_signal, pDimReg)
129            {
130            }
131        };
132    
133      gig::DimensionRegion* dimregion;      gig::DimensionRegion* dimregion;
134    
135  #ifdef OLD_TOOLTIPS  #ifdef OLD_TOOLTIPS
136      Gtk::Tooltips tooltips;      Gtk::Tooltips tooltips;
137  #endif  #endif
138    
139    #if USE_GTKMM_GRID
140        Gtk::Grid* table[7];
141    #else
142      Gtk::Table* table[7];      Gtk::Table* table[7];
143    #endif
144    
145      Gtk::Label* lSample;      Gtk::Label* lSample;
146    
# Line 122  protected: Line 162  protected:
162      NumEntryTemp<uint8_t> eEG1ControllerAttackInfluence;      NumEntryTemp<uint8_t> eEG1ControllerAttackInfluence;
163      NumEntryTemp<uint8_t> eEG1ControllerDecayInfluence;      NumEntryTemp<uint8_t> eEG1ControllerDecayInfluence;
164      NumEntryTemp<uint8_t> eEG1ControllerReleaseInfluence;      NumEntryTemp<uint8_t> eEG1ControllerReleaseInfluence;
165        EGStateOptions eEG1StateOptions;
166      NumEntryTemp<double> eLFO1Frequency;      NumEntryTemp<double> eLFO1Frequency;
167      NumEntryTemp<uint16_t> eLFO1InternalDepth;      NumEntryTemp<uint16_t> eLFO1InternalDepth;
168      NumEntryTemp<uint16_t> eLFO1ControlDepth;      NumEntryTemp<uint16_t> eLFO1ControlDepth;
# Line 140  protected: Line 181  protected:
181      NumEntryTemp<uint8_t> eEG2ControllerAttackInfluence;      NumEntryTemp<uint8_t> eEG2ControllerAttackInfluence;
182      NumEntryTemp<uint8_t> eEG2ControllerDecayInfluence;      NumEntryTemp<uint8_t> eEG2ControllerDecayInfluence;
183      NumEntryTemp<uint8_t> eEG2ControllerReleaseInfluence;      NumEntryTemp<uint8_t> eEG2ControllerReleaseInfluence;
184        EGStateOptions eEG2StateOptions;
185      NumEntryTemp<double> eLFO2Frequency;      NumEntryTemp<double> eLFO2Frequency;
186      NumEntryTemp<uint16_t> eLFO2InternalDepth;      NumEntryTemp<uint16_t> eLFO2InternalDepth;
187      NumEntryTemp<uint16_t> eLFO2ControlDepth;      NumEntryTemp<uint16_t> eLFO2ControlDepth;
# Line 214  protected: Line 256  protected:
256      void addProp(BoolEntry& boolentry);      void addProp(BoolEntry& boolentry);
257      void addProp(BoolEntryPlus6& boolentry);      void addProp(BoolEntryPlus6& boolentry);
258      void addProp(LabelWidget& labelwidget);      void addProp(LabelWidget& labelwidget);
259        void addLine(HBox& line);
260      void addString(const char* labelText, Gtk::Label*& label,      void addString(const char* labelText, Gtk::Label*& label,
261                     Gtk::Entry*& widget);                     Gtk::Entry*& widget);
262      void addString(const char* labelText, Gtk::Label*& label,      void addString(const char* labelText, Gtk::Label*& label,
# Line 245  protected: Line 288  protected:
288    
289      int update_model;      int update_model;
290    
291        /**
292         * Workaround for the circumstance that C++ does not allow to cast to
293         * member pointers.
294         */
295        template<typename classT, typename memberT>
296        union ClassMemberPtr {
297            memberT classT::*pmember;
298            void* pvoid;
299    
300            ClassMemberPtr(size_t s) : pvoid((void*)s) {}
301            ClassMemberPtr(void* p) : pvoid(p) {}
302        };
303    
304      // connect a widget to a setter function in DimRegionEdit      // connect a widget to a setter function in DimRegionEdit
305      template<typename C, typename T>      template<typename C, typename T>
306      void connect(C& widget,      void connect(C& widget,
# Line 286  protected: Line 342  protected:
342              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;              for (std::set<gig::DimensionRegion*>::iterator i = dimregs.begin() ;
343                   i != dimregs.end() ; ++i)                   i != dimregs.end() ; ++i)
344              {              {
345                  dimreg_changed_signal(*i);                  DimRegionChangeGuard(this, *i);
346                  setter(this, *i, value);                  setter(this, *i, value);
347              }              }
348          }          }

Legend:
Removed from v.2991  
changed lines
  Added in v.3364

  ViewVC Help
Powered by ViewVC