/[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 2610 by schoenebeck, Sun Jun 8 19:09:26 2014 UTC revision 3418 by schoenebeck, Sat Feb 10 11:36:16 2018 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006 - 2014 Andreas Persson   * Copyright (C) 2006 - 2017 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 20  Line 20 
20  #ifndef GIGEDIT_MAINWINDOW_H  #ifndef GIGEDIT_MAINWINDOW_H
21  #define GIGEDIT_MAINWINDOW_H  #define GIGEDIT_MAINWINDOW_H
22    
23  #include <gig.h>  #ifdef LIBGIG_HEADER_FILE
24    # include LIBGIG_HEADER_FILE(gig.h)
25    # include LIBGIG_HEADER_FILE(Serialization.h)
26    #else
27    # include <gig.h>
28    # include <Serialization.h>
29    #endif
30    
31    #include "compat.h"
32    
33  #include <gtkmm/actiongroup.h>  #include <gtkmm/box.h>
34  #include <gtkmm/buttonbox.h>  #include <gtkmm/buttonbox.h>
35  #include <gtkmm/dialog.h>  #include <gtkmm/dialog.h>
36  #include <gtkmm/liststore.h>  #include <gtkmm/liststore.h>
# Line 32  Line 40 
40  #include <gtkmm/radiomenuitem.h>  #include <gtkmm/radiomenuitem.h>
41  #include <gtkmm/scrolledwindow.h>  #include <gtkmm/scrolledwindow.h>
42  #include <gtkmm/treestore.h>  #include <gtkmm/treestore.h>
43  #include <gtkmm/uimanager.h>  #include <gtkmm/treemodelfilter.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    #include <gtkmm/notebook.h>
49    
50    #if USE_GTKMM_BUILDER
51    # include <gtkmm/builder.h>
52    #else
53    # include <gtkmm/uimanager.h> // deprecated in gtkmm >= 3.21.4
54    #endif
55    
56  #include <sstream>  #include <sstream>
57    
# Line 46  Line 62 
62  #ifndef OLD_THREADS  #ifndef OLD_THREADS
63  #include <glibmm/threads.h>  #include <glibmm/threads.h>
64  #endif  #endif
65    #include "ManagedWindow.h"
66    
67  class MainWindow;  class MainWindow;
68    
69  class PropDialog : public Gtk::Window,  class PropDialog : public ManagedWindow,
70                     public PropEditor<DLS::Info> {                     public PropEditor<DLS::Info> {
71  public:  public:
72      PropDialog();      PropDialog();
73      void set_info(DLS::Info* info);      void set_info(DLS::Info* info);
74      void set_file(gig::File* file);      void set_file(gig::File* file);
75    
76        // implementation for abstract methods of interface class "ManagedWindow"
77        virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->filePropsWindowX; }
78        virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->filePropsWindowY; }
79        virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->filePropsWindowW; }
80        virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->filePropsWindowH; }
81    
82  protected:  protected:
83      ChoiceEntry<int> eFileFormat;      ChoiceEntry<int> eFileFormat;
84      StringEntry eName;      StringEntry eName;
# Line 73  protected: Line 97  protected:
97      StringEntry eSourceForm;      StringEntry eSourceForm;
98      StringEntry eCommissioned;      StringEntry eCommissioned;
99      StringEntry eSubject;      StringEntry eSubject;
100      Gtk::VBox vbox;      VBox vbox;
101      Gtk::HButtonBox buttonBox;      HButtonBox buttonBox;
102      Gtk::Button quitButton;      Gtk::Button quitButton;
103      Table table;      Table table;
104    
# Line 83  protected: Line 107  protected:
107      void onFileFormatChanged();      void onFileFormatChanged();
108  };  };
109    
110  class InstrumentProps : public Gtk::Window,  class InstrumentProps : public ManagedWindow,
111                          public PropEditor<gig::Instrument> {                          public PropEditor<gig::Instrument> {
112  public:  public:
113      InstrumentProps();      InstrumentProps();
# Line 93  public: Line 117  public:
117      sigc::signal<void>& signal_name_changed() {      sigc::signal<void>& signal_name_changed() {
118          return sig_name_changed;          return sig_name_changed;
119      }      }
120    
121        // implementation for abstract methods of interface class "ManagedWindow"
122        virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->instrPropsWindowX; }
123        virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->instrPropsWindowY; }
124        virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->instrPropsWindowW; }
125        virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->instrPropsWindowH; }
126    
127  protected:  protected:
128      void set_Name(const gig::String& name);      void set_Name(const gig::String& name);
129      void set_IsDrum(bool value);      void set_IsDrum(bool value);
# Line 100  protected: Line 131  protected:
131      void set_MIDIProgram(uint32_t value);      void set_MIDIProgram(uint32_t value);
132    
133      sigc::signal<void> sig_name_changed;      sigc::signal<void> sig_name_changed;
134      Gtk::VBox vbox;      VBox vbox;
135      Gtk::HButtonBox buttonBox;      HButtonBox buttonBox;
136      Gtk::Button quitButton;      Gtk::Button quitButton;
137      Table table;      Table table;
138      StringEntry eName;      StringEntry eName;
# Line 118  protected: Line 149  protected:
149      NoteEntry eDimensionKeyRangeHigh;      NoteEntry eDimensionKeyRangeHigh;
150  };  };
151    
152  class LoadDialog : public Gtk::Dialog {  class ProgressDialog : public Gtk::Dialog {
153  public:  public:
154      LoadDialog(const Glib::ustring& title, Gtk::Window& parent);      ProgressDialog(const Glib::ustring& title, Gtk::Window& parent);
155      void set_fraction(float fraction) { progressBar.set_fraction(fraction); }      void set_fraction(float fraction) { progressBar.set_fraction(fraction); }
156  protected:  protected:
157      Gtk::ProgressBar progressBar;      Gtk::ProgressBar progressBar;
# Line 131  public: Line 162  public:
162      Loader(const char* filename);      Loader(const char* filename);
163      void launch();      void launch();
164      Glib::Dispatcher& signal_progress();      Glib::Dispatcher& signal_progress();
165      Glib::Dispatcher& signal_finished();      Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.
166        Glib::Dispatcher& signal_error();
167        void progress_callback(float fraction);
168        float get_progress();
169        const Glib::ustring filename;
170        Glib::ustring error_message;
171        gig::File* gig;
172    
173    private:
174        Glib::Threads::Thread* thread;
175        void thread_function();
176        Glib::Dispatcher finished_dispatcher;
177        Glib::Dispatcher progress_dispatcher;
178        Glib::Dispatcher error_dispatcher;
179        Glib::Threads::Mutex progressMutex;
180        float progress;
181    };
182    
183    class Saver : public sigc::trackable {
184    public:
185        Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as"
186        void launch();
187        Glib::Dispatcher& signal_progress();
188        Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.
189        Glib::Dispatcher& signal_error();
190      void progress_callback(float fraction);      void progress_callback(float fraction);
191      float get_progress();      float get_progress();
     const char* filename;  
192      gig::File* gig;      gig::File* gig;
193        const Glib::ustring filename;
194        Glib::ustring error_message;
195    
196  private:  private:
197      Glib::Threads::Thread* thread;      Glib::Threads::Thread* thread;
198      void thread_function();      void thread_function();
199      Glib::Dispatcher finished_dispatcher;      Glib::Dispatcher finished_dispatcher;
200      Glib::Dispatcher progress_dispatcher;      Glib::Dispatcher progress_dispatcher;
201        Glib::Dispatcher error_dispatcher;
202      Glib::Threads::Mutex progressMutex;      Glib::Threads::Mutex progressMutex;
203      float progress;      float progress;
204  };  };
205    
206  class MainWindow : public Gtk::Window {  class MainWindow : public ManagedWindow {
207  public:  public:
208      MainWindow();      MainWindow();
209      virtual ~MainWindow();      virtual ~MainWindow();
# Line 170  public: Line 227  public:
227      sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit();      sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit();
228      sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released();      sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released();
229    
230        sigc::signal<void, gig::Instrument*>& signal_switch_sampler_instrument();
231    
232        sigc::signal<void, gig::Script*> signal_script_to_be_changed;
233        sigc::signal<void, gig::Script*> signal_script_changed;
234    
235        // implementation for abstract methods of interface class "ManagedWindow"
236        virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->mainWindowX; }
237        virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->mainWindowY; }
238        virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->mainWindowW; }
239        virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->mainWindowH; }
240    
241  protected:  protected:
242    #if USE_GTKMM_BUILDER
243        Glib::RefPtr<Gio::SimpleActionGroup> m_actionGroup;
244        Glib::RefPtr<Gtk::Builder> m_uiManager;
245    #else
246      Glib::RefPtr<Gtk::ActionGroup> actionGroup;      Glib::RefPtr<Gtk::ActionGroup> actionGroup;
247      Glib::RefPtr<Gtk::UIManager> uiManager;      Glib::RefPtr<Gtk::UIManager> uiManager;
248    #endif
249    
250    #if USE_GLIB_ACTION
251        Glib::RefPtr<Gio::SimpleAction> m_actionMIDIRules;
252    
253        Glib::RefPtr<Gio::SimpleAction> m_actionCopyDimRgn;
254        Glib::RefPtr<Gio::SimpleAction> m_actionPasteDimRgn;
255        Glib::RefPtr<Gio::SimpleAction> m_actionAdjustClipboard;
256    
257        Glib::RefPtr<Gio::SimpleAction> m_actionSampleProperties;
258        Glib::RefPtr<Gio::SimpleAction> m_actionAddSample;
259        Glib::RefPtr<Gio::SimpleAction> m_actionRemoveSample;
260        Glib::RefPtr<Gio::SimpleAction> m_actionViewSampleRefs;
261        Glib::RefPtr<Gio::SimpleAction> m_actionReplaceSample;
262        Glib::RefPtr<Gio::SimpleAction> m_actionAddSampleGroup;
263    
264        Glib::RefPtr<Gio::SimpleAction> m_actionAddScriptGroup;
265        Glib::RefPtr<Gio::SimpleAction> m_actionAddScript;
266        Glib::RefPtr<Gio::SimpleAction> m_actionEditScript;
267        Glib::RefPtr<Gio::SimpleAction> m_actionRemoveScript;
268    
269        Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleUnity;
270        Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleTune;
271        Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleLoop;
272        Glib::RefPtr<Gio::SimpleAction> m_actionToggleStatusBar;
273        Glib::RefPtr<Gio::SimpleAction> m_actionToggleRestoreWinDim;
274        Glib::RefPtr<Gio::SimpleAction> m_actionToggleSaveWithTempFile;
275        Glib::RefPtr<Gio::SimpleAction> m_actionToggleWarnOnExtensions;
276        Glib::RefPtr<Gio::SimpleAction> m_actionToggleShowTooltips;
277        Glib::RefPtr<Gio::SimpleAction> m_actionToggleSyncSamplerSelection;
278        Glib::RefPtr<Gio::SimpleAction> m_actionToggleMoveRootNoteWithRegion;
279    #endif
280    
281      Gtk::Statusbar m_StatusBar;      Gtk::Statusbar m_StatusBar;
282      Gtk::Label     m_AttachedStateLabel;      Gtk::Label     m_AttachedStateLabel;
# Line 185  protected: Line 289  protected:
289      InstrumentProps instrumentProps;      InstrumentProps instrumentProps;
290      MidiRules midiRules;      MidiRules midiRules;
291    
292        /**
293         * Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and
294         * MainWindowv::dimreg_changed_signal are always triggered correctly as a
295         * pair. It behaves similar to a "mutex lock guard" design pattern.
296         */
297        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
298        public:
299            DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) :
300            SignalGuard<gig::DimensionRegion*>(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg)
301            {
302            }
303        };
304    
305      sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;      sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;
306      sigc::signal<void, gig::File*> file_structure_changed_signal;      sigc::signal<void, gig::File*> file_structure_changed_signal;
307      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 199  protected: Line 316  protected:
316      sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;      sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;
317      sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal;      sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal;
318    
319        sigc::signal<void, gig::Instrument*> switch_sampler_instrument_signal;
320    
321    #if !USE_GTKMM_BUILDER
322      void on_instrument_selection_change(Gtk::RadioMenuItem* item);      void on_instrument_selection_change(Gtk::RadioMenuItem* item);
323    #endif
324      void on_sel_change();      void on_sel_change();
325      void region_changed();      void region_changed();
326      void dimreg_changed();      void dimreg_changed();
327        void select_instrument(gig::Instrument* instrument);
328        bool select_dimension_region(gig::DimensionRegion* dimRgn);
329        void select_sample(gig::Sample* sample);
330      void on_loader_progress();      void on_loader_progress();
331      void on_loader_finished();      void on_loader_finished();
332        void on_loader_error();
333        void on_saver_progress();
334        void on_saver_error();
335        void on_saver_finished();
336        void updateMacroMenu();
337        void onMacroSelected(int iMacro);
338        void setupMacros();
339        void onMacrosSetupChanged(const std::vector<Serialization::Archive>& macros);
340        void applyMacro(Serialization::Archive& macro);
341        void onScriptSlotsModified(gig::Instrument* pInstrument);
342        void bringToFront();
343    
344      void dimreg_all_dimregs_toggled();      void dimreg_all_dimregs_toggled();
345      gig::Instrument* get_instrument();      gig::Instrument* get_instrument();
346      void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs);      void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs);
# Line 213  protected: Line 349  protected:
349      class ModelColumns : public Gtk::TreeModel::ColumnRecord {      class ModelColumns : public Gtk::TreeModel::ColumnRecord {
350      public:      public:
351          ModelColumns() {          ModelColumns() {
352              add(m_col_nr);
353            add(m_col_name);            add(m_col_name);
354            add(m_col_instr);            add(m_col_instr);
355              add(m_col_scripts);
356              add(m_col_tooltip);
357          }          }
358    
359            Gtk::TreeModelColumn<int> m_col_nr;
360          Gtk::TreeModelColumn<Glib::ustring> m_col_name;          Gtk::TreeModelColumn<Glib::ustring> m_col_name;
361          Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;          Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
362            Gtk::TreeModelColumn<Glib::ustring> m_col_scripts;
363            Gtk::TreeModelColumn<Glib::ustring> m_col_tooltip;
364      } m_Columns;      } m_Columns;
365    
366      Gtk::VBox m_VBox;      VBox m_VBox;
367      Gtk::HPaned m_HPaned;      Gtk::HPaned m_HPaned;
368    
369      Gtk::ScrolledWindow m_ScrolledWindow;      Gtk::ScrolledWindow m_ScrolledWindow;
370    
371      Gtk::TreeView m_TreeView;      Gtk::TreeView m_TreeView;
372      Glib::RefPtr<Gtk::ListStore> m_refTreeModel;      Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
373        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.
374    
375    #if USE_GTKMM_BUILDER
376        Gtk::Menu* menuMacro;
377    #else
378        Gtk::Menu* instrument_menu; // kept for GTKMM 2 version only, will be completely removed in future
379    #endif
380        Gtk::Menu* assign_scripts_menu;
381    
382      Gtk::Menu* instrument_menu;      std::map<gig::Sample*,int> sample_ref_count;
383    
384      class SamplesModel : public Gtk::TreeModel::ColumnRecord {      class SamplesModel : public Gtk::TreeModel::ColumnRecord {
385      public:      public:
# Line 237  protected: Line 387  protected:
387              add(m_col_name);              add(m_col_name);
388              add(m_col_sample);              add(m_col_sample);
389              add(m_col_group);              add(m_col_group);
390                add(m_col_refcount);
391                add(m_color);
392          }          }
393    
394          Gtk::TreeModelColumn<Glib::ustring> m_col_name;          Gtk::TreeModelColumn<Glib::ustring> m_col_name;
395          Gtk::TreeModelColumn<gig::Sample*> m_col_sample;          Gtk::TreeModelColumn<gig::Sample*> m_col_sample;
396          Gtk::TreeModelColumn<gig::Group*> m_col_group;          Gtk::TreeModelColumn<gig::Group*> m_col_group;
397            Gtk::TreeModelColumn<Glib::ustring> m_col_refcount;
398            Gtk::TreeModelColumn<Glib::ustring> m_color;
399      } m_SamplesModel;      } m_SamplesModel;
400    
401      class SamplesTreeStore : public Gtk::TreeStore {      class SamplesTreeStore : public Gtk::TreeStore {
# Line 283  protected: Line 437  protected:
437      Gtk::TreeView m_TreeViewScripts;      Gtk::TreeView m_TreeViewScripts;
438      Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel;      Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel;
439    
440      Gtk::VBox dimreg_vbox;      VBox dimreg_vbox;
441      Gtk::HBox dimreg_hbox;      HBox dimreg_hbox;
442      Gtk::Label dimreg_label;      Gtk::Label dimreg_label;
443      Gtk::CheckButton dimreg_all_regions;      Gtk::CheckButton dimreg_all_regions;
444      Gtk::CheckButton dimreg_all_dimregs;      Gtk::CheckButton dimreg_all_dimregs;
445      Gtk::CheckButton dimreg_stereo;      Gtk::CheckButton dimreg_stereo;
446    
447        HBox legend_hbox;
448        Gtk::Label labelLegend;
449        Gtk::Image imageNoSample;
450        Gtk::Label labelNoSample;
451        Gtk::Image imageMissingSample;
452        Gtk::Label labelMissingSample;
453        Gtk::Image imageLooped;
454        Gtk::Label labelLooped;
455        Gtk::Image imageSomeLoops;
456        Gtk::Label labelSomeLoops;
457      DimRegionEdit dimreg_edit;      DimRegionEdit dimreg_edit;
458    
459        VBox m_left_vbox;
460      Gtk::Notebook m_TreeViewNotebook;      Gtk::Notebook m_TreeViewNotebook;
461        HBox m_searchField;
462        Gtk::Label m_searchLabel;
463        Gtk::Entry m_searchText;
464    
465      struct SampleImportItem {      struct SampleImportItem {
466          gig::Sample*  gig_sample;  // pointer to the gig::Sample to          gig::Sample*  gig_sample;  // pointer to the gig::Sample to
# Line 300  protected: Line 469  protected:
469          Glib::ustring sample_path; // file name of the sample to be          Glib::ustring sample_path; // file name of the sample to be
470                                     // imported                                     // imported
471      };      };
472      std::list<SampleImportItem> m_SampleImportQueue;      std::map<gig::Sample*, SampleImportItem> m_SampleImportQueue;
473    
474    
475      void on_action_file_new();      void on_action_file_new();
# Line 314  protected: Line 483  protected:
483      void show_midi_rules();      void show_midi_rules();
484      void show_script_slots();      void show_script_slots();
485      void on_action_view_status_bar();      void on_action_view_status_bar();
486        void on_auto_restore_win_dim();
487        void on_save_with_temporary_file();
488        void on_action_refresh_all();
489      void on_action_warn_user_on_extensions();      void on_action_warn_user_on_extensions();
490        void on_action_show_tooltips();
491        void on_show_tooltips_changed();
492        void on_action_sync_sampler_instrument_selection();
493        void on_action_move_root_note_with_region_moved();
494      void on_action_help_about();      void on_action_help_about();
495    
496        void on_notebook_tab_switched(void* page, guint page_num);
497    
498      // sample right-click popup actions      // sample right-click popup actions
499    #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && (GTKMM_MINOR_VERSION > 91 || (GTKMM_MINOR_VERSION == 91 && GTKMM_MICRO_VERSION >= 2))) // GTKMM >= 3.91.2
500        bool on_sample_treeview_button_release(Gdk::EventButton& button);
501    #else
502      void on_sample_treeview_button_release(GdkEventButton* button);      void on_sample_treeview_button_release(GdkEventButton* button);
503    #endif
504      void on_action_sample_properties();      void on_action_sample_properties();
505      void on_action_add_group();      void on_action_add_group();
506      void on_action_add_sample();      void on_action_add_sample();
507        void on_action_replace_sample();
508      void on_action_replace_all_samples_in_all_groups();      void on_action_replace_all_samples_in_all_groups();
509      void on_action_remove_sample();      void on_action_remove_sample();
510            void on_action_remove_unused_samples();
511    
512      // script right-click popup actions      // script right-click popup actions
513    #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && (GTKMM_MINOR_VERSION > 91 || (GTKMM_MINOR_VERSION == 91 && GTKMM_MICRO_VERSION >= 2))) // GTKMM >= 3.91.2
514        bool on_script_treeview_button_release(Gdk::EventButton& button);
515    #else
516      void on_script_treeview_button_release(GdkEventButton* button);      void on_script_treeview_button_release(GdkEventButton* button);
517    #endif
518      void on_action_add_script_group();      void on_action_add_script_group();
519      void on_action_add_script();      void on_action_add_script();
520      void on_action_edit_script();      void on_action_edit_script();
# Line 336  protected: Line 524  protected:
524      void on_action_duplicate_instrument();      void on_action_duplicate_instrument();
525      void on_action_remove_instrument();      void on_action_remove_instrument();
526    
527        void show_samples_tab();
528        void show_intruments_tab();
529        void show_scripts_tab();
530    
531        void select_prev_instrument();
532        void select_next_instrument();
533        void select_instrument_by_dir(int dir);
534    
535        void select_prev_region();
536        void select_next_region();
537    
538        void select_next_dim_rgn_zone();
539        void select_prev_dim_rgn_zone();
540        void select_add_next_dim_rgn_zone();
541        void select_add_prev_dim_rgn_zone();
542        void select_prev_dimension();
543        void select_next_dimension();
544    
545        Serialization::Archive m_serializationArchive; ///< Clipboard content.
546        std::vector<Serialization::Archive> m_macros; ///< User configured list of macros.
547    
548        void copy_selected_dimrgn();
549        void paste_copied_dimrgn();
550        void adjust_clipboard_content();
551        void updateClipboardCopyAvailable();
552        void updateClipboardPasteAvailable();
553    #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && (GTKMM_MINOR_VERSION > 91 || (GTKMM_MINOR_VERSION == 91 && GTKMM_MICRO_VERSION >= 2))) // GTKMM >= 3.91.2
554        void on_clipboard_owner_change(Gdk::EventOwnerChange& event);
555    #else
556        void on_clipboard_owner_change(GdkEventOwnerChange* event);
557    #endif
558        void on_clipboard_get(Gtk::SelectionData& selection_data, guint info);
559        void on_clipboard_clear();
560        void on_clipboard_received(const Gtk::SelectionData& selection_data);
561        void on_clipboard_received_targets(const std::vector<Glib::ustring>& targets);
562    
563      void add_instrument(gig::Instrument* instrument);      void add_instrument(gig::Instrument* instrument);
564    #if !USE_GTKMM_BUILDER
565      Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,      Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,
566                                                 int position = -1);                                                 int position = -1);
567      void remove_instrument_from_menu(int index);      void remove_instrument_from_menu(int index);
568    #endif
569        bool onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
570    
571      LoadDialog* load_dialog;      ProgressDialog* progress_dialog;
572      Loader* loader;      Loader* loader;
573        Saver* saver;
574      void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false);      void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false);
575        void updateSampleRefCountMap(gig::File* gig);
576    
577      gig::File* file;      gig::File* file;
578      bool file_is_shared;      bool file_is_shared;
# Line 359  protected: Line 588  protected:
588      bool file_save_as();      bool file_save_as();
589      bool check_if_savable();      bool check_if_savable();
590    
591    #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && (GTKMM_MINOR_VERSION > 91 || (GTKMM_MINOR_VERSION == 91 && GTKMM_MICRO_VERSION >= 2))) // GTKMM >= 3.91.2
592        bool on_button_release(Gdk::EventButton& button);
593    #else
594      void on_button_release(GdkEventButton* button);      void on_button_release(GdkEventButton* button);
595    #endif
596        void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
597        void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
598                                                   Gtk::SelectionData& selection_data, guint, guint);
599        void on_instruments_treeview_drop_drag_data_received(
600            const Glib::RefPtr<Gdk::DragContext>& context, int, int,
601            const Gtk::SelectionData& selection_data, guint, guint time
602        );
603      void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);      void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
604      void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,      void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
605                                             Gtk::SelectionData& selection_data, guint, guint);                                             Gtk::SelectionData& selection_data, guint, guint);
# Line 373  protected: Line 613  protected:
613    
614      void script_name_changed(const Gtk::TreeModel::Path& path,      void script_name_changed(const Gtk::TreeModel::Path& path,
615                               const Gtk::TreeModel::iterator& iter);                               const Gtk::TreeModel::iterator& iter);
616        void script_double_clicked(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
617      void sample_name_changed(const Gtk::TreeModel::Path& path,      void sample_name_changed(const Gtk::TreeModel::Path& path,
618                               const Gtk::TreeModel::iterator& iter);                               const Gtk::TreeModel::iterator& iter);
619      void instrument_name_changed(const Gtk::TreeModel::Path& path,      void instrument_name_changed(const Gtk::TreeModel::Path& path,
620                                   const Gtk::TreeModel::iterator& iter);                                   const Gtk::TreeModel::iterator& iter);
621      void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);      void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);
622        bool instrument_row_visible(const Gtk::TreeModel::const_iterator& iter);
623      sigc::connection instrument_name_connection;      sigc::connection instrument_name_connection;
624    
625      void on_action_combine_instruments();      void on_action_combine_instruments();
626        void on_action_view_references();
627      void on_action_merge_files();      void on_action_merge_files();
628      void mergeFiles(const std::vector<std::string>& filenames);      void mergeFiles(const std::vector<std::string>& filenames);
629    
630        void on_sample_ref_changed(gig::Sample* oldSample, gig::Sample* newSample);
631        void on_sample_ref_count_incremented(gig::Sample* sample, int offset);
632        void on_samples_to_be_removed(std::list<gig::Sample*> samples);
633    
634        void add_or_replace_sample(bool replace);
635    
636      void __import_queued_samples();      void __import_queued_samples();
637      void __clear();      void __clear();
638      void __refreshEntireGUI();      void __refreshEntireGUI();
639        void updateScriptListOfMenu();
640        void assignScript(gig::Script* pScript);
641    
642      bool close_confirmation_dialog();      bool close_confirmation_dialog();
643      bool leaving_shared_mode_dialog();      bool leaving_shared_mode_dialog();
644    
645      Gtk::Menu* popup_menu;      Gtk::Menu* popup_menu;
646    #if USE_GTKMM_BUILDER
647        Gtk::Menu* sample_popup;
648        Gtk::Menu* script_popup;
649    #endif
650    
651      bool on_delete_event(GdkEventAny* event);      bool on_delete_event(GdkEventAny* event);
652    

Legend:
Removed from v.2610  
changed lines
  Added in v.3418

  ViewVC Help
Powered by ViewVC