/[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 1660 by schoenebeck, Sun Feb 3 00:19:55 2008 UTC revision 2423 by persson, Sun Feb 24 15:19:39 2013 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006 - 2008 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  class PropDialog : public Gtk::Window,
50  {                     public PropEditor<DLS::Info> {
 public:  
     Table(int x, int y);  
     void add(BoolEntry& boolentry);  
     void add(BoolEntryPlus6& boolentry);  
     void add(LabelWidget& labelwidget);  
 private:  
     int rowno;  
 };  
   
 class PropDialog : public Gtk::Window {  
51  public:  public:
52      PropDialog();      PropDialog();
53      void set_info(DLS::Info* info);      void set_info(DLS::Info* info);
     sigc::signal<void>& signal_info_changed();  
54  protected:  protected:
     sigc::signal<void> info_changed;  
55      StringEntry eName;      StringEntry eName;
56      StringEntry eCreationDate;      StringEntry eCreationDate;
57      StringEntryMultiLine eComments;      StringEntryMultiLine eComments;
# Line 81  protected: Line 72  protected:
72      Gtk::HButtonBox buttonBox;      Gtk::HButtonBox buttonBox;
73      Gtk::Button quitButton;      Gtk::Button quitButton;
74      Table table;      Table table;
     int update_model;  
     DLS::Info* info;  
   
     template<typename T>  
     void set_member(T value, T DLS::Info::* member) {  
         if (update_model == 0) {  
             info->*member = value;  
             info_changed();  
         }  
     }  
   
     template<typename C, typename T>  
     void connect(C& widget, T DLS::Info::* member) {  
         widget.signal_value_changed().connect(  
             sigc::compose(  
                 sigc::bind(sigc::mem_fun(*this, &PropDialog::set_member<T>), member),  
                 sigc::mem_fun(widget, &C::get_value)));  
     }  
75  };  };
76    
77  class InstrumentProps : public Gtk::Window {  class InstrumentProps : public Gtk::Window,
78                            public PropEditor<gig::Instrument> {
79  public:  public:
80      InstrumentProps();      InstrumentProps();
81      void set_instrument(gig::Instrument* instrument);      void set_instrument(gig::Instrument* instrument);
     sigc::signal<void>& signal_instrument_changed();  
82  protected:  protected:
     gig::Instrument* instrument;  
     int update_model;  
   
     template<typename T>  
     void set_value(T value, sigc::slot<void, InstrumentProps*, T> setter) {  
         if (update_model == 0) {  
             setter(this, value);  
             instrument_changed();  
         }  
     }  
   
     template<typename C, typename T>  
     void connect(C& widget, T gig::Instrument::* member) {  
         widget.signal_value_changed().connect(  
             sigc::compose(  
                 sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>),  
                            sigc::bind(sigc::mem_fun(&InstrumentProps::set_member<T>), member)),  
                 sigc::mem_fun(widget, &C::get_value)));  
     }  
   
     template<typename C, typename T>  
     void connect(C& widget, void (InstrumentProps::*setter)(T)) {  
         widget.signal_value_changed().connect(  
             sigc::compose(  
                 sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>),  
                            sigc::mem_fun(setter)),  
                 sigc::mem_fun(widget, &C::get_value)));  
     }  
   
     template<typename T>  
     void set_member(T value, T gig::Instrument::* member) {  
         instrument->*member = value;  
     }  
   
83      void set_IsDrum(bool value);      void set_IsDrum(bool value);
84      void set_MIDIBank(uint16_t value);      void set_MIDIBank(uint16_t value);
85      void set_MIDIProgram(uint32_t value);      void set_MIDIProgram(uint32_t value);
     void set_DimensionKeyRange_low(uint8_t value);  
     void set_DimensionKeyRange_high(uint8_t value);  
86    
87      Gtk::VBox vbox;      Gtk::VBox vbox;
88      Gtk::HButtonBox buttonBox;      Gtk::HButtonBox buttonBox;
# Line 163  protected: Line 100  protected:
100      BoolEntry ePianoReleaseMode;      BoolEntry ePianoReleaseMode;
101      NoteEntry eDimensionKeyRangeLow;      NoteEntry eDimensionKeyRangeLow;
102      NoteEntry eDimensionKeyRangeHigh;      NoteEntry eDimensionKeyRangeHigh;
     sigc::signal<void> instrument_changed;  
103  };  };
104    
105  class LoadDialog : public Gtk::Dialog {  class LoadDialog : public Gtk::Dialog {
# Line 186  public: Line 122  public:
122      gig::File* gig;      gig::File* gig;
123    
124  private:  private:
125      Glib::Thread* thread;      Glib::Threads::Thread* thread;
126      void thread_function();      void thread_function();
127      Glib::Dispatcher finished_dispatcher;      Glib::Dispatcher finished_dispatcher;
128      Glib::Dispatcher progress_dispatcher;      Glib::Dispatcher progress_dispatcher;
129      Glib::Mutex progressMutex;      Glib::Threads::Mutex progressMutex;
130      float progress;      float progress;
131  };  };
132    
# Line 209  public: Line 145  public:
145      sigc::signal<void, gig::Region*>& signal_region_changed();      sigc::signal<void, gig::Region*>& signal_region_changed();
146      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
147      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();      sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
148        sigc::signal<void, gig::Sample*>& signal_sample_changed();
149      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();
150    
151      sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on();      sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on();
# Line 239  protected: Line 176  protected:
176      sigc::signal<void, gig::Region*> region_changed_signal;      sigc::signal<void, gig::Region*> region_changed_signal;
177      sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;
178      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;      sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
179        sigc::signal<void, gig::Sample*> sample_changed_signal;
180      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;
181    
182      sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;      sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;
# Line 308  protected: Line 246  protected:
246      Gtk::CheckButton dimreg_stereo;      Gtk::CheckButton dimreg_stereo;
247      DimRegionEdit dimreg_edit;      DimRegionEdit dimreg_edit;
248    
     Gtk::Notebook m_Notebook;  
249      Gtk::Notebook m_TreeViewNotebook;      Gtk::Notebook m_TreeViewNotebook;
250    
251      struct SampleImportItem {      struct SampleImportItem {
# Line 336  protected: Line 273  protected:
273      void on_action_sample_properties();      void on_action_sample_properties();
274      void on_action_add_group();      void on_action_add_group();
275      void on_action_add_sample();      void on_action_add_sample();
276        void on_action_replace_all_samples_in_all_groups();
277      void on_action_remove_sample();      void on_action_remove_sample();
278    
279      void on_action_add_instrument();      void on_action_add_instrument();
280        void on_action_duplicate_instrument();
281      void on_action_remove_instrument();      void on_action_remove_instrument();
282    
283      LoadDialog* load_dialog;      LoadDialog* load_dialog;
# Line 350  protected: Line 289  protected:
289      bool file_has_name;      bool file_has_name;
290      bool file_is_changed;      bool file_is_changed;
291      std::string filename;      std::string filename;
292      std::string current_dir;      std::string current_gig_dir;
293        std::string current_sample_dir;
294    
295      void set_file_is_shared(bool);      void set_file_is_shared(bool);
296    

Legend:
Removed from v.1660  
changed lines
  Added in v.2423

  ViewVC Help
Powered by ViewVC