/[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 1411 by schoenebeck, Fri Oct 12 17:46:29 2007 UTC revision 2395 by schoenebeck, Mon Jan 7 23:35:08 2013 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006, 2007 Andreas Persson   * Copyright (C) 2006 - 2013 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 40  Line 40 
40  #include "regionchooser.h"  #include "regionchooser.h"
41  #include "dimregionchooser.h"  #include "dimregionchooser.h"
42  #include "dimregionedit.h"  #include "dimregionedit.h"
43    #ifndef OLD_THREADS
44    #include <glibmm/threads.h>
45    #endif
46    
47  class MainWindow;  class MainWindow;
48    
49    class Table : public Gtk::Table
50    {
51    public:
52        Table(int x, int y);
53        void add(BoolEntry& boolentry);
54        void add(BoolEntryPlus6& boolentry);
55        void add(LabelWidget& labelwidget);
56    private:
57        int rowno;
58    };
59    
60  class PropDialog : public Gtk::Window {  class PropDialog : public Gtk::Window {
61  public:  public:
62      PropDialog();      PropDialog();
63      void set_info(DLS::Info* info);      void set_info(DLS::Info* info);
64        sigc::signal<void>& signal_info_changed();
65  protected:  protected:
66      Gtk::Table table;      sigc::signal<void> info_changed;
67      Gtk::Label label[16];      StringEntry eName;
68      Gtk::Entry entry[16];      StringEntry eCreationDate;
69        StringEntryMultiLine eComments;
70        StringEntry eProduct;
71        StringEntry eCopyright;
72        StringEntry eArtists;
73        StringEntry eGenre;
74        StringEntry eKeywords;
75        StringEntry eEngineer;
76        StringEntry eTechnician;
77        StringEntry eSoftware;
78        StringEntry eMedium;
79        StringEntry eSource;
80        StringEntry eSourceForm;
81        StringEntry eCommissioned;
82        StringEntry eSubject;
83        Gtk::VBox vbox;
84        Gtk::HButtonBox buttonBox;
85        Gtk::Button quitButton;
86        Table table;
87        int update_model;
88        DLS::Info* info;
89    
90        template<typename T>
91        void set_member(T value, T DLS::Info::* member) {
92            if (update_model == 0) {
93                info->*member = value;
94                info_changed();
95            }
96        }
97    
98        template<typename C, typename T>
99        void connect(C& widget, T DLS::Info::* member) {
100            widget.signal_value_changed().connect(
101                sigc::compose(
102                    sigc::bind(sigc::mem_fun(*this, &PropDialog::set_member<T>), member),
103                    sigc::mem_fun(widget, &C::get_value)));
104        }
105  };  };
106    
107  class InstrumentProps : public Gtk::Window {  class InstrumentProps : public Gtk::Window {
# Line 59  public: Line 110  public:
110      void set_instrument(gig::Instrument* instrument);      void set_instrument(gig::Instrument* instrument);
111      sigc::signal<void>& signal_instrument_changed();      sigc::signal<void>& signal_instrument_changed();
112  protected:  protected:
113        gig::Instrument* instrument;
114        int update_model;
115    
116        template<typename T>
117        void set_value(T value, sigc::slot<void, InstrumentProps*, T> setter) {
118            if (update_model == 0) {
119                setter(this, value);
120                instrument_changed();
121            }
122        }
123    
124        template<typename C, typename T>
125        void connect(C& widget, T gig::Instrument::* member) {
126            widget.signal_value_changed().connect(
127                sigc::compose(
128                    sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>),
129                               sigc::bind(sigc::mem_fun(&InstrumentProps::set_member<T>), member)),
130                    sigc::mem_fun(widget, &C::get_value)));
131        }
132    
133        template<typename C, typename T>
134        void connect(C& widget, void (InstrumentProps::*setter)(T)) {
135            widget.signal_value_changed().connect(
136                sigc::compose(
137                    sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>),
138                               sigc::mem_fun(setter)),
139                    sigc::mem_fun(widget, &C::get_value)));
140        }
141    
142        template<typename T>
143        void set_member(T value, T gig::Instrument::* member) {
144            instrument->*member = value;
145        }
146    
147        void set_IsDrum(bool value);
148        void set_MIDIBank(uint16_t value);
149        void set_MIDIProgram(uint32_t value);
150        void set_DimensionKeyRange_low(uint8_t value);
151        void set_DimensionKeyRange_high(uint8_t value);
152    
153      Gtk::VBox vbox;      Gtk::VBox vbox;
154      Gtk::HButtonBox buttonBox;      Gtk::HButtonBox buttonBox;
155      Gtk::Button quitButton;      Gtk::Button quitButton;
156      Gtk::Table table;      Table table;
157      StringEntry eName;      StringEntry eName;
158      BoolEntry eIsDrum;      BoolEntry eIsDrum;
159      NumEntryTemp<uint16_t> eMIDIBank;      NumEntryTemp<uint16_t> eMIDIBank;
# Line 75  protected: Line 166  protected:
166      BoolEntry ePianoReleaseMode;      BoolEntry ePianoReleaseMode;
167      NoteEntry eDimensionKeyRangeLow;      NoteEntry eDimensionKeyRangeLow;
168      NoteEntry eDimensionKeyRangeHigh;      NoteEntry eDimensionKeyRangeHigh;
     int rowno;  
     void add_prop(BoolEntry& prop);  
     void add_prop(BoolEntryPlus6& prop);  
     void add_prop(LabelWidget& prop);  
     void key_range_low_changed();  
     void key_range_high_changed();  
