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

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

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

revision 1382 by schoenebeck, Thu Oct 4 23:29:22 2007 UTC revision 1533 by persson, Sat Dec 1 10:21:07 2007 UTC
# Line 32  Line 32 
32  #include <gtkmm/treestore.h>  #include <gtkmm/treestore.h>
33  #include <gtkmm/uimanager.h>  #include <gtkmm/uimanager.h>
34  #include <gtkmm/window.h>  #include <gtkmm/window.h>
35    #include <gtkmm/statusbar.h>
36    #include <gtkmm/image.h>
37    
38  #include <sstream>  #include <sstream>
39    
# Line 57  public: Line 59  public:
59      void set_instrument(gig::Instrument* instrument);      void set_instrument(gig::Instrument* instrument);
60      sigc::signal<void>& signal_instrument_changed();      sigc::signal<void>& signal_instrument_changed();
61  protected:  protected:
62        gig::Instrument* instrument;
63        int update_model;
64    
65        template<typename T>
66        void set_value(T value, sigc::slot<void, InstrumentProps*, T> setter) {
67            if (update_model == 0) {
68                setter(this, value);
69                instrument_changed();
70            }
71        }
72    
73        template<typename C, typename T>
74        void connect(C& widget, T gig::Instrument::* member) {
75            widget.signal_value_changed().connect(
76                sigc::compose(
77                    sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>),
78                               sigc::bind(sigc::mem_fun(&InstrumentProps::set_member<T>), member)),
79                    sigc::mem_fun(widget, &C::get_value)));
80        }
81    
82        template<typename C, typename T>
83        void connect(C& widget, void (InstrumentProps::*setter)(T)) {
84            widget.signal_value_changed().connect(
85                sigc::compose(
86                    sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>),
87                               sigc::mem_fun(setter)),
88                    sigc::mem_fun(widget, &C::get_value)));
89        }
90    
91        template<typename T>
92        void set_member(T value, T gig::Instrument::* member) {
93            instrument->*member = value;
94        }
95    
96        void set_IsDrum(bool value);
97        void set_MIDIBank(uint16_t value);
98        void set_MIDIProgram(uint32_t value);
99        void set_DimensionKeyRange_low(uint8_t value);
100        void set_DimensionKeyRange_high(uint8_t value);
101    
102      Gtk::VBox vbox;      Gtk::VBox vbox;
103      Gtk::HButtonBox buttonBox;      Gtk::HButtonBox buttonBox;
104      Gtk::Button quitButton;      Gtk::Button quitButton;
# Line 77  protected: Line 119  protected:
119      void add_prop(BoolEntry& prop);      void add_prop(BoolEntry& prop);
120      void add_prop(BoolEntryPlus6& prop);      void add_prop(BoolEntryPlus6& prop);
121      void add_prop(LabelWidget& prop);      void add_prop(LabelWidget& prop);
     void key_range_low_changed();  
     void key_range_high_changed();  
122      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
123  };  };
124    
# Line 131  protected: Line 171  protected:
171      Glib::RefPtr<Gtk::ActionGroup> actionGroup;      Glib::RefPtr<Gtk::ActionGroup> actionGroup;
172      Glib::RefPtr<Gtk::UIManager> uiManager;      Glib::RefPtr<Gtk::UIManager> uiManager;
173    
174        Gtk::Statusbar m_StatusBar;
175        Gtk::Label     m_AttachedStateLabel;
176        Gtk::Image     m_AttachedStateImage;
177    
178      RegionChooser m_RegionChooser;      RegionChooser m_RegionChooser;
179      DimRegionChooser m_DimRegionChooser;      DimRegionChooser m_DimRegionChooser;
180    
# Line 153  protected: Line 197  protected:
197      void dimreg_changed();      void dimreg_changed();
198      void on_loader_progress();      void on_loader_progress();
199      void on_loader_finished();      void on_loader_finished();
200        void dimreg_all_dimregs_toggled();
201        gig::Instrument* get_instrument();
202        void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs);
203        void update_dimregs();
204    
205      class ModelColumns : public Gtk::TreeModel::ColumnRecord {      class ModelColumns : public Gtk::TreeModel::ColumnRecord {
206      public:      public:
# Line 199  protected: Line 247  protected:
247      Gtk::TreeView m_TreeViewSamples;      Gtk::TreeView m_TreeViewSamples;
248      Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel;      Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel;
249    
250        Gtk::VBox dimreg_vbox;
251        Gtk::HBox dimreg_hbox;
252        Gtk::Label dimreg_label;
253        Gtk::CheckButton dimreg_all_regions;
254        Gtk::CheckButton dimreg_all_dimregs;
255        Gtk::CheckButton dimreg_stereo;
256      DimRegionEdit dimreg_edit;      DimRegionEdit dimreg_edit;
257    
258      Gtk::Notebook m_Notebook;      Gtk::Notebook m_Notebook;
# Line 221  protected: Line 275  protected:
275      void on_action_file_properties();      void on_action_file_properties();
276      void on_action_quit();      void on_action_quit();
277      void show_instr_props();      void show_instr_props();
278        void on_action_view_status_bar();
279      void on_action_help_about();      void on_action_help_about();
280    
281      // sample right-click popup actions      // sample right-click popup actions
# Line 244  protected: Line 299  protected:
299      std::string filename;      std::string filename;
300      std::string current_dir;      std::string current_dir;
301    
302        void set_file_is_shared(bool);
303    
304      bool file_save();      bool file_save();
305      bool file_save_as();      bool file_save_as();
306      bool check_if_savable();      bool check_if_savable();

Legend:
Removed from v.1382  
changed lines
  Added in v.1533

  ViewVC Help
Powered by ViewVC