--- gigedit/trunk/src/gigedit/mainwindow.h 2016/05/03 14:08:34 2903 +++ gigedit/trunk/src/gigedit/mainwindow.h 2017/07/31 11:35:30 3343 @@ -1,5 +1,5 @@ /* -*- c++ -*- - * Copyright (C) 2006 - 2016 Andreas Persson + * Copyright (C) 2006 - 2017 Andreas Persson * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,7 +20,13 @@ #ifndef GIGEDIT_MAINWINDOW_H #define GIGEDIT_MAINWINDOW_H -#include +#ifdef LIBGIG_HEADER_FILE +# include LIBGIG_HEADER_FILE(gig.h) +# include LIBGIG_HEADER_FILE(Serialization.h) +#else +# include +# include +#endif #include #include @@ -33,10 +39,14 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include #include @@ -238,6 +248,19 @@ InstrumentProps instrumentProps; MidiRules midiRules; + /** + * Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and + * MainWindowv::dimreg_changed_signal are always triggered correctly as a + * pair. It behaves similar to a "mutex lock guard" design pattern. + */ + class DimRegionChangeGuard : public SignalGuard { + public: + DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) : + SignalGuard(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg) + { + } + }; + sigc::signal file_structure_to_be_changed_signal; sigc::signal file_structure_changed_signal; sigc::signal > samples_to_be_removed_signal; @@ -267,6 +290,13 @@ void on_saver_progress(); void on_saver_error(); void on_saver_finished(); + void updateMacroMenu(); + void onMacroSelected(int iMacro); + void setupMacros(); + void onMacrosSetupChanged(const std::vector& macros); + void applyMacro(Serialization::Archive& macro); + void onScriptSlotsModified(gig::Instrument* pInstrument); + void bringToFront(); void dimreg_all_dimregs_toggled(); gig::Instrument* get_instrument(); @@ -276,12 +306,16 @@ class ModelColumns : public Gtk::TreeModel::ColumnRecord { public: ModelColumns() { + add(m_col_nr); add(m_col_name); add(m_col_instr); + add(m_col_scripts); } + Gtk::TreeModelColumn m_col_nr; Gtk::TreeModelColumn m_col_name; Gtk::TreeModelColumn m_col_instr; + Gtk::TreeModelColumn m_col_scripts; } m_Columns; Gtk::VBox m_VBox; @@ -291,8 +325,10 @@ Gtk::TreeView m_TreeView; Glib::RefPtr m_refTreeModel; + Glib::RefPtr m_refTreeModelFilter; //FIXME: I really would love to get rid of TreeModelFilter, because it causes behavior conflicts with get_model() all over the place (see the respective comments regarding get_model()), however I found no other way to filter a treeview effectively. Gtk::Menu* instrument_menu; + Gtk::Menu* assign_scripts_menu; std::map sample_ref_count; @@ -358,9 +394,24 @@ Gtk::CheckButton dimreg_all_regions; Gtk::CheckButton dimreg_all_dimregs; Gtk::CheckButton dimreg_stereo; + + Gtk::HBox legend_hbox; + Gtk::Label labelLegend; + Gtk::Image imageNoSample; + Gtk::Label labelNoSample; + Gtk::Image imageMissingSample; + Gtk::Label labelMissingSample; + Gtk::Image imageLooped; + Gtk::Label labelLooped; + Gtk::Image imageSomeLoops; + Gtk::Label labelSomeLoops; DimRegionEdit dimreg_edit; + Gtk::VBox m_left_vbox; Gtk::Notebook m_TreeViewNotebook; + Gtk::HBox m_searchField; + Gtk::Label m_searchLabel; + Gtk::Entry m_searchText; struct SampleImportItem { gig::Sample* gig_sample; // pointer to the gig::Sample to @@ -369,7 +420,7 @@ Glib::ustring sample_path; // file name of the sample to be // imported }; - std::list m_SampleImportQueue; + std::map m_SampleImportQueue; void on_action_file_new(); @@ -383,12 +434,16 @@ void show_midi_rules(); void show_script_slots(); void on_action_view_status_bar(); + void on_auto_restore_win_dim(); + void on_save_with_temporary_file(); void on_action_refresh_all(); void on_action_warn_user_on_extensions(); void on_action_sync_sampler_instrument_selection(); void on_action_move_root_note_with_region_moved(); void on_action_help_about(); + void on_notebook_tab_switched(GtkNotebookPage* page, guint page_num); + // sample right-click popup actions void on_sample_treeview_button_release(GdkEventButton* button); void on_action_sample_properties(); @@ -414,6 +469,34 @@ void show_intruments_tab(); void show_scripts_tab(); + void select_prev_instrument(); + void select_next_instrument(); + void select_instrument_by_dir(int dir); + + void select_prev_region(); + void select_next_region(); + + void select_next_dim_rgn_zone(); + void select_prev_dim_rgn_zone(); + void select_add_next_dim_rgn_zone(); + void select_add_prev_dim_rgn_zone(); + void select_prev_dimension(); + void select_next_dimension(); + + Serialization::Archive m_serializationArchive; ///< Clipboard content. + std::vector m_macros; ///< User configured list of macros. + + void copy_selected_dimrgn(); + void paste_copied_dimrgn(); + void adjust_clipboard_content(); + void updateClipboardCopyAvailable(); + void updateClipboardPasteAvailable(); + void on_clipboard_owner_change(GdkEventOwnerChange* event); + void on_clipboard_get(Gtk::SelectionData& selection_data, guint info); + void on_clipboard_clear(); + void on_clipboard_received(const Gtk::SelectionData& selection_data); + void on_clipboard_received_targets(const std::vector& targets); + void add_instrument(gig::Instrument* instrument); Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name, int position = -1); @@ -466,6 +549,7 @@ void instrument_name_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter); void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it); + bool instrument_row_visible(const Gtk::TreeModel::const_iterator& iter); sigc::connection instrument_name_connection; void on_action_combine_instruments(); @@ -482,6 +566,8 @@ void __import_queued_samples(); void __clear(); void __refreshEntireGUI(); + void updateScriptListOfMenu(); + void assignScript(gig::Script* pScript); bool close_confirmation_dialog(); bool leaving_shared_mode_dialog();