--- gigedit/trunk/src/gigedit/mainwindow.h 2014/05/14 19:57:56 2553 +++ gigedit/trunk/src/gigedit/mainwindow.h 2014/06/11 16:46:27 2621 @@ -54,7 +54,9 @@ public: PropDialog(); void set_info(DLS::Info* info); + void set_file(gig::File* file); protected: + ChoiceEntry eFileFormat; StringEntry eName; StringEntry eCreationDate; StringEntryMultiLine eComments; @@ -75,6 +77,10 @@ Gtk::HButtonBox buttonBox; Gtk::Button quitButton; Table table; + + gig::File* m_file; + + void onFileFormatChanged(); }; class InstrumentProps : public Gtk::Window, @@ -225,17 +231,23 @@ Gtk::Menu* instrument_menu; + std::map sample_ref_count; + class SamplesModel : public Gtk::TreeModel::ColumnRecord { public: SamplesModel() { add(m_col_name); add(m_col_sample); add(m_col_group); + add(m_col_refcount); + add(m_color); } Gtk::TreeModelColumn m_col_name; Gtk::TreeModelColumn m_col_sample; Gtk::TreeModelColumn m_col_group; + Gtk::TreeModelColumn m_col_refcount; + Gtk::TreeModelColumn m_color; } m_SamplesModel; class SamplesTreeStore : public Gtk::TreeStore { @@ -251,6 +263,32 @@ Gtk::TreeView m_TreeViewSamples; Glib::RefPtr m_refSamplesTreeModel; + class ScriptsModel : public Gtk::TreeModel::ColumnRecord { + public: + ScriptsModel() { + add(m_col_name); + add(m_col_script); + add(m_col_group); + } + + Gtk::TreeModelColumn m_col_name; + Gtk::TreeModelColumn m_col_script; + Gtk::TreeModelColumn m_col_group; + } m_ScriptsModel; + + class ScriptsTreeStore : public Gtk::TreeStore { + public: + static Glib::RefPtr create(const ScriptsModel& columns) { + return Glib::RefPtr( new ScriptsTreeStore(columns) ); + } + protected: + ScriptsTreeStore(const ScriptsModel& columns) : Gtk::TreeStore(columns) {} + }; + + Gtk::ScrolledWindow m_ScrolledWindowScripts; + Gtk::TreeView m_TreeViewScripts; + Glib::RefPtr m_refScriptsTreeModel; + Gtk::VBox dimreg_vbox; Gtk::HBox dimreg_hbox; Gtk::Label dimreg_label; @@ -280,6 +318,7 @@ void show_instr_props(); bool instr_props_set_instrument(); void show_midi_rules(); + void show_script_slots(); void on_action_view_status_bar(); void on_action_warn_user_on_extensions(); void on_action_help_about(); @@ -291,6 +330,13 @@ void on_action_add_sample(); void on_action_replace_all_samples_in_all_groups(); void on_action_remove_sample(); + + // script right-click popup actions + void on_script_treeview_button_release(GdkEventButton* button); + void on_action_add_script_group(); + void on_action_add_script(); + void on_action_edit_script(); + void on_action_remove_script(); void on_action_add_instrument(); void on_action_duplicate_instrument(); @@ -304,6 +350,7 @@ LoadDialog* load_dialog; Loader* loader; void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false); + void updateSampleRefCountMap(gig::File* gig); gig::File* file; bool file_is_shared; @@ -320,6 +367,9 @@ bool check_if_savable(); void on_button_release(GdkEventButton* button); + void on_scripts_treeview_drag_begin(const Glib::RefPtr& context); + void on_scripts_treeview_drag_data_get(const Glib::RefPtr&, + Gtk::SelectionData& selection_data, guint, guint); void on_sample_treeview_drag_begin(const Glib::RefPtr& context); void on_sample_treeview_drag_data_get(const Glib::RefPtr&, Gtk::SelectionData& selection_data, guint, guint); @@ -328,6 +378,8 @@ const Gtk::SelectionData& selection_data, guint, guint time); + void script_name_changed(const Gtk::TreeModel::Path& path, + const Gtk::TreeModel::iterator& iter); void sample_name_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter); void instrument_name_changed(const Gtk::TreeModel::Path& path, @@ -339,6 +391,10 @@ void on_action_merge_files(); void mergeFiles(const std::vector& filenames); + void on_sample_ref_changed(gig::Sample* oldSample, gig::Sample* newSample); + void on_sample_ref_count_incremented(gig::Sample* sample, int offset); + void on_samples_to_be_removed(std::list samples); + void __import_queued_samples(); void __clear(); void __refreshEntireGUI();