169      sigc::signal<void> instrument_changed;      sigc::signal<void> instrument_changed;
170  };  };
171    
# Line 104  public: Line 189  public:
189      gig::File* gig;      gig::File* gig;
190    
191  private:  private:
192      Glib::Thread* thread;      Glib::Threads::Thread* thread;
193      void thread_function();      void thread_function();
194      Glib::Dispatcher finished_dispatcher;      Glib::Dispatcher finished_dispatcher;
195      Glib::Dispatcher progress_dispatcher;      Glib::Dispatcher progress_dispatcher;
196      Glib::Mutex progressMutex;      Glib::Threads::Mutex progressMutex;
197      float progress;      float progress;
198  };  };
199    
# Line 127  public: Line 212  public:
212      sigc::signal<void, gig::Region*>& signal_region_changed();      sigc::signal<void, gig::Region*>& signal_region_changed();
213      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
214      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
215        sigc::signal<void, gig::Sample*>& signal_sample_changed();
216      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();
217    
218        sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on();
219        sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_off();
220    
221        sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit();
222        sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released();
223    
224  protected:  protected:
225      Glib::RefPtr<Gtk::ActionGroup> actionGroup;      Glib::RefPtr<Gtk::ActionGroup> actionGroup;
226      Glib::RefPtr<Gtk::UIManager> uiManager;      Glib::RefPtr<Gtk::UIManager> uiManager;
# Line 151  protected: Line 243  protected:
243      sigc::signal<void, gig::Region*> region_changed_signal;      sigc::signal<void, gig::Region*> region_changed_signal;
244      sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;
245      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
246        sigc::signal<void, gig::Sample*> sample_changed_signal;
247      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;
248    
249        sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;
250        sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal;
251    
252      void on_instrument_selection_change(int index);      void on_instrument_selection_change(int index);
253      void on_sel_change();      void on_sel_change();
254      void region_changed();      void region_changed();
255      void dimreg_changed();      void dimreg_changed();
256      void on_loader_progress();      void on_loader_progress();
257      void on_loader_finished();      void on_loader_finished();
258        void dimreg_all_dimregs_toggled();
259        gig::Instrument* get_instrument();
260        void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs);
261        void update_dimregs();
262    
263      class ModelColumns : public Gtk::TreeModel::ColumnRecord {      class ModelColumns : public Gtk::TreeModel::ColumnRecord {
264      public:      public:
# Line 205  protected: Line 305  protected:
305      Gtk::TreeView m_TreeViewSamples;      Gtk::TreeView m_TreeViewSamples;
306      Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel;      Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel;
307    
308        Gtk::VBox dimreg_vbox;
309        Gtk::HBox dimreg_hbox;
310        Gtk::Label dimreg_label;
311        Gtk::CheckButton dimreg_all_regions;
312        Gtk::CheckButton dimreg_all_dimregs;
313        Gtk::CheckButton dimreg_stereo;
314      DimRegionEdit dimreg_edit;      DimRegionEdit dimreg_edit;
315    
316      Gtk::Notebook m_Notebook;      Gtk::Notebook m_Notebook;
# Line 227  protected: Line 333  protected:
333      void on_action_file_properties();      void on_action_file_properties();
334      void on_action_quit();      void on_action_quit();
335      void show_instr_props();      void show_instr_props();
336        void on_action_view_status_bar();
337      void on_action_help_about();      void on_action_help_about();
338    
339      // sample right-click popup actions      // sample right-click popup actions
# Line 234  protected: Line 341  protected:
341      void on_action_sample_properties();      void on_action_sample_properties();
342      void on_action_add_group();      void on_action_add_group();
343      void on_action_add_sample();      void on_action_add_sample();
344        void on_action_replace_all_samples_in_all_groups();
345      void on_action_remove_sample();      void on_action_remove_sample();
346    
347      void on_action_add_instrument();      void on_action_add_instrument();
348        void on_action_duplicate_instrument();
349      void on_action_remove_instrument();      void on_action_remove_instrument();
350    
351      LoadDialog* load_dialog;      LoadDialog* load_dialog;
# Line 248  protected: Line 357  protected:
357      bool file_has_name;      bool file_has_name;
358      bool file_is_changed;      bool file_is_changed;
359      std::string filename;      std::string filename;
360      std::string current_dir;      std::string current_gig_dir;
361        std::string current_sample_dir;
362    
363      void set_file_is_shared(bool);      void set_file_is_shared(bool);
364    

Legend:
Removed from v.1411  
changed lines
  Added in v.2395

  ViewVC Help
Powered by ViewVC