/[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 3068 by schoenebeck, Mon Jan 2 22:13:01 2017 UTC revision 3643 by schoenebeck, Sat Dec 7 15:04:51 2019 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006 - 2017 Andreas Persson   * Copyright (C) 2006 - 2019 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 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 "compat.h"
32    
33  #include <gtkmm/box.h>  #include <gtkmm/box.h>
 #include <gtkmm/actiongroup.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 37  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 48  Line 59 
59  #include "dimregionchooser.h"  #include "dimregionchooser.h"
60  #include "dimregionedit.h"  #include "dimregionedit.h"
61  #include "midirules.h"  #include "midirules.h"
62    #ifdef GLIB_THREADS
63  #ifndef OLD_THREADS  #ifndef OLD_THREADS
64  #include <glibmm/threads.h>  #include <glibmm/threads.h>
65  #endif  #endif
66    #else
67    #include <thread>
68    #include <mutex>
69    #endif
70  #include "ManagedWindow.h"  #include "ManagedWindow.h"
71    
72  class MainWindow;  class MainWindow;
73    
74  class PropDialog : public ManagedWindow,  class FilePropDialog : public ManagedWindow,
75                     public PropEditor<DLS::Info> {                         public PropEditor<DLS::Info> {
76  public:  public:
77      PropDialog();      FilePropDialog();
     void set_info(DLS::Info* info);  
78      void set_file(gig::File* file);      void set_file(gig::File* file);
79    
80      // implementation for abstract methods of interface class "ManagedWindow"      // implementation for abstract methods of interface class "ManagedWindow"
# Line 86  protected: Line 101  protected:
101      StringEntry eSourceForm;      StringEntry eSourceForm;
102      StringEntry eCommissioned;      StringEntry eCommissioned;
103      StringEntry eSubject;      StringEntry eSubject;
104      Gtk::VBox vbox;      VBox vbox;
105      Gtk::HButtonBox buttonBox;      HButtonBox buttonBox;
106      Gtk::Button quitButton;      Gtk::Button quitButton;
107      Table table;      Table table;
108    
109      gig::File* m_file;      gig::File* m_file;
110    
111      void onFileFormatChanged();      void set_FileFormat(int value);
112  };  };
113    
114  class InstrumentProps : public ManagedWindow,  class InstrumentProps : public ManagedWindow,
# Line 120  protected: Line 135  protected:
135      void set_MIDIProgram(uint32_t value);      void set_MIDIProgram(uint32_t value);
136    
137      sigc::signal<void> sig_name_changed;      sigc::signal<void> sig_name_changed;
138      Gtk::VBox vbox;      Gtk::Notebook tabs;
139      Gtk::HButtonBox buttonBox;      VBox vbox[3];
140        HButtonBox buttonBox;
141      Gtk::Button quitButton;      Gtk::Button quitButton;
142    
143        // tab 1
144      Table table;      Table table;
145      StringEntry eName;      StringEntry eName;
146      BoolEntry eIsDrum;      BoolEntry eIsDrum;
147      NumEntryTemp<uint16_t> eMIDIBank;      NumEntryTemp<uint16_t> eMIDIBank;
148      NumEntryTemp<uint32_t> eMIDIProgram;      NumEntryTemp<uint32_t> eMIDIProgram;
149      NumEntryGain eAttenuation;      NumEntryGain eAttenuation;
     BoolEntryPlus6 eGainPlus6;  
150      NumEntryTemp<uint16_t> eEffectSend;      NumEntryTemp<uint16_t> eEffectSend;
151      NumEntryTemp<int16_t> eFineTune;      NumEntryTemp<int16_t> eFineTune;
152      NumEntryTemp<uint16_t> ePitchbendRange;      NumEntryTemp<uint16_t> ePitchbendRange;
153      BoolEntry ePianoReleaseMode;      BoolEntry ePianoReleaseMode;
154      NoteEntry eDimensionKeyRangeLow;      NoteEntry eDimensionKeyRangeLow;
155      NoteEntry eDimensionKeyRangeHigh;      NoteEntry eDimensionKeyRangeHigh;
156    
157        // tab 2
158        Table table2;
159        StringEntry eName2;
160        StringEntry eCreationDate;
161        StringEntryMultiLine eComments;
162        StringEntry eProduct;
163        StringEntry eCopyright;
164        StringEntry eArtists;
165        StringEntry eGenre;
166        StringEntry eKeywords;
167        StringEntry eEngineer;
168        StringEntry eTechnician;
169        StringEntry eSoftware;
170        StringEntry eMedium;
171        StringEntry eSource;
172        StringEntry eSourceForm;
173        StringEntry eCommissioned;
174        StringEntry eSubject;
175    };
176    
177    class SampleProps : public ManagedWindow,
178                        public PropEditor<gig::Sample> {
179    public:
180        SampleProps();
181        void set_sample(gig::Sample* sample);
182        gig::Sample* get_sample() { return m; }
183        void update_name();
184        sigc::signal<void>& signal_name_changed() {
185            return sig_name_changed;
186        }
187    
188        // implementation for abstract methods of interface class "ManagedWindow"
189        virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->samplePropsWindowX; }
190        virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->samplePropsWindowY; }
191        virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->samplePropsWindowW; }
192        virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->samplePropsWindowH; }
193    
194    protected:
195        void set_Name(const gig::String& name);
196    
197        sigc::signal<void> sig_name_changed;
198        Gtk::Notebook tabs;
199        VBox vbox[3];
200        HButtonBox buttonBox;
201        Gtk::Button quitButton;
202    
203        // tab 1
204        Table table;
205        StringEntry eName;
206        NoteEntry eUnityNote;
207        ReadOnlyLabelWidget eSampleGroup;
208        ReadOnlyLabelWidget eSampleFormatInfo;
209        ReadOnlyLabelWidget eSampleID;
210        ReadOnlyLabelWidget eChecksum;
211        NumEntryTemp<uint32_t> eLoopsCount;
212        NumEntryTemp<uint32_t> eLoopStart;
213        NumEntryTemp<uint32_t> eLoopLength;
214        ChoiceEntry<gig::loop_type_t> eLoopType;
215        NumEntryTemp<uint32_t> eLoopPlayCount;
216        // tab 2
217        Table table2;
218        StringEntry eName2;
219        StringEntry eCreationDate;
220        StringEntryMultiLine eComments;
221        StringEntry eProduct;
222        StringEntry eCopyright;
223        StringEntry eArtists;
224        StringEntry eGenre;
225        StringEntry eKeywords;
226        StringEntry eEngineer;
227        StringEntry eTechnician;
228        StringEntry eSoftware;
229        StringEntry eMedium;
230        StringEntry eSource;
231        StringEntry eSourceForm;
232        StringEntry eCommissioned;
233        StringEntry eSubject;
234  };  };
235    
236  class ProgressDialog : public Gtk::Dialog {  class ProgressDialog : public Gtk::Dialog {
# Line 146  protected: Line 241  protected:
241      Gtk::ProgressBar progressBar;      Gtk::ProgressBar progressBar;
242  };  };
243    
244  class Loader : public sigc::trackable {  class LoaderSaverBase {
245  public:  public:
     Loader(const char* filename);  
246      void launch();      void launch();
247      Glib::Dispatcher& signal_progress();      Glib::Dispatcher& signal_progress();
248      Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.      Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.
249      Glib::Dispatcher& signal_error();      Glib::Dispatcher& signal_error();
250      void progress_callback(float fraction);      void progress_callback(float fraction);
251      float get_progress();      float get_progress();
252        void join();
253      const Glib::ustring filename;      const Glib::ustring filename;
254      Glib::ustring error_message;      Glib::ustring error_message;
255      gig::File* gig;      gig::File* gig;
256    
257    protected:
258        LoaderSaverBase(const Glib::ustring filename, gig::File* gig);
259    
260  private:  private:
261    #ifdef GLIB_THREADS
262      Glib::Threads::Thread* thread;      Glib::Threads::Thread* thread;
263        Glib::Threads::Mutex progressMutex;
264    #else
265        std::thread thread;
266        std::mutex progressMutex;
267    #endif
268      void thread_function();      void thread_function();
269        virtual void thread_function_sub(gig::progress_t& progress) = 0;
270      Glib::Dispatcher finished_dispatcher;      Glib::Dispatcher finished_dispatcher;
271      Glib::Dispatcher progress_dispatcher;      Glib::Dispatcher progress_dispatcher;
272      Glib::Dispatcher error_dispatcher;      Glib::Dispatcher error_dispatcher;
     Glib::Threads::Mutex progressMutex;  
273      float progress;      float progress;
274  };  };
275    
276  class Saver : public sigc::trackable {  class Loader : public LoaderSaverBase {
277    public:
278        Loader(const char* filename);
279    
280    private:
281        void thread_function_sub(gig::progress_t& progress);
282    };
283    
284    class Saver : public LoaderSaverBase {
285  public:  public:
286      Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as"      Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as"
     void launch();  
     Glib::Dispatcher& signal_progress();  
     Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.  
     Glib::Dispatcher& signal_error();  
     void progress_callback(float fraction);  
     float get_progress();  
     gig::File* gig;  
     const Glib::ustring filename;  
     Glib::ustring error_message;  
287    
288  private:  private:
289      Glib::Threads::Thread* thread;      void thread_function_sub(gig::progress_t& progress);
     void thread_function();  
     Glib::Dispatcher finished_dispatcher;  
     Glib::Dispatcher progress_dispatcher;  
     Glib::Dispatcher error_dispatcher;  
     Glib::Threads::Mutex progressMutex;  
     float progress;  
290  };  };
291    
292  class MainWindow : public ManagedWindow {  class MainWindow : public ManagedWindow {
# Line 228  public: Line 325  public:
325      virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->mainWindowH; }      virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->mainWindowH; }
326    
327  protected:  protected:
328    #if USE_GTKMM_BUILDER
329        Glib::RefPtr<Gio::SimpleActionGroup> m_actionGroup;
330        Glib::RefPtr<Gtk::Builder> m_uiManager;
331    #else
332      Glib::RefPtr<Gtk::ActionGroup> actionGroup;      Glib::RefPtr<Gtk::ActionGroup> actionGroup;
333      Glib::RefPtr<Gtk::UIManager> uiManager;      Glib::RefPtr<Gtk::UIManager> uiManager;
334    #endif
335    
336    #if USE_GLIB_ACTION
337        Glib::RefPtr<Gio::SimpleAction> m_actionMIDIRules;
338    
339        Glib::RefPtr<Gio::SimpleAction> m_actionCopyDimRgn;
340        Glib::RefPtr<Gio::SimpleAction> m_actionPasteDimRgn;
341        Glib::RefPtr<Gio::SimpleAction> m_actionAdjustClipboard;
342    
343        Glib::RefPtr<Gio::SimpleAction> m_actionSampleProperties;
344        Glib::RefPtr<Gio::SimpleAction> m_actionAddSample;
345        Glib::RefPtr<Gio::SimpleAction> m_actionRemoveSample;
346        Glib::RefPtr<Gio::SimpleAction> m_actionViewSampleRefs;
347        Glib::RefPtr<Gio::SimpleAction> m_actionReplaceSample;
348        Glib::RefPtr<Gio::SimpleAction> m_actionAddSampleGroup;
349    
350        Glib::RefPtr<Gio::SimpleAction> m_actionAddScriptGroup;
351        Glib::RefPtr<Gio::SimpleAction> m_actionAddScript;
352        Glib::RefPtr<Gio::SimpleAction> m_actionEditScript;
353        Glib::RefPtr<Gio::SimpleAction> m_actionRemoveScript;
354    
355        Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleUnity;
356        Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleTune;
357        Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleLoop;
358        Glib::RefPtr<Gio::SimpleAction> m_actionToggleStatusBar;
359        Glib::RefPtr<Gio::SimpleAction> m_actionToggleRestoreWinDim;
360        Glib::RefPtr<Gio::SimpleAction> m_actionToggleSaveWithTempFile;
361        Glib::RefPtr<Gio::SimpleAction> m_actionToggleWarnOnExtensions;
362        Glib::RefPtr<Gio::SimpleAction> m_actionToggleShowTooltips;
363        Glib::RefPtr<Gio::SimpleAction> m_actionToggleSyncSamplerSelection;
364        Glib::RefPtr<Gio::SimpleAction> m_actionToggleMoveRootNoteWithRegion;
365    #endif
366    
367      Gtk::Statusbar m_StatusBar;      Gtk::Statusbar m_StatusBar;
368      Gtk::Label     m_AttachedStateLabel;      Gtk::Label     m_AttachedStateLabel;
# Line 238  protected: Line 371  protected:
371      RegionChooser m_RegionChooser;      RegionChooser m_RegionChooser;
372      DimRegionChooser m_DimRegionChooser;      DimRegionChooser m_DimRegionChooser;
373    
374      PropDialog propDialog;      FilePropDialog fileProps;
375      InstrumentProps instrumentProps;      InstrumentProps instrumentProps;
376        SampleProps sampleProps;
377      MidiRules midiRules;      MidiRules midiRules;
378    
379        /**
380         * Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and
381         * MainWindowv::dimreg_changed_signal are always triggered correctly as a
382         * pair. It behaves similar to a "mutex lock guard" design pattern.
383         */
384        class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
385        public:
386            DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) :
387            SignalGuard<gig::DimensionRegion*>(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg)
388            {
389            }
390        };
391    
392      sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;      sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;
393      sigc::signal<void, gig::File*> file_structure_changed_signal;      sigc::signal<void, gig::File*> file_structure_changed_signal;
394      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 258  protected: Line 405  protected:
405    
406      sigc::signal<void, gig::Instrument*> switch_sampler_instrument_signal;      sigc::signal<void, gig::Instrument*> switch_sampler_instrument_signal;
407    
408    #if !USE_GTKMM_BUILDER
409      void on_instrument_selection_change(Gtk::RadioMenuItem* item);      void on_instrument_selection_change(Gtk::RadioMenuItem* item);
410    #endif
411      void on_sel_change();      void on_sel_change();
412      void region_changed();      void region_changed();
413      void dimreg_changed();      void dimreg_changed();
# Line 271  protected: Line 420  protected:
420      void on_saver_progress();      void on_saver_progress();
421      void on_saver_error();      void on_saver_error();
422      void on_saver_finished();      void on_saver_finished();
423        void updateMacroMenu();
424        void onMacroSelected(int iMacro);
425        void setupMacros();
426        void onMacrosSetupChanged(const std::vector<Serialization::Archive>& macros);
427        void applyMacro(Serialization::Archive& macro);
428        void onScriptSlotsModified(gig::Instrument* pInstrument);
429        void bringToFront();
430    
431      void dimreg_all_dimregs_toggled();      void dimreg_all_dimregs_toggled();
432      gig::Instrument* get_instrument();      gig::Instrument* get_instrument();
# Line 283  protected: Line 439  protected:
439            add(m_col_nr);            add(m_col_nr);
440            add(m_col_name);            add(m_col_name);
441            add(m_col_instr);            add(m_col_instr);
442              add(m_col_scripts);
443              add(m_col_tooltip);
444          }          }
445    
446          Gtk::TreeModelColumn<int> m_col_nr;          Gtk::TreeModelColumn<int> m_col_nr;
447          Gtk::TreeModelColumn<Glib::ustring> m_col_name;          Gtk::TreeModelColumn<Glib::ustring> m_col_name;
448          Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;          Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
449            Gtk::TreeModelColumn<Glib::ustring> m_col_scripts;
450            Gtk::TreeModelColumn<Glib::ustring> m_col_tooltip;
451      } m_Columns;      } m_Columns;
452    
453      Gtk::VBox m_VBox;      VBox m_VBox;
454      Gtk::HPaned m_HPaned;      Gtk::HPaned m_HPaned;
455    
456      Gtk::ScrolledWindow m_ScrolledWindow;      Gtk::ScrolledWindow m_ScrolledWindow;
457    
458      Gtk::TreeView m_TreeView;      Gtk::TreeView m_TreeView;
459      Glib::RefPtr<Gtk::ListStore> m_refTreeModel;      Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
460        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.
461    
462      Gtk::Menu* instrument_menu;  #if USE_GTKMM_BUILDER
463        Gtk::Menu* menuMacro;
464    #else
465        Gtk::Menu* instrument_menu; // kept for GTKMM 2 version only, will be completely removed in future
466    #endif
467        Gtk::Menu* assign_scripts_menu;
468    
469      std::map<gig::Sample*,int> sample_ref_count;      std::map<gig::Sample*,int> sample_ref_count;
470    
# Line 358  protected: Line 524  protected:
524      Gtk::TreeView m_TreeViewScripts;      Gtk::TreeView m_TreeViewScripts;
525      Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel;      Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel;
526    
527      Gtk::VBox dimreg_vbox;      VBox dimreg_vbox;
528      Gtk::HBox dimreg_hbox;      HBox dimreg_hbox;
529      Gtk::Label dimreg_label;      Gtk::Label dimreg_label;
530      Gtk::CheckButton dimreg_all_regions;      Gtk::CheckButton dimreg_all_regions;
531      Gtk::CheckButton dimreg_all_dimregs;      Gtk::CheckButton dimreg_all_dimregs;
532      Gtk::CheckButton dimreg_stereo;      Gtk::CheckButton dimreg_stereo;
533    
534        HBox legend_hbox;
535        Gtk::Label labelLegend;
536        Gtk::Image imageNoSample;
537        Gtk::Label labelNoSample;
538        Gtk::Image imageMissingSample;
539        Gtk::Label labelMissingSample;
540        Gtk::Image imageLooped;
541        Gtk::Label labelLooped;
542        Gtk::Image imageSomeLoops;
543        Gtk::Label labelSomeLoops;
544      DimRegionEdit dimreg_edit;      DimRegionEdit dimreg_edit;
545    
546        VBox m_left_vbox;
547      Gtk::Notebook m_TreeViewNotebook;      Gtk::Notebook m_TreeViewNotebook;
548        HBox m_searchField;
549        Gtk::Label m_searchLabel;
550        Gtk::Entry m_searchText;
551    
552      struct SampleImportItem {      struct SampleImportItem {
553          gig::Sample*  gig_sample;  // pointer to the gig::Sample to          gig::Sample*  gig_sample;  // pointer to the gig::Sample to
# Line 375  protected: Line 556  protected:
556          Glib::ustring sample_path; // file name of the sample to be          Glib::ustring sample_path; // file name of the sample to be
557                                     // imported                                     // imported
558      };      };
559      std::list<SampleImportItem> m_SampleImportQueue;      std::map<gig::Sample*, SampleImportItem> m_SampleImportQueue;
560    
561    
562      void on_action_file_new();      void on_action_file_new();
# Line 386  protected: Line 567  protected:
567      void on_action_quit();      void on_action_quit();
568      void show_instr_props();      void show_instr_props();
569      bool instr_props_set_instrument();      bool instr_props_set_instrument();
570        void show_sample_props();
571        bool sample_props_set_sample();
572        void sample_name_changed_by_sample_props(Gtk::TreeModel::iterator& it);
573      void show_midi_rules();      void show_midi_rules();
574      void show_script_slots();      void show_script_slots();
575      void on_action_view_status_bar();      void on_action_view_status_bar();
# Line 393  protected: Line 577  protected:
577      void on_save_with_temporary_file();      void on_save_with_temporary_file();
578      void on_action_refresh_all();      void on_action_refresh_all();
579      void on_action_warn_user_on_extensions();      void on_action_warn_user_on_extensions();
580        void on_action_show_tooltips();
581        void on_show_tooltips_changed();
582      void on_action_sync_sampler_instrument_selection();      void on_action_sync_sampler_instrument_selection();
583      void on_action_move_root_note_with_region_moved();      void on_action_move_root_note_with_region_moved();
584      void on_action_help_about();      void on_action_help_about();
585    
586        void on_notebook_tab_switched(void* page, guint page_num);
587    
588      // sample right-click popup actions      // sample right-click popup actions
589    #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
590        bool on_sample_treeview_button_release(Gdk::EventButton& button);
591    #else
592      void on_sample_treeview_button_release(GdkEventButton* button);      void on_sample_treeview_button_release(GdkEventButton* button);
593    #endif
594      void on_action_sample_properties();      void on_action_sample_properties();
595      void on_action_add_group();      void on_action_add_group();
596      void on_action_add_sample();      void on_action_add_sample();
# Line 408  protected: Line 600  protected:
600      void on_action_remove_unused_samples();      void on_action_remove_unused_samples();
601    
602      // script right-click popup actions      // script right-click popup actions
603    #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
604        bool on_script_treeview_button_release(Gdk::EventButton& button);
605    #else
606      void on_script_treeview_button_release(GdkEventButton* button);      void on_script_treeview_button_release(GdkEventButton* button);
607    #endif
608      void on_action_add_script_group();      void on_action_add_script_group();
609      void on_action_add_script();      void on_action_add_script();
610      void on_action_edit_script();      void on_action_edit_script();
# Line 422  protected: Line 618  protected:
618      void show_intruments_tab();      void show_intruments_tab();
619      void show_scripts_tab();      void show_scripts_tab();
620    
621        void select_prev_instrument();
622        void select_next_instrument();
623        void select_instrument_by_dir(int dir);
624    
625        void select_prev_region();
626        void select_next_region();
627    
628        void select_next_dim_rgn_zone();
629        void select_prev_dim_rgn_zone();
630        void select_add_next_dim_rgn_zone();
631        void select_add_prev_dim_rgn_zone();
632        void select_prev_dimension();
633        void select_next_dimension();
634    
635        Serialization::Archive m_serializationArchive; ///< Clipboard content.
636        std::vector<Serialization::Archive> m_macros; ///< User configured list of macros.
637    
638        void copy_selected_dimrgn();
639        void paste_copied_dimrgn();
640        void adjust_clipboard_content();
641        void updateClipboardCopyAvailable();
642        void updateClipboardPasteAvailable();
643    #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
644        void on_clipboard_owner_change(Gdk::EventOwnerChange& event);
645    #else
646        void on_clipboard_owner_change(GdkEventOwnerChange* event);
647    #endif
648        void on_clipboard_get(Gtk::SelectionData& selection_data, guint info);
649        void on_clipboard_clear();
650        void on_clipboard_received(const Gtk::SelectionData& selection_data);
651        void on_clipboard_received_targets(const std::vector<Glib::ustring>& targets);
652    
653      void add_instrument(gig::Instrument* instrument);      void add_instrument(gig::Instrument* instrument);
654    #if !USE_GTKMM_BUILDER
655      Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,      Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,
656                                                 int position = -1);                                                 int position = -1);
657      void remove_instrument_from_menu(int index);      void remove_instrument_from_menu(int index);
658    #endif
659        bool onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
660    
661      ProgressDialog* progress_dialog;      ProgressDialog* progress_dialog;
662      Loader* loader;      Loader* loader;
# Line 447  protected: Line 678  protected:
678      bool file_save_as();      bool file_save_as();
679      bool check_if_savable();      bool check_if_savable();
680    
681    #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
682        bool on_button_release(Gdk::EventButton& button);
683    #else
684      void on_button_release(GdkEventButton* button);      void on_button_release(GdkEventButton* button);
685    #endif
686      void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);      void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
687      void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,      void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
688                                                 Gtk::SelectionData& selection_data, guint, guint);                                                 Gtk::SelectionData& selection_data, guint, guint);
# Line 474  protected: Line 709  protected:
709      void instrument_name_changed(const Gtk::TreeModel::Path& path,      void instrument_name_changed(const Gtk::TreeModel::Path& path,
710                                   const Gtk::TreeModel::iterator& iter);                                   const Gtk::TreeModel::iterator& iter);
711      void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);      void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);
712        bool instrument_row_visible(const Gtk::TreeModel::const_iterator& iter);
713      sigc::connection instrument_name_connection;      sigc::connection instrument_name_connection;
714    
715      void on_action_combine_instruments();      void on_action_combine_instruments();
# Line 490  protected: Line 726  protected:
726      void __import_queued_samples();      void __import_queued_samples();
727      void __clear();      void __clear();
728      void __refreshEntireGUI();      void __refreshEntireGUI();
729        void updateScriptListOfMenu();
730        void assignScript(gig::Script* pScript);
731        void dropAllScriptSlots();
732    
733      bool close_confirmation_dialog();      bool close_confirmation_dialog();
734      bool leaving_shared_mode_dialog();      bool leaving_shared_mode_dialog();
735    
736      Gtk::Menu* popup_menu;      Gtk::Menu* popup_menu;
737    #if USE_GTKMM_BUILDER
738        Gtk::Menu* sample_popup;
739        Gtk::Menu* script_popup;
740    #endif
741    
742      bool on_delete_event(GdkEventAny* event);      bool on_delete_event(GdkEventAny* event);
743    
744      bool first_call_to_drag_data_get;      bool first_call_to_drag_data_get;
745        
746      bool is_copy_samples_unity_note_enabled() const;      bool is_copy_samples_unity_note_enabled() const;
747      bool is_copy_samples_fine_tune_enabled() const;      bool is_copy_samples_fine_tune_enabled() const;
748      bool is_copy_samples_loop_enabled() const;      bool is_copy_samples_loop_enabled() const;

Legend:
Removed from v.3068  
changed lines
  Added in v.3643

  ViewVC Help
Powered by ViewVC