/[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 3618 by persson, Sat Feb 2 17:53:36 2019 UTC revision 3619 by schoenebeck, Tue Oct 1 16:21:28 2019 UTC
# Line 40  Line 40 
40  # include <gtkmm/table.h>  # include <gtkmm/table.h>
41  #endif  #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"
# Line 81  private: Line 87  private:
87                          bool sensitive);                          bool sensitive);
88  };  };
89    
90    class LFOGraph : public Gtk::DrawingArea {
91    public:
92        LFOGraph();
93        void set_dim_region(gig::DimensionRegion* d) { dimreg = d; }
94    
95    protected:
96    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
97        bool on_expose_event(GdkEventExpose* e);
98    #else
99        bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
100    #endif
101    
102        virtual float frequency() const = 0;
103        virtual uint internalDepth() const = 0;
104        virtual uint controllerDepth() const = 0;
105        virtual bool flipPolarity() const = 0;
106        virtual bool signedRange() const = 0;
107        virtual LinuxSampler::LFO::start_level_t startLevel() const = 0;
108        virtual bool hasControllerAssigned() const = 0;
109    
110        gig::DimensionRegion* dimreg;
111        LinuxSampler::LFO lfo;
112    };
113    
114    class LFO1Graph : public LFOGraph {
115    public:
116        float frequency() const OVERRIDE { return dimreg->LFO1Frequency; }
117        uint internalDepth() const OVERRIDE {
118            const gig::lfo1_ctrl_t ctrl = dimreg->LFO1Controller;
119            const bool hasInternalDepth = (
120                ctrl != gig::lfo1_ctrl_modwheel && ctrl != gig::lfo1_ctrl_breath
121            );
122            return (hasInternalDepth) ? dimreg->LFO1InternalDepth : 0;
123        }
124        uint controllerDepth() const OVERRIDE { return dimreg->LFO1ControlDepth; }
125        bool flipPolarity() const OVERRIDE { return dimreg->LFO1FlipPhase; }
126        bool signedRange() const OVERRIDE { return false; }
127        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
128        bool hasControllerAssigned() const OVERRIDE { return dimreg->LFO1Controller; }
129    };
130    
131    class LFO2Graph : public LFOGraph {
132    public:
133        float frequency() const OVERRIDE { return dimreg->LFO2Frequency; }
134        uint internalDepth() const OVERRIDE {
135            const gig::lfo2_ctrl_t ctrl = dimreg->LFO2Controller;
136            const bool hasInternalDepth = (
137                ctrl != gig::lfo2_ctrl_modwheel && ctrl != gig::lfo2_ctrl_foot
138            );
139            return (hasInternalDepth) ? dimreg->LFO2InternalDepth : 0;
140        }
141        uint controllerDepth() const OVERRIDE { return dimreg->LFO2ControlDepth; }
142        bool flipPolarity() const OVERRIDE { return dimreg->LFO2FlipPhase; }
143        bool signedRange() const OVERRIDE { return false; }
144        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
145        bool hasControllerAssigned() const OVERRIDE { return dimreg->LFO2Controller; }
146    };
147    
148    class LFO3Graph : public LFOGraph {
149    public:
150        float frequency() const OVERRIDE { return dimreg->LFO3Frequency; }
151        uint internalDepth() const OVERRIDE {
152            const gig::lfo3_ctrl_t ctrl = dimreg->LFO3Controller;
153            const bool hasInternalDepth = (
154                ctrl != gig::lfo3_ctrl_modwheel && ctrl != gig::lfo3_ctrl_aftertouch
155            );
156            return (hasInternalDepth) ? dimreg->LFO3InternalDepth : 0;
157        }
158        uint controllerDepth() const OVERRIDE { return dimreg->LFO3ControlDepth; }
159        bool flipPolarity() const OVERRIDE { return false; }
160        bool signedRange() const OVERRIDE { return true; }
161        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
162        bool hasControllerAssigned() const OVERRIDE { return dimreg->LFO3Controller; }
163    };
164    
165  class EGStateOptions : public HBox {  class EGStateOptions : public HBox {
166  public:  public:
167      Gtk::Label label;      Gtk::Label label;
# Line 138  protected: Line 219  protected:
219  #endif  #endif
220    
221  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
222      Gtk::Grid* table[7];      Gtk::Grid* table[9];
223  #else  #else
224      Gtk::Table* table[7];      Gtk::Table* table[9];
225  #endif  #endif
226    
227      Gtk::Label* lSample;      Gtk::Label* lSample;
# Line 149  protected: Line 230  protected:
230      VelocityCurve release_curve;      VelocityCurve release_curve;
231      VelocityCurve cutoff_curve;      VelocityCurve cutoff_curve;
232      CrossfadeCurve crossfade_curve;      CrossfadeCurve crossfade_curve;
233        LFO1Graph lfo1Graph; ///< Graphic of Amplitude (Volume) LFO waveform.
234        LFO2Graph lfo2Graph; ///< Graphic of Filter Cutoff LFO waveform.
235        LFO3Graph lfo3Graph; ///< Graphic of Pitch LFO waveform.
236    
237      NumEntryPermille eEG1PreAttack;      NumEntryPermille eEG1PreAttack;
238      NumEntryTemp<double> eEG1Attack;      NumEntryTemp<double> eEG1Attack;

Legend:
Removed from v.3618  
changed lines
  Added in v.3619

  ViewVC Help
Powered by ViewVC