--- gigedit/trunk/src/gigedit/mainwindow.h 2007/09/04 11:04:56 1322 +++ gigedit/trunk/src/gigedit/mainwindow.h 2007/12/01 10:21:07 1533 @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include @@ -55,8 +57,48 @@ public: InstrumentProps(); void set_instrument(gig::Instrument* instrument); - sigc::signal signal_instrument_changed(); + sigc::signal& signal_instrument_changed(); protected: + gig::Instrument* instrument; + int update_model; + + template + void set_value(T value, sigc::slot setter) { + if (update_model == 0) { + setter(this, value); + instrument_changed(); + } + } + + template + void connect(C& widget, T gig::Instrument::* member) { + widget.signal_value_changed().connect( + sigc::compose( + sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value), + sigc::bind(sigc::mem_fun(&InstrumentProps::set_member), member)), + sigc::mem_fun(widget, &C::get_value))); + } + + template + void connect(C& widget, void (InstrumentProps::*setter)(T)) { + widget.signal_value_changed().connect( + sigc::compose( + sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value), + sigc::mem_fun(setter)), + sigc::mem_fun(widget, &C::get_value))); + } + + template + void set_member(T value, T gig::Instrument::* member) { + instrument->*member = value; + } + + void set_IsDrum(bool value); + void set_MIDIBank(uint16_t value); + void set_MIDIProgram(uint32_t value); + void set_DimensionKeyRange_low(uint8_t value); + void set_DimensionKeyRange_high(uint8_t value); + Gtk::VBox vbox; Gtk::HButtonBox buttonBox; Gtk::Button quitButton; @@ -77,8 +119,6 @@ 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(); sigc::signal instrument_changed; }; @@ -117,20 +157,24 @@ void load_file(const char* name); void load_instrument(gig::Instrument* instr); void file_changed(); - sigc::signal signal_file_structure_to_be_changed(); - sigc::signal signal_file_structure_changed(); - sigc::signal > signal_samples_to_be_removed(); - sigc::signal signal_samples_removed(); - sigc::signal signal_region_to_be_changed(); - sigc::signal signal_region_changed(); - sigc::signal signal_dimreg_to_be_changed(); - sigc::signal signal_dimreg_changed(); - sigc::signal signal_sample_ref_changed(); + sigc::signal& signal_file_structure_to_be_changed(); + sigc::signal& signal_file_structure_changed(); + sigc::signal >& signal_samples_to_be_removed(); + sigc::signal& signal_samples_removed(); + sigc::signal& signal_region_to_be_changed(); + sigc::signal& signal_region_changed(); + sigc::signal& signal_dimreg_to_be_changed(); + sigc::signal& signal_dimreg_changed(); + sigc::signal& signal_sample_ref_changed(); protected: Glib::RefPtr actionGroup; Glib::RefPtr uiManager; + Gtk::Statusbar m_StatusBar; + Gtk::Label m_AttachedStateLabel; + Gtk::Image m_AttachedStateImage; + RegionChooser m_RegionChooser; DimRegionChooser m_DimRegionChooser; @@ -153,6 +197,10 @@ void dimreg_changed(); void on_loader_progress(); void on_loader_finished(); + void dimreg_all_dimregs_toggled(); + gig::Instrument* get_instrument(); + void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs); + void update_dimregs(); class ModelColumns : public Gtk::TreeModel::ColumnRecord { public: @@ -199,6 +247,12 @@ Gtk::TreeView m_TreeViewSamples; Glib::RefPtr m_refSamplesTreeModel; + Gtk::VBox dimreg_vbox; + Gtk::HBox dimreg_hbox; + Gtk::Label dimreg_label; + Gtk::CheckButton dimreg_all_regions; + Gtk::CheckButton dimreg_all_dimregs; + Gtk::CheckButton dimreg_stereo; DimRegionEdit dimreg_edit; Gtk::Notebook m_Notebook; @@ -221,6 +275,7 @@ void on_action_file_properties(); void on_action_quit(); void show_instr_props(); + void on_action_view_status_bar(); void on_action_help_about(); // sample right-click popup actions @@ -235,14 +290,17 @@ LoadDialog* load_dialog; Loader* loader; - void load_gig(gig::File* gig, const char* filename); + void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false); gig::File* file; + bool file_is_shared; bool file_has_name; bool file_is_changed; std::string filename; std::string current_dir; + void set_file_is_shared(bool); + bool file_save(); bool file_save_as(); bool check_if_savable(); @@ -265,6 +323,7 @@ void __clear(); bool close_confirmation_dialog(); + bool leaving_shared_mode_dialog(); Gtk::Menu* popup_menu;