/[svn]/gigedit/trunk/src/gigedit/mainwindow.h
ViewVC logotype

Annotation of /gigedit/trunk/src/gigedit/mainwindow.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3364 - (hide annotations) (download) (as text)
Tue Nov 14 18:07:25 2017 UTC (6 years, 5 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 24665 byte(s)
* Added experimental support for upcoming GTK(MM)4
  (for now up to GTKMM 3.91.2 while still preserving backward compatibility
  down to GTKMM 2).
* Re-merged r2845 to compile now with and without Gtk "Stock ID" API
  (see also r3158).

1 schoenebeck 1225 /* -*- c++ -*-
2 schoenebeck 3068 * Copyright (C) 2006 - 2017 Andreas Persson
3 schoenebeck 1225 *
4     * This program is free software; you can redistribute it and/or
5     * modify it under the terms of the GNU General Public License as
6     * published by the Free Software Foundation; either version 2, or (at
7     * your option) any later version.
8     *
9     * This program is distributed in the hope that it will be useful, but
10     * WITHOUT ANY WARRANTY; without even the implied warranty of
11     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12     * General Public License for more details.
13     *
14     * You should have received a copy of the GNU General Public License
15     * along with program; see the file COPYING. If not, write to the Free
16     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17     * 02110-1301 USA.
18     */
19    
20     #ifndef GIGEDIT_MAINWINDOW_H
21     #define GIGEDIT_MAINWINDOW_H
22    
23 schoenebeck 3068 #ifdef LIBGIG_HEADER_FILE
24     # include LIBGIG_HEADER_FILE(gig.h)
25 schoenebeck 3145 # include LIBGIG_HEADER_FILE(Serialization.h)
26 schoenebeck 3068 #else
27     # include <gig.h>
28 schoenebeck 3145 # include <Serialization.h>
29 schoenebeck 3068 #endif
30 schoenebeck 1225
31 schoenebeck 3364 #include "compat.h"
32    
33 persson 2844 #include <gtkmm/box.h>
34 schoenebeck 1225 #include <gtkmm/buttonbox.h>
35     #include <gtkmm/dialog.h>
36     #include <gtkmm/liststore.h>
37 persson 2442 #include <gtkmm/menu.h>
38 schoenebeck 1225 #include <gtkmm/paned.h>
39     #include <gtkmm/progressbar.h>
40 persson 2442 #include <gtkmm/radiomenuitem.h>
41 schoenebeck 1225 #include <gtkmm/scrolledwindow.h>
42     #include <gtkmm/treestore.h>
43 schoenebeck 3340 #include <gtkmm/treemodelfilter.h>
44 schoenebeck 1225 #include <gtkmm/window.h>
45 schoenebeck 1411 #include <gtkmm/statusbar.h>
46     #include <gtkmm/image.h>
47 schoenebeck 3340 #include <gtkmm/entry.h>
48 schoenebeck 3342 #include <gtkmm/notebook.h>
49 schoenebeck 1225
50 schoenebeck 3364 #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 schoenebeck 1225 #include <sstream>
57    
58     #include "regionchooser.h"
59     #include "dimregionchooser.h"
60     #include "dimregionedit.h"
61 persson 2507 #include "midirules.h"
62 persson 2325 #ifndef OLD_THREADS
63     #include <glibmm/threads.h>
64     #endif
65 schoenebeck 2893 #include "ManagedWindow.h"
66 schoenebeck 1225
67     class MainWindow;
68    
69 schoenebeck 2894 class PropDialog : public ManagedWindow,
70 persson 2423 public PropEditor<DLS::Info> {
71 persson 1582 public:
72 schoenebeck 1225 PropDialog();
73     void set_info(DLS::Info* info);
74 schoenebeck 2560 void set_file(gig::File* file);
75 schoenebeck 2894
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 schoenebeck 1225 protected:
83 schoenebeck 2560 ChoiceEntry<int> eFileFormat;
84 persson 1582 StringEntry eName;
85     StringEntry eCreationDate;
86     StringEntryMultiLine eComments;
87     StringEntry eProduct;
88     StringEntry eCopyright;
89     StringEntry eArtists;
90     StringEntry eGenre;
91     StringEntry eKeywords;
92     StringEntry eEngineer;
93     StringEntry eTechnician;
94     StringEntry eSoftware;
95     StringEntry eMedium;
96     StringEntry eSource;
97     StringEntry eSourceForm;
98     StringEntry eCommissioned;
99     StringEntry eSubject;
100 schoenebeck 3364 VBox vbox;
101     HButtonBox buttonBox;
102 persson 1582 Gtk::Button quitButton;
103     Table table;
104 schoenebeck 2560
105     gig::File* m_file;
106    
107     void onFileFormatChanged();
108 schoenebeck 1225 };
109    
110 schoenebeck 2894 class InstrumentProps : public ManagedWindow,
111 persson 2423 public PropEditor<gig::Instrument> {
112 schoenebeck 1225 public:
113     InstrumentProps();
114     void set_instrument(gig::Instrument* instrument);
115 persson 2445 gig::Instrument* get_instrument() { return m; }
116     void update_name();
117     sigc::signal<void>& signal_name_changed() {
118     return sig_name_changed;
119     }
120 schoenebeck 2894
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 schoenebeck 1225 protected:
128 persson 2445 void set_Name(const gig::String& name);
129 persson 1460 void set_IsDrum(bool value);
130     void set_MIDIBank(uint16_t value);
131     void set_MIDIProgram(uint32_t value);
132    
133 persson 2445 sigc::signal<void> sig_name_changed;
134 schoenebeck 3364 VBox vbox;
135     HButtonBox buttonBox;
136 schoenebeck 1225 Gtk::Button quitButton;
137 persson 1582 Table table;
138 schoenebeck 1225 StringEntry eName;
139     BoolEntry eIsDrum;
140     NumEntryTemp<uint16_t> eMIDIBank;
141     NumEntryTemp<uint32_t> eMIDIProgram;
142     NumEntryGain eAttenuation;
143     BoolEntryPlus6 eGainPlus6;
144     NumEntryTemp<uint16_t> eEffectSend;
145     NumEntryTemp<int16_t> eFineTune;
146     NumEntryTemp<uint16_t> ePitchbendRange;
147     BoolEntry ePianoReleaseMode;
148     NoteEntry eDimensionKeyRangeLow;
149     NoteEntry eDimensionKeyRangeHigh;
150     };
151    
152 schoenebeck 2683 class ProgressDialog : public Gtk::Dialog {
153 schoenebeck 1225 public:
154 schoenebeck 2683 ProgressDialog(const Glib::ustring& title, Gtk::Window& parent);
155 schoenebeck 1225 void set_fraction(float fraction) { progressBar.set_fraction(fraction); }
156     protected:
157     Gtk::ProgressBar progressBar;
158     };
159    
160     class Loader : public sigc::trackable {
161     public:
162     Loader(const char* filename);
163     void launch();
164     Glib::Dispatcher& signal_progress();
165 schoenebeck 2683 Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.
166     Glib::Dispatcher& signal_error();
167 schoenebeck 1225 void progress_callback(float fraction);
168     float get_progress();
169 schoenebeck 2683 const Glib::ustring filename;
170     Glib::ustring error_message;
171 schoenebeck 1225 gig::File* gig;
172    
173     private:
174 persson 2325 Glib::Threads::Thread* thread;
175 schoenebeck 1225 void thread_function();
176     Glib::Dispatcher finished_dispatcher;
177     Glib::Dispatcher progress_dispatcher;
178 schoenebeck 2683 Glib::Dispatcher error_dispatcher;
179 persson 2325 Glib::Threads::Mutex progressMutex;
180 schoenebeck 1225 float progress;
181     };
182    
183 schoenebeck 2683 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);
191     float get_progress();
192     gig::File* gig;
193     const Glib::ustring filename;
194     Glib::ustring error_message;
195    
196     private:
197     Glib::Threads::Thread* thread;
198     void thread_function();
199     Glib::Dispatcher finished_dispatcher;
200     Glib::Dispatcher progress_dispatcher;
201     Glib::Dispatcher error_dispatcher;
202     Glib::Threads::Mutex progressMutex;
203     float progress;
204     };
205    
206 schoenebeck 2893 class MainWindow : public ManagedWindow {
207 schoenebeck 1225 public:
208     MainWindow();
209     virtual ~MainWindow();
210     void load_file(const char* name);
211     void load_instrument(gig::Instrument* instr);
212 persson 1261 void file_changed();
213 schoenebeck 1339 sigc::signal<void, gig::File*>& signal_file_structure_to_be_changed();
214     sigc::signal<void, gig::File*>& signal_file_structure_changed();
215     sigc::signal<void, std::list<gig::Sample*> >& signal_samples_to_be_removed();
216     sigc::signal<void>& signal_samples_removed();
217     sigc::signal<void, gig::Region*>& signal_region_to_be_changed();
218     sigc::signal<void, gig::Region*>& signal_region_changed();
219     sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
220     sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
221 schoenebeck 1853 sigc::signal<void, gig::Sample*>& signal_sample_changed();
222 schoenebeck 1339 sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed();
223 schoenebeck 1225
224 schoenebeck 1654 sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on();
225     sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_off();
226    
227 schoenebeck 1660 sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit();
228     sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released();
229    
230 schoenebeck 2689 sigc::signal<void, gig::Instrument*>& signal_switch_sampler_instrument();
231 schoenebeck 2903
232     sigc::signal<void, gig::Script*> signal_script_to_be_changed;
233     sigc::signal<void, gig::Script*> signal_script_changed;
234    
235 schoenebeck 2893 // 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 schoenebeck 2689
241 schoenebeck 1225 protected:
242 schoenebeck 3364 #if USE_GTKMM_BUILDER
243     Glib::RefPtr<Gio::SimpleActionGroup> m_actionGroup;
244     Glib::RefPtr<Gtk::Builder> m_uiManager;
245     #else
246 schoenebeck 1225 Glib::RefPtr<Gtk::ActionGroup> actionGroup;
247     Glib::RefPtr<Gtk::UIManager> uiManager;
248 schoenebeck 3364 #endif
249 schoenebeck 1225
250 schoenebeck 3364 #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_actionToggleSyncSamplerSelection;
277     Glib::RefPtr<Gio::SimpleAction> m_actionToggleMoveRootNoteWithRegion;
278     #endif
279    
280 schoenebeck 1411 Gtk::Statusbar m_StatusBar;
281     Gtk::Label m_AttachedStateLabel;
282     Gtk::Image m_AttachedStateImage;
283    
284 schoenebeck 1225 RegionChooser m_RegionChooser;
285     DimRegionChooser m_DimRegionChooser;
286    
287     PropDialog propDialog;
288     InstrumentProps instrumentProps;
289 persson 2507 MidiRules midiRules;
290 schoenebeck 1225
291 schoenebeck 3177 /**
292     * Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and
293     * MainWindowv::dimreg_changed_signal are always triggered correctly as a
294     * pair. It behaves similar to a "mutex lock guard" design pattern.
295     */
296     class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
297     public:
298     DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) :
299     SignalGuard<gig::DimensionRegion*>(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg)
300     {
301     }
302     };
303    
304 schoenebeck 1322 sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;
305     sigc::signal<void, gig::File*> file_structure_changed_signal;
306     sigc::signal<void, std::list<gig::Sample*> > samples_to_be_removed_signal;
307     sigc::signal<void> samples_removed_signal;
308     sigc::signal<void, gig::Region*> region_to_be_changed_signal;
309     sigc::signal<void, gig::Region*> region_changed_signal;
310     sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;
311     sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
312 schoenebeck 1853 sigc::signal<void, gig::Sample*> sample_changed_signal;
313 schoenebeck 1322 sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal;
314    
315 schoenebeck 1654 sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;
316     sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal;
317    
318 schoenebeck 2689 sigc::signal<void, gig::Instrument*> switch_sampler_instrument_signal;
319    
320 schoenebeck 3364 #if !USE_GTKMM_BUILDER
321 persson 2442 void on_instrument_selection_change(Gtk::RadioMenuItem* item);
322 schoenebeck 3364 #endif
323 schoenebeck 1225 void on_sel_change();
324     void region_changed();
325     void dimreg_changed();
326 schoenebeck 2701 void select_instrument(gig::Instrument* instrument);
327 schoenebeck 2695 bool select_dimension_region(gig::DimensionRegion* dimRgn);
328 schoenebeck 2691 void select_sample(gig::Sample* sample);
329 schoenebeck 1225 void on_loader_progress();
330     void on_loader_finished();
331 schoenebeck 2683 void on_loader_error();
332     void on_saver_progress();
333     void on_saver_error();
334     void on_saver_finished();
335 schoenebeck 3157 void updateMacroMenu();
336     void onMacroSelected(int iMacro);
337     void setupMacros();
338     void onMacrosSetupChanged(const std::vector<Serialization::Archive>& macros);
339     void applyMacro(Serialization::Archive& macro);
340 schoenebeck 3197 void onScriptSlotsModified(gig::Instrument* pInstrument);
341 schoenebeck 3258 void bringToFront();
342 schoenebeck 2683
343 persson 1533 void dimreg_all_dimregs_toggled();
344     gig::Instrument* get_instrument();
345     void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs);
346     void update_dimregs();
347 schoenebeck 1225
348     class ModelColumns : public Gtk::TreeModel::ColumnRecord {
349     public:
350     ModelColumns() {
351 schoenebeck 2994 add(m_col_nr);
352 schoenebeck 1225 add(m_col_name);
353     add(m_col_instr);
354 schoenebeck 3197 add(m_col_scripts);
355 schoenebeck 1225 }
356    
357 schoenebeck 2994 Gtk::TreeModelColumn<int> m_col_nr;
358 schoenebeck 1225 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
359     Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
360 schoenebeck 3197 Gtk::TreeModelColumn<Glib::ustring> m_col_scripts;
361 schoenebeck 1225 } m_Columns;
362    
363 schoenebeck 3364 VBox m_VBox;
364 schoenebeck 1225 Gtk::HPaned m_HPaned;
365    
366     Gtk::ScrolledWindow m_ScrolledWindow;
367    
368     Gtk::TreeView m_TreeView;
369     Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
370 schoenebeck 3340 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.
371 schoenebeck 1225
372 schoenebeck 3364 #if USE_GTKMM_BUILDER
373     Gtk::Menu* menuMacro;
374     #else
375     Gtk::Menu* instrument_menu; // kept for GTKMM 2 version only, will be completely removed in future
376     #endif
377 schoenebeck 3339 Gtk::Menu* assign_scripts_menu;
378 persson 2442
379 schoenebeck 2621 std::map<gig::Sample*,int> sample_ref_count;
380    
381 schoenebeck 1225 class SamplesModel : public Gtk::TreeModel::ColumnRecord {
382     public:
383     SamplesModel() {
384     add(m_col_name);
385     add(m_col_sample);
386     add(m_col_group);
387 schoenebeck 2621 add(m_col_refcount);
388     add(m_color);
389 schoenebeck 1225 }
390    
391     Gtk::TreeModelColumn<Glib::ustring> m_col_name;
392     Gtk::TreeModelColumn<gig::Sample*> m_col_sample;
393     Gtk::TreeModelColumn<gig::Group*> m_col_group;
394 schoenebeck 2621 Gtk::TreeModelColumn<Glib::ustring> m_col_refcount;
395     Gtk::TreeModelColumn<Glib::ustring> m_color;
396 schoenebeck 1225 } m_SamplesModel;
397    
398     class SamplesTreeStore : public Gtk::TreeStore {
399     public:
400     static Glib::RefPtr<SamplesTreeStore> create(const SamplesModel& columns) {
401     return Glib::RefPtr<SamplesTreeStore>( new SamplesTreeStore(columns) );
402     }
403     protected:
404     SamplesTreeStore(const SamplesModel& columns) : Gtk::TreeStore(columns) {}
405     };
406    
407     Gtk::ScrolledWindow m_ScrolledWindowSamples;
408     Gtk::TreeView m_TreeViewSamples;
409     Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel;
410    
411 schoenebeck 2604 class ScriptsModel : public Gtk::TreeModel::ColumnRecord {
412     public:
413     ScriptsModel() {
414     add(m_col_name);
415     add(m_col_script);
416     add(m_col_group);
417     }
418    
419     Gtk::TreeModelColumn<Glib::ustring> m_col_name;
420     Gtk::TreeModelColumn<gig::Script*> m_col_script;
421     Gtk::TreeModelColumn<gig::ScriptGroup*> m_col_group;
422     } m_ScriptsModel;
423    
424     class ScriptsTreeStore : public Gtk::TreeStore {
425     public:
426     static Glib::RefPtr<ScriptsTreeStore> create(const ScriptsModel& columns) {
427     return Glib::RefPtr<ScriptsTreeStore>( new ScriptsTreeStore(columns) );
428     }
429     protected:
430     ScriptsTreeStore(const ScriptsModel& columns) : Gtk::TreeStore(columns) {}
431     };
432    
433     Gtk::ScrolledWindow m_ScrolledWindowScripts;
434     Gtk::TreeView m_TreeViewScripts;
435     Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel;
436    
437 schoenebeck 3364 VBox dimreg_vbox;
438     HBox dimreg_hbox;
439 persson 1533 Gtk::Label dimreg_label;
440     Gtk::CheckButton dimreg_all_regions;
441     Gtk::CheckButton dimreg_all_dimregs;
442     Gtk::CheckButton dimreg_stereo;
443 schoenebeck 3106
444 schoenebeck 3364 HBox legend_hbox;
445 schoenebeck 3109 Gtk::Label labelLegend;
446 schoenebeck 3106 Gtk::Image imageNoSample;
447     Gtk::Label labelNoSample;
448     Gtk::Image imageMissingSample;
449     Gtk::Label labelMissingSample;
450     Gtk::Image imageLooped;
451     Gtk::Label labelLooped;
452     Gtk::Image imageSomeLoops;
453     Gtk::Label labelSomeLoops;
454 schoenebeck 1225 DimRegionEdit dimreg_edit;
455    
456 schoenebeck 3364 VBox m_left_vbox;
457 schoenebeck 1225 Gtk::Notebook m_TreeViewNotebook;
458 schoenebeck 3364 HBox m_searchField;
459 schoenebeck 3340 Gtk::Label m_searchLabel;
460     Gtk::Entry m_searchText;
461 schoenebeck 1225
462     struct SampleImportItem {
463     gig::Sample* gig_sample; // pointer to the gig::Sample to
464     // which the sample data should be
465     // imported to
466     Glib::ustring sample_path; // file name of the sample to be
467     // imported
468     };
469 schoenebeck 3116 std::map<gig::Sample*, SampleImportItem> m_SampleImportQueue;
470 schoenebeck 1225
471    
472     void on_action_file_new();
473     void on_action_file_open();
474     void on_action_file_save();
475     void on_action_file_save_as();
476     void on_action_file_properties();
477 persson 1261 void on_action_quit();
478 schoenebeck 1225 void show_instr_props();
479 persson 2445 bool instr_props_set_instrument();
480 persson 2507 void show_midi_rules();
481 schoenebeck 2610 void show_script_slots();
482 schoenebeck 1415 void on_action_view_status_bar();
483 schoenebeck 2918 void on_auto_restore_win_dim();
484 schoenebeck 2967 void on_save_with_temporary_file();
485 schoenebeck 2772 void on_action_refresh_all();
486 schoenebeck 2541 void on_action_warn_user_on_extensions();
487 schoenebeck 2689 void on_action_sync_sampler_instrument_selection();
488 schoenebeck 2773 void on_action_move_root_note_with_region_moved();
489 schoenebeck 1225 void on_action_help_about();
490    
491 schoenebeck 3344 void on_notebook_tab_switched(void* page, guint page_num);
492 schoenebeck 3340
493 schoenebeck 1225 // sample right-click popup actions
494 schoenebeck 3364 #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
495     bool on_sample_treeview_button_release(Gdk::EventButton& button);
496     #else
497 schoenebeck 1225 void on_sample_treeview_button_release(GdkEventButton* button);
498 schoenebeck 3364 #endif
499 schoenebeck 1225 void on_action_sample_properties();
500     void on_action_add_group();
501     void on_action_add_sample();
502 schoenebeck 2715 void on_action_replace_sample();
503 schoenebeck 1673 void on_action_replace_all_samples_in_all_groups();
504 schoenebeck 1225 void on_action_remove_sample();
505 schoenebeck 2772 void on_action_remove_unused_samples();
506    
507 schoenebeck 2604 // script right-click popup actions
508 schoenebeck 3364 #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
509     bool on_script_treeview_button_release(Gdk::EventButton& button);
510     #else
511 schoenebeck 2604 void on_script_treeview_button_release(GdkEventButton* button);
512 schoenebeck 3364 #endif
513 schoenebeck 2604 void on_action_add_script_group();
514     void on_action_add_script();
515     void on_action_edit_script();
516     void on_action_remove_script();
517 schoenebeck 1225
518     void on_action_add_instrument();
519 schoenebeck 2395 void on_action_duplicate_instrument();
520 schoenebeck 1225 void on_action_remove_instrument();
521    
522 schoenebeck 2625 void show_samples_tab();
523     void show_intruments_tab();
524     void show_scripts_tab();
525    
526 schoenebeck 3339 void select_prev_instrument();
527     void select_next_instrument();
528     void select_instrument_by_dir(int dir);
529    
530 schoenebeck 3123 void select_prev_region();
531     void select_next_region();
532    
533     void select_next_dim_rgn_zone();
534     void select_prev_dim_rgn_zone();
535 schoenebeck 3134 void select_add_next_dim_rgn_zone();
536     void select_add_prev_dim_rgn_zone();
537 schoenebeck 3123 void select_prev_dimension();
538     void select_next_dimension();
539    
540 schoenebeck 3157 Serialization::Archive m_serializationArchive; ///< Clipboard content.
541     std::vector<Serialization::Archive> m_macros; ///< User configured list of macros.
542 schoenebeck 3144
543     void copy_selected_dimrgn();
544     void paste_copied_dimrgn();
545 schoenebeck 3151 void adjust_clipboard_content();
546 schoenebeck 3144 void updateClipboardCopyAvailable();
547     void updateClipboardPasteAvailable();
548 schoenebeck 3364 #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
549     void on_clipboard_owner_change(Gdk::EventOwnerChange& event);
550     #else
551 schoenebeck 3144 void on_clipboard_owner_change(GdkEventOwnerChange* event);
552 schoenebeck 3364 #endif
553 schoenebeck 3144 void on_clipboard_get(Gtk::SelectionData& selection_data, guint info);
554     void on_clipboard_clear();
555     void on_clipboard_received(const Gtk::SelectionData& selection_data);
556     void on_clipboard_received_targets(const std::vector<Glib::ustring>& targets);
557    
558 persson 2442 void add_instrument(gig::Instrument* instrument);
559 schoenebeck 3364 #if !USE_GTKMM_BUILDER
560 persson 2442 Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name,
561     int position = -1);
562     void remove_instrument_from_menu(int index);
563 schoenebeck 3364 #endif
564 persson 2442
565 schoenebeck 2683 ProgressDialog* progress_dialog;
566 schoenebeck 1225 Loader* loader;
567 schoenebeck 2683 Saver* saver;
568 schoenebeck 1382 void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false);
569 schoenebeck 2621 void updateSampleRefCountMap(gig::File* gig);
570 schoenebeck 1225
571     gig::File* file;
572 schoenebeck 1382 bool file_is_shared;
573 persson 1261 bool file_has_name;
574     bool file_is_changed;
575     std::string filename;
576 persson 1725 std::string current_gig_dir;
577     std::string current_sample_dir;
578 schoenebeck 1225
579 schoenebeck 1411 void set_file_is_shared(bool);
580    
581 persson 1261 bool file_save();
582     bool file_save_as();
583 persson 1303 bool check_if_savable();
584 persson 1261
585 schoenebeck 3364 #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
586     bool on_button_release(Gdk::EventButton& button);
587     #else
588 schoenebeck 1225 void on_button_release(GdkEventButton* button);
589 schoenebeck 3364 #endif
590 schoenebeck 2701 void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
591     void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
592     Gtk::SelectionData& selection_data, guint, guint);
593     void on_instruments_treeview_drop_drag_data_received(
594     const Glib::RefPtr<Gdk::DragContext>& context, int, int,
595     const Gtk::SelectionData& selection_data, guint, guint time
596     );
597 schoenebeck 2610 void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
598     void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
599     Gtk::SelectionData& selection_data, guint, guint);
600 persson 1303 void on_sample_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
601 schoenebeck 1225 void on_sample_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
602     Gtk::SelectionData& selection_data, guint, guint);
603     void on_sample_label_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context,
604     int, int,
605     const Gtk::SelectionData& selection_data,
606     guint, guint time);
607 persson 1303
608 schoenebeck 2604 void script_name_changed(const Gtk::TreeModel::Path& path,
609     const Gtk::TreeModel::iterator& iter);
610 schoenebeck 2644 void script_double_clicked(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
611 schoenebeck 1225 void sample_name_changed(const Gtk::TreeModel::Path& path,
612     const Gtk::TreeModel::iterator& iter);
613     void instrument_name_changed(const Gtk::TreeModel::Path& path,
614     const Gtk::TreeModel::iterator& iter);
615 persson 2445 void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);
616 schoenebeck 3340 bool instrument_row_visible(const Gtk::TreeModel::const_iterator& iter);
617 persson 2442 sigc::connection instrument_name_connection;
618 schoenebeck 1225
619 schoenebeck 2548 void on_action_combine_instruments();
620 schoenebeck 2624 void on_action_view_references();
621 schoenebeck 2553 void on_action_merge_files();
622     void mergeFiles(const std::vector<std::string>& filenames);
623 schoenebeck 2548
624 schoenebeck 2621 void on_sample_ref_changed(gig::Sample* oldSample, gig::Sample* newSample);
625     void on_sample_ref_count_incremented(gig::Sample* sample, int offset);
626     void on_samples_to_be_removed(std::list<gig::Sample*> samples);
627    
628 schoenebeck 2715 void add_or_replace_sample(bool replace);
629    
630 schoenebeck 1225 void __import_queued_samples();
631     void __clear();
632 schoenebeck 2553 void __refreshEntireGUI();
633 schoenebeck 3339 void updateScriptListOfMenu();
634     void assignScript(gig::Script* pScript);
635 schoenebeck 1225
636 persson 1261 bool close_confirmation_dialog();
637 schoenebeck 1382 bool leaving_shared_mode_dialog();
638 persson 1261
639 schoenebeck 1225 Gtk::Menu* popup_menu;
640 schoenebeck 3364 #if USE_GTKMM_BUILDER
641     Gtk::Menu* sample_popup;
642     Gtk::Menu* script_popup;
643     #endif
644 persson 1261
645     bool on_delete_event(GdkEventAny* event);
646 persson 1303
647     bool first_call_to_drag_data_get;
648 schoenebeck 2464
649     bool is_copy_samples_unity_note_enabled() const;
650     bool is_copy_samples_fine_tune_enabled() const;
651     bool is_copy_samples_loop_enabled() const;
652 schoenebeck 1225 };
653    
654     #endif

  ViewVC Help
Powered by ViewVC