/[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 3109 by schoenebeck, Sun Feb 12 16:35:03 2017 UTC revision 3340 by schoenebeck, Mon Jul 31 11:20:18 2017 UTC
# Line 22  Line 22 
22    
23  #ifdef LIBGIG_HEADER_FILE  #ifdef LIBGIG_HEADER_FILE
24  # include LIBGIG_HEADER_FILE(gig.h)  # include LIBGIG_HEADER_FILE(gig.h)
25    # include LIBGIG_HEADER_FILE(Serialization.h)
26  #else  #else
27  # include <gig.h>  # include <gig.h>
28    # include <Serialization.h>
29  #endif  #endif
30    
31  #include <gtkmm/box.h>  #include <gtkmm/box.h>
# Line 37  Line 39 
39  #include <gtkmm/radiomenuitem.h>  #include <gtkmm/radiomenuitem.h>
40  #include <gtkmm/scrolledwindow.h>  #include <gtkmm/scrolledwindow.h>
41  #include <gtkmm/treestore.h>  #include <gtkmm/treestore.h>
42    #include <gtkmm/treemodelfilter.h>
43  #include <gtkmm/uimanager.h>  #include <gtkmm/uimanager.h>
44  #include <gtkmm/window.h>  #include <gtkmm/window.h>
45  #include <gtkmm/statusbar.h>  #include <gtkmm/statusbar.h>
46  #include <gtkmm/image.h>  #include <gtkmm/image.h>
47    #include <gtkmm/entry.h>
48    
49  #include <sstream>  #include <sstream>
50    
# Line 242  protected: Line 246  protected:
246      InstrumentProps instrumentProps;      InstrumentProps instrumentProps;
247      MidiRules midiRules;      MidiRules midiRules;
248    
249        /**
250         * Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and
251         * MainWindowv::dimreg_changed_signal are always triggered correctly as a
252         * pair. It behaves similar to a "mutex lock guard" design pattern.
253         */
254        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
255        public:
256            DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) :
257            SignalGuard<gig::DimensionRegion*>(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg)
258            {
259            }
260        };
261    
262      sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;      sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;
263      sigc::signal<void, gig::File*> file_structure_changed_signal;      sigc::signal<void, gig::File*> file_structure_changed_signal;
264      sigc::signal<void, std::list<gig::Sample*> > samples_to_be_removed_signal;      sigc::signal<void, std::list<gig::Sample*> > samples_to_be_removed_signal;
# Line 271  protected: Line 288  protected:
288      void on_saver_progress();      void on_saver_progress();
289      void on_saver_error();      void on_saver_error();
290      void on_saver_finished();      void on_saver_finished();
291        void updateMacroMenu();
292        void onMacroSelected(int iMacro);
293        void setupMacros();
294        void onMacrosSetupChanged(const std::vector<Serialization::Archive>& macros);
295        void applyMacro(Serialization::Archive& macro);
296        void onScriptSlotsModified(gig::Instrument* pInstrument);
297        void bringToFront();
298    
299      void dimreg_all_dimregs_toggled();      void dimreg_all_dimregs_toggled();
300      gig::Instrument* get_instrument();      gig::Instrument* get_instrument();
# Line 283  protected: Line 307  protected:
307            add(m_col_nr);            add(m_col_nr);
308            add(m_col_name);            add(m_col_name);
309            add(m_col_instr);            add(m_col_instr);
310              add(m_col_scripts);
311          }          }
312    
313          Gtk::TreeModelColumn<int> m_col_nr;          Gtk::TreeModelColumn<int> m_col_nr;
314          Gtk::TreeModelColumn<Glib::ustring> m_col_name;          Gtk::TreeModelColumn<Glib::ustring> m_col_name;
315          Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;          Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
316            Gtk::TreeModelColumn<Glib::ustring> m_col_scripts;
317      } m_Columns;      } m_Columns;
318    
319      Gtk::VBox m_VBox;      Gtk::VBox m_VBox;
# Line 297  protected: Line 323  protected:
323    
324      Gtk::TreeView m_TreeView;      Gtk::TreeView m_TreeView;
325      Glib::RefPtr<Gtk::ListStore> m_refTreeModel;      Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
326        Glib::RefPtr<Gtk::TreeModelFilter> 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.
327    
328      Gtk::Menu* instrument_menu;      Gtk::Menu* instrument_menu;
329        Gtk::Menu* assign_scripts_menu;
330    
331      std::map<gig::Sample*,int> sample_ref_count;      std::map<gig::Sample*,int> sample_ref_count;
332    
# Line 377  protected: Line 405  protected:
405      Gtk::Label labelSomeLoops;      Gtk::Label labelSomeLoops;
406      DimRegionEdit dimreg_edit;      DimRegionEdit dimreg_edit;
407    
408        Gtk::VBox m_left_vbox;
409      Gtk::Notebook m_TreeViewNotebook;      Gtk::Notebook m_TreeViewNotebook;
410        Gtk::HBox m_searchField;
411        Gtk::Label m_searchLabel;
412        Gtk::Entry m_searchText;
413    
414      struct SampleImportItem {      struct SampleImportItem {
415          gig::Sample*  gig_sample;  // pointer to the gig::Sample to          gig::Sample*  gig_sample;  // pointer to the gig::Sample to
# Line 386  protected: Line 418  protected:
418          Glib::ustring sample_path; // file name of the sample to be          Glib::ustring sample_path; // file name of the sample to be
419                                     // imported                                     // imported
420      };      };
421      std::list<SampleImportItem> m_SampleImportQueue;      std::map<gig::Sample*, SampleImportItem> m_SampleImportQueue;
422    
423    
424      void on_action_file_new();      void on_action_file_new();
# Line 408  protected: Line 440  protected:
440      void on_action_move_root_note_with_region_moved();      void on_action_move_root_note_with_region_moved();
441      void on_action_help_about();      void on_action_help_about();
442    
443        void on_notebook_tab_switched(GtkNotebookPage* page, guint page_num);
444    
445      // sample right-click popup actions      // sample right-click popup actions
446      void on_sample_treeview_button_release(GdkEventButton* button);      void on_sample_treeview_button_release(GdkEventButton* button);
447      void on_action_sample_properties();      void on_action_sample_properties();
# Line 433  protected: Line 467  protected:
467      void show_intruments_tab();      void show_intruments_tab();
468      void show_scripts_tab();      void show_scripts_tab();
469    
470        void select_prev_instrument();
471        void select_next_instrument();
472        void select_instrument_by_dir(int dir);
473    
474        void select_prev_region();
475        void select_next_region();
476    
477        void select_next_dim_rgn_zone();
478        void select_prev_dim_rgn_zone();
479        void select_add_next_dim_rgn_zone();
480        void select_add_prev_dim_rgn_zone();
481        void select_prev_dimension();
482        void select_next_dimension();
483    
484        Serialization::Archive m_serializationArchive; ///< Clipboard content.
485        std::vector<Serialization::Archive> m_macros; ///< User configured list of macros.
486    
487        void copy_selected_dimrgn();
488        void paste_copied_dimrgn();
489        void adjust_clipboard_content();
490        void updateClipboardCopyAvailable();
491        void updateClipboardPasteAvailable();
492        void on_clipboard_owner_change(GdkEventOwnerChange* event);
493        void on_clipboard_get(Gtk::SelectionData& selection_data, guint info);
494        void on_clipboard_clear();
495        void on_clipboard_received(const Gtk::SelectionData& selection_data);
496        void on_clipboard_received_targets(const std::vector<Glib::ustring>& targets);
497    
498      void add_instrument(gig::Instrument* instrument);      void add_instrument(gig::Instrument* instrument);
499      Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,      Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,
500                                                 int position = -1);                                                 int position = -1);
# Line 485  protected: Line 547  protected:
547      void instrument_name_changed(const Gtk::TreeModel::Path& path,      void instrument_name_changed(const Gtk::TreeModel::Path& path,
548                                   const Gtk::TreeModel::iterator& iter);                                   const Gtk::TreeModel::iterator& iter);
549      void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);      void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);
550        bool instrument_row_visible(const Gtk::TreeModel::const_iterator& iter);
551      sigc::connection instrument_name_connection;      sigc::connection instrument_name_connection;
552    
553      void on_action_combine_instruments();      void on_action_combine_instruments();
# Line 501  protected: Line 564  protected:
564      void __import_queued_samples();      void __import_queued_samples();
565      void __clear();      void __clear();
566      void __refreshEntireGUI();      void __refreshEntireGUI();
567        void updateScriptListOfMenu();
568        void assignScript(gig::Script* pScript);
569    
570      bool close_confirmation_dialog();      bool close_confirmation_dialog();
571      bool leaving_shared_mode_dialog();      bool leaving_shared_mode_dialog();

Legend:
Removed from v.3109  
changed lines
  Added in v.3340

  ViewVC Help
Powered by ViewVC