/[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 1623 by persson, Fri Jan 4 19:42:45 2008 UTC revision 2720 by schoenebeck, Sun Mar 1 15:43:42 2015 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2008 Andreas Persson   * Copyright (C) 2006-2015 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 22  Line 22 
22    
23  #include <gig.h>  #include <gig.h>
24    
25    #include <cairomm/context.h>
26    #include <gtkmm/drawingarea.h>
27  #include <gtkmm/entry.h>  #include <gtkmm/entry.h>
28  #include <gtkmm/label.h>  #include <gtkmm/label.h>
29  #include <gtkmm/notebook.h>  #include <gtkmm/notebook.h>
30  #include <gtkmm/table.h>  #include <gtkmm/table.h>
 #include <gtkmm/tooltips.h>  
31    
32  #include <set>  #include <set>
33    
34  #include "paramedit.h"  #include "paramedit.h"
35    
36    class VelocityCurve : public Gtk::DrawingArea {
37    public:
38        VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t));
39        void set_dim_region(gig::DimensionRegion* d) { dimreg = d; }
40    
41    protected:
42    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
43        bool on_expose_event(GdkEventExpose* e);
44    #else
45        bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
46    #endif
47    
48    private:
49        double (gig::DimensionRegion::* const getter)(uint8_t);
50        gig::DimensionRegion* dimreg;
51    };
52    
53    class CrossfadeCurve : public Gtk::DrawingArea {
54    public:
55        CrossfadeCurve();
56        void set_dim_region(gig::DimensionRegion* d) { dimreg = d; }
57    
58    protected:
59    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
60        bool on_expose_event(GdkEventExpose* e);
61    #else
62        bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
63    #endif
64    
65    private:
66        gig::DimensionRegion* dimreg;
67        void draw_one_curve(const Cairo::RefPtr<Cairo::Context>& cr,
68                            const gig::DimensionRegion* d,
69                            bool sensitive);
70    };
71    
72  class DimRegionEdit : public Gtk::Notebook  class DimRegionEdit : public Gtk::Notebook
73  {  {
74  public:  public:
75      DimRegionEdit();      DimRegionEdit();
76      virtual ~DimRegionEdit();      virtual ~DimRegionEdit();
77      void set_dim_region(gig::DimensionRegion* d);      void set_dim_region(gig::DimensionRegion* d);
78      bool set_sample(gig::Sample* sample);      bool set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop);
79      Gtk::Entry* wSample;      Gtk::Entry* wSample;
80        Gtk::Button* buttonNullSampleReference;
81      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
82      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
83      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();
84        sigc::signal<void, gig::Sample*>& signal_select_sample();
85    
86      std::set<gig::DimensionRegion*> dimregs;      std::set<gig::DimensionRegion*> dimregs;
87    
# Line 51  protected: Line 90  protected:
90      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
91      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;
92      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
93        sigc::signal<void, gig::Sample*> select_sample_signal;
94    
95      gig::DimensionRegion* dimregion;      gig::DimensionRegion* dimregion;
96    
97    #ifdef OLD_TOOLTIPS
98      Gtk::Tooltips tooltips;      Gtk::Tooltips tooltips;
99    #endif
100    
101      Gtk::Table* table[7];      Gtk::Table* table[7];
102    
103      Gtk::Label* lSample;      Gtk::Label* lSample;
104    
105        VelocityCurve velocity_curve;
106        VelocityCurve release_curve;
107        VelocityCurve cutoff_curve;
108        CrossfadeCurve crossfade_curve;
109    
110      NumEntryPermille eEG1PreAttack;      NumEntryPermille eEG1PreAttack;
111      NumEntryTemp<double> eEG1Attack;      NumEntryTemp<double> eEG1Attack;
112      NumEntryTemp<double> eEG1Decay1;      NumEntryTemp<double> eEG1Decay1;
# Line 139  protected: Line 186  protected:
186      BoolEntry eMSDecode;      BoolEntry eMSDecode;
187      NumEntryTemp<uint16_t> eSampleStartOffset;      NumEntryTemp<uint16_t> eSampleStartOffset;
188      NoteEntry eUnityNote;      NoteEntry eUnityNote;
189        ReadOnlyLabelWidget eSampleFormatInfo;
190        ReadOnlyLabelWidget eSampleID;
191      NumEntryTemp<int16_t> eFineTune;      NumEntryTemp<int16_t> eFineTune;
192      NumEntryGain eGain;      NumEntryGain eGain;
193      BoolEntryPlus6 eGainPlus6;      BoolEntryPlus6 eGainPlus6;
# Line 151  protected: Line 200  protected:
200      Gtk::Label* lEG2;      Gtk::Label* lEG2;
201      Gtk::Label* lLFO2;      Gtk::Label* lLFO2;
202    
203        Gtk::Button buttonSelectSample;
204    
205      int rowno;      int rowno;
206      int pageno;      int pageno;
207      int firstRowInBlock;      int firstRowInBlock;
# Line 161  protected: Line 212  protected:
212      void addProp(LabelWidget& labelwidget);      void addProp(LabelWidget& labelwidget);
213      void addString(const char* labelText, Gtk::Label*& label,      void addString(const char* labelText, Gtk::Label*& label,
214                     Gtk::Entry*& widget);                     Gtk::Entry*& widget);
215        void addString(const char* labelText, Gtk::Label*& label,
216                       Gtk::Entry*& widget, Gtk::Button*& button);
217      Gtk::Label* addHeader(const char* text);      Gtk::Label* addHeader(const char* text);
218        void addRightHandSide(Gtk::Widget& widget);
219      void nextPage();      void nextPage();
220    
221      void VCFEnabled_toggled();      void VCFEnabled_toggled();
# Line 183  protected: Line 237  protected:
237      void loop_start_changed();      void loop_start_changed();
238      void loop_length_changed();      void loop_length_changed();
239      void loop_infinite_toggled();      void loop_infinite_toggled();
240        void nullOutSampleReference();
241    
242      int update_model;      int update_model;
243    
# Line 255  protected: Line 310  protected:
310      void set_LoopLength(gig::DimensionRegion* d, uint32_t value);      void set_LoopLength(gig::DimensionRegion* d, uint32_t value);
311      void set_LoopInfinite(gig::DimensionRegion* d, bool value);      void set_LoopInfinite(gig::DimensionRegion* d, bool value);
312      void set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value);      void set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value);
313    
314        void onButtonSelectSamplePressed();
315  };  };
316    
317  #endif  #endif

Legend:
Removed from v.1623  
changed lines
  Added in v.2720

  ViewVC Help
Powered by ViewVC