/[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 3470 - (hide annotations) (download) (as text)
Thu Feb 14 19:10:49 2019 UTC (5 years, 2 months ago) by persson
File MIME type: text/x-c++hdr
File size: 24717 byte(s)
* Refactor code: add common base class for Loader and Saver

1 schoenebeck 1225 /* -*- c++ -*-
2 persson 3469 * Copyright (C) 2006 - 2019 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 schoenebeck 2560 void set_file(gig::File* file);
74 schoenebeck 2894
75     // implementation for abstract methods of interface class "ManagedWindow"
76     virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->filePropsWindowX; }
77     virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->filePropsWindowY; }
78     virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->filePropsWindowW; }
79     virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->filePropsWindowH; }
80    
81 schoenebeck 1225 protected:
82 schoenebeck 2560 ChoiceEntry<int> eFileFormat;
83 persson 1582 StringEntry eName;
84     StringEntry eCreationDate;
85     StringEntryMultiLine eComments;
86     StringEntry eProduct;
87     StringEntry eCopyright;
88     StringEntry eArtists;
89     StringEntry eGenre;
90     StringEntry eKeywords;
91     StringEntry eEngineer;
92     StringEntry eTechnician;
93     StringEntry eSoftware;
94     StringEntry eMedium;
95     StringEntry eSource;
96     StringEntry eSourceForm;
97     StringEntry eCommissioned;
98     StringEntry eSubject;
99 schoenebeck 3364 VBox vbox;
100     HButtonBox buttonBox;
101 persson 1582 Gtk::Button quitButton;
102     Table table;
103 schoenebeck 2560
104     gig::File* m_file;
105    
106 persson 3469 void set_FileFormat(int value);
107 schoenebeck 1225 };
108    
109 schoenebeck 2894 class InstrumentProps : public ManagedWindow,
110 persson 2423 public PropEditor<gig::Instrument> {
111 schoenebeck 1225 public:
112     InstrumentProps();
113     void set_instrument(gig::Instrument* instrument);
114 persson 2445 gig::Instrument* get_instrument() { return m; }
115     void update_name();
116     sigc::signal<void>& signal_name_changed() {
117     return sig_name_changed;
118     }
119 schoenebeck 2894
120     // implementation for abstract methods of interface class "ManagedWindow"
121     virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->instrPropsWindowX; }
122     virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->instrPropsWindowY; }
123     virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->instrPropsWindowW; }
124     virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->instrPropsWindowH; }
125    
126 schoenebeck 1225 protected:
127 persson 2445 void set_Name(const gig::String& name);
128 persson 1460 void set_IsDrum(bool value);
129     void set_MIDIBank(uint16_t value);
130     void set_MIDIProgram(uint32_t value);
131    
132 persson 2445 sigc::signal<void> sig_name_changed;
133 schoenebeck 3364 VBox vbox;
134     HButtonBox buttonBox;
135 schoenebeck 1225 Gtk::Button quitButton;
136 persson 1582 Table table;
137 schoenebeck 1225 StringEntry eName;
138     BoolEntry eIsDrum;
139     NumEntryTemp<uint16_t> eMIDIBank;
140     NumEntryTemp<uint32_t> eMIDIProgram;
141     NumEntryGain eAttenuation;
142     BoolEntryPlus6 eGainPlus6;
143     NumEntryTemp<uint16_t> eEffectSend;
144     NumEntryTemp<int16_t> eFineTune;
145     NumEntryTemp<uint16_t> ePitchbendRange;
146     BoolEntry ePianoReleaseMode;
147     NoteEntry eDimensionKeyRangeLow;
148     NoteEntry eDimensionKeyRangeHigh;
149     };
150    
151 schoenebeck 2683 class ProgressDialog : public Gtk::Dialog {
152 schoenebeck 1225 public:
153 schoenebeck 2683 ProgressDialog(const Glib::ustring& title, Gtk::Window& parent);
154 schoenebeck 1225 void set_fraction(float fraction) { progressBar.set_fraction(fraction); }
155     protected:
156     Gtk::ProgressBar progressBar;
157     };
158    
159 persson 3470 class LoaderSaverBase {
160 schoenebeck 1225 public:
161     void launch();
162     Glib::Dispatcher& signal_progress();
163 schoenebeck 2683 Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error.
164     Glib::Dispatcher& signal_error();
165 schoenebeck 1225 void progress_callback(float fraction);
166     float get_progress();
167 schoenebeck 2683 const Glib::ustring filename;
168     Glib::ustring error_message;
169 schoenebeck 1225 gig::File* gig;
170    
171 persson 3470 protected:
172     LoaderSaverBase(const Glib::ustring filename, gig::File* gig);
173    
174 schoenebeck 1225 private:
175 persson 2325 Glib::Threads::Thread* thread;
176 schoenebeck 1225 void thread_function();
177 persson 3470 virtual void thread_function_sub(gig::progress_t& progress) = 0;
178 schoenebeck 1225 Glib::Dispatcher finished_dispatcher;
179     Glib::Dispatcher progress_dispatcher;
180 schoenebeck 2683 Glib::Dispatcher error_dispatcher;
181 persson 2325 Glib::Threads::Mutex progressMutex;
182 schoenebeck 1225 float progress;
183     };
184    
185 persson 3470 class Loader : public LoaderSaverBase {
186 schoenebeck 2683 public:
187 persson 3470 Loader(const char* filename);
188    
189     private:
190     void thread_function_sub(gig::progress_t& progress);
191     };
192    
193     class Saver : public LoaderSaverBase {
194     public:
195 schoenebeck 2683 Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as"
196    
197     private:
198 persson 3470 void thread_function_sub(gig::progress_t& progress);
199 schoenebeck 2683 };
200    
201 schoenebeck 2893 class MainWindow : public ManagedWindow {
202 schoenebeck 1225 public:
203     MainWindow();
204     virtual ~MainWindow();
205     void load_file(const char* name);
206     void load_instrument(gig::Instrument* instr);
207 persson 1261 void file_changed();
208 schoenebeck 1339 sigc::signal<void, gig::File*>& signal_file_structure_to_be_changed();
209     sigc::signal<void, gig::File*>& signal_file_structure_changed();
210     sigc::signal<void, std::list<gig::Sample*> >& signal_samples_to_be_removed();
211     sigc::signal<void>& signal_samples_removed();
212     sigc::signal<void, gig::Region*>& signal_region_to_be_changed();
213     sigc::signal<void, gig::Region*>& signal_region_changed();
214     sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
215     sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
216 schoenebeck 1853 sigc::signal<void, gig::Sample*>& signal_sample_changed();
217 schoenebeck 1339 sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed();
218 schoenebeck 1225
219 schoenebeck 1654 sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on();
220     sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_off();
221    
222 schoenebeck 1660 sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit();
223     sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released();
224    
225 schoenebeck 2689 sigc::signal<void, gig::Instrument*>& signal_switch_sampler_instrument();
226 schoenebeck 2903
227     sigc::signal<void, gig::Script*> signal_script_to_be_changed;
228     sigc::signal<void, gig::Script*> signal_script_changed;
229    
230 schoenebeck 2893 // implementation for abstract methods of interface class "ManagedWindow"
231     virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->mainWindowX; }
232     virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->mainWindowY; }
233     virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->mainWindowW; }
234     virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->mainWindowH; }
235 schoenebeck 2689
236 schoenebeck 1225 protected:
237 schoenebeck 3364 #if USE_GTKMM_BUILDER
238     Glib::RefPtr<Gio::SimpleActionGroup> m_actionGroup;
239     Glib::RefPtr<Gtk::Builder> m_uiManager;
240     #else
241 schoenebeck 1225 Glib::RefPtr<Gtk::ActionGroup> actionGroup;
242     Glib::RefPtr<Gtk::UIManager> uiManager;
243 schoenebeck 3364 #endif
244 schoenebeck 1225
245 schoenebeck 3364 #if USE_GLIB_ACTION
246     Glib::RefPtr<Gio::SimpleAction> m_actionMIDIRules;
247    
248     Glib::RefPtr<Gio::SimpleAction> m_actionCopyDimRgn;
249     Glib::RefPtr<Gio::SimpleAction> m_actionPasteDimRgn;
250     Glib::RefPtr<Gio::SimpleAction> m_actionAdjustClipboard;
251    
252     Glib::RefPtr<Gio::SimpleAction> m_actionSampleProperties;
253     Glib::RefPtr<Gio::SimpleAction> m_actionAddSample;
254     Glib::RefPtr<Gio::SimpleAction> m_actionRemoveSample;
255     Glib::RefPtr<Gio::SimpleAction> m_actionViewSampleRefs;
256     Glib::RefPtr<Gio::SimpleAction> m_actionReplaceSample;
257     Glib::RefPtr<Gio::SimpleAction> m_actionAddSampleGroup;
258    
259     Glib::RefPtr<Gio::SimpleAction> m_actionAddScriptGroup;
260     Glib::RefPtr<Gio::SimpleAction> m_actionAddScript;
261     Glib::RefPtr<Gio::SimpleAction> m_actionEditScript;
262     Glib::RefPtr<Gio::SimpleAction> m_actionRemoveScript;
263    
264     Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleUnity;
265     Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleTune;
266     Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleLoop;
267     Glib::RefPtr<Gio::SimpleAction> m_actionToggleStatusBar;
268     Glib::RefPtr<Gio::SimpleAction> m_actionToggleRestoreWinDim;
269     Glib::RefPtr<Gio::SimpleAction> m_actionToggleSaveWithTempFile;
270     Glib::RefPtr<Gio::SimpleAction> m_actionToggleWarnOnExtensions;
271 schoenebeck 3409 Glib::RefPtr<Gio::SimpleAction> m_actionToggleShowTooltips;
272 schoenebeck 3364 Glib::RefPtr<Gio::SimpleAction> m_actionToggleSyncSamplerSelection;
273     Glib::RefPtr<Gio::SimpleAction> m_actionToggleMoveRootNoteWithRegion;
274     #endif
275    
276 schoenebeck 1411 Gtk::Statusbar m_StatusBar;
277     Gtk::Label m_AttachedStateLabel;
278     Gtk::Image m_AttachedStateImage;
279    
280 schoenebeck 1225 RegionChooser m_RegionChooser;
281     DimRegionChooser m_DimRegionChooser;
282    
283     PropDialog propDialog;
284     InstrumentProps instrumentProps;
285 persson 2507 MidiRules midiRules;
286 schoenebeck 1225
287 schoenebeck 3177 /**
288     * Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and
289     * MainWindowv::dimreg_changed_signal are always triggered correctly as a
290     * pair. It behaves similar to a "mutex lock guard" design pattern.
291     */
292     class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> {
293     public:
294     DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) :
295     SignalGuard<gig::DimensionRegion*>(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg)
296     {
297     }
298     };
299    
300 schoenebeck 1322 sigc::signal<void, gig::File*> file_structure_to_be_changed_signal;
301     sigc::signal<void, gig::File*> file_structure_changed_signal;
302     sigc::signal<void, std::list<gig::Sample*> > samples_to_be_removed_signal;
303     sigc::signal<void> samples_removed_signal;
304     sigc::signal<void, gig::Region*> region_to_be_changed_signal;
305     sigc::signal<void, gig::Region*> region_changed_signal;
306     sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;
307     sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
308 schoenebeck 1853 sigc::signal<void, gig::Sample*> sample_changed_signal;
309 schoenebeck 1322 sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal;
310    
311 schoenebeck 1654 sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;
312     sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal;
313    
314 schoenebeck 2689 sigc::signal<void, gig::Instrument*> switch_sampler_instrument_signal;
315    
316 schoenebeck 3364 #if !USE_GTKMM_BUILDER
317 persson 2442 void on_instrument_selection_change(Gtk::RadioMenuItem* item);
318 schoenebeck 3364 #endif
319 schoenebeck 1225 void on_sel_change();
320     void region_changed();
321     void dimreg_changed();
322 schoenebeck 2701 void select_instrument(gig::Instrument* instrument);
323 schoenebeck 2695 bool select_dimension_region(gig::DimensionRegion* dimRgn);
324 schoenebeck 2691 void select_sample(gig::Sample* sample);
325 schoenebeck 1225 void on_loader_progress();
326     void on_loader_finished();
327 schoenebeck 2683 void on_loader_error();
328     void on_saver_progress();
329     void on_saver_error();
330     void on_saver_finished();
331 schoenebeck 3157 void updateMacroMenu();
332     void onMacroSelected(int iMacro);
333     void setupMacros();
334     void onMacrosSetupChanged(const std::vector<Serialization::Archive>& macros);
335     void applyMacro(Serialization::Archive& macro);
336 schoenebeck 3197 void onScriptSlotsModified(gig::Instrument* pInstrument);
337 schoenebeck 3258 void bringToFront();
338 schoenebeck 2683
339 persson 1533 void dimreg_all_dimregs_toggled();
340     gig::Instrument* get_instrument();
341     void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs);
342     void update_dimregs();
343 schoenebeck 1225
344     class ModelColumns : public Gtk::TreeModel::ColumnRecord {
345     public:
346     ModelColumns() {
347 schoenebeck 2994 add(m_col_nr);
348 schoenebeck 1225 add(m_col_name);
349     add(m_col_instr);
350 schoenebeck 3197 add(m_col_scripts);
351 schoenebeck 3418 add(m_col_tooltip);
352 schoenebeck 1225 }
353    
354 schoenebeck 2994 Gtk::TreeModelColumn<int> m_col_nr;
355 schoenebeck 1225 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
356     Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
357 schoenebeck 3197 Gtk::TreeModelColumn<Glib::ustring> m_col_scripts;
358 schoenebeck 3418 Gtk::TreeModelColumn<Glib::ustring> m_col_tooltip;
359 schoenebeck 1225 } m_Columns;
360    
361 schoenebeck 3364 VBox m_VBox;
362 schoenebeck 1225 Gtk::HPaned m_HPaned;
363    
364     Gtk::ScrolledWindow m_ScrolledWindow;
365    
366     Gtk::TreeView m_TreeView;
367     Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
368 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.
369 schoenebeck 1225
370 schoenebeck 3364 #if USE_GTKMM_BUILDER
371     Gtk::Menu* menuMacro;
372     #else
373     Gtk::Menu* instrument_menu; // kept for GTKMM 2 version only, will be completely removed in future
374     #endif
375 schoenebeck 3339 Gtk::Menu* assign_scripts_menu;
376 persson 2442
377 schoenebeck 2621 std::map<gig::Sample*,int> sample_ref_count;
378    
379 schoenebeck 1225 class SamplesModel : public Gtk::TreeModel::ColumnRecord {
380     public:
381     SamplesModel() {
382     add(m_col_name);
383     add(m_col_sample);
384     add(m_col_group);
385 schoenebeck 2621 add(m_col_refcount);
386     add(m_color);
387 schoenebeck 1225 }
388    
389     Gtk::TreeModelColumn<Glib::ustring> m_col_name;
390     Gtk::TreeModelColumn<gig::Sample*> m_col_sample;
391     Gtk::TreeModelColumn<gig::Group*> m_col_group;
392 schoenebeck 2621 Gtk::TreeModelColumn<Glib::ustring> m_col_refcount;
393     Gtk::TreeModelColumn<Glib::ustring> m_color;
394 schoenebeck 1225 } m_SamplesModel;
395    
396     class SamplesTreeStore : public Gtk::TreeStore {
397     public:
398     static Glib::RefPtr<SamplesTreeStore> create(const SamplesModel& columns) {
399     return Glib::RefPtr<SamplesTreeStore>( new SamplesTreeStore(columns) );
400     }
401     protected:
402     SamplesTreeStore(const SamplesModel& columns) : Gtk::TreeStore(columns) {}
403     };
404    
405     Gtk::ScrolledWindow m_ScrolledWindowSamples;
406     Gtk::TreeView m_TreeViewSamples;
407     Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel;
408    
409 schoenebeck 2604 class ScriptsModel : public Gtk::TreeModel::ColumnRecord {
410     public:
411     ScriptsModel() {
412     add(m_col_name);
413     add(m_col_script);
414     add(m_col_group);
415     }
416    
417     Gtk::TreeModelColumn<Glib::ustring> m_col_name;
418     Gtk::TreeModelColumn<gig::Script*> m_col_script;
419     Gtk::TreeModelColumn<gig::ScriptGroup*> m_col_group;
420     } m_ScriptsModel;
421    
422     class ScriptsTreeStore : public Gtk::TreeStore {
423     public:
424     static Glib::RefPtr<ScriptsTreeStore> create(const ScriptsModel& columns) {
425     return Glib::RefPtr<ScriptsTreeStore>( new ScriptsTreeStore(columns) );
426     }
427     protected:
428     ScriptsTreeStore(const ScriptsModel& columns) : Gtk::TreeStore(columns) {}
429     };
430    
431     Gtk::ScrolledWindow m_ScrolledWindowScripts;
432     Gtk::TreeView m_TreeViewScripts;
433     Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel;
434    
435 schoenebeck 3364 VBox dimreg_vbox;
436     HBox dimreg_hbox;
437 persson 1533 Gtk::Label dimreg_label;
438     Gtk::CheckButton dimreg_all_regions;
439     Gtk::CheckButton dimreg_all_dimregs;
440     Gtk::CheckButton dimreg_stereo;
441 schoenebeck 3106
442 schoenebeck 3364 HBox legend_hbox;
443 schoenebeck 3109 Gtk::Label labelLegend;
444 schoenebeck 3106 Gtk::Image imageNoSample;
445     Gtk::Label labelNoSample;
446     Gtk::Image imageMissingSample;
447     Gtk::Label labelMissingSample;
448     Gtk::Image imageLooped;
449     Gtk::Label labelLooped;
450     Gtk::Image imageSomeLoops;
451     Gtk::Label labelSomeLoops;
452 schoenebeck 1225 DimRegionEdit dimreg_edit;
453    
454 schoenebeck 3364 VBox m_left_vbox;
455 schoenebeck 1225 Gtk::Notebook m_TreeViewNotebook;
456 schoenebeck 3364 HBox m_searchField;
457 schoenebeck 3340 Gtk::Label m_searchLabel;
458     Gtk::Entry m_searchText;
459 schoenebeck 1225
460     struct SampleImportItem {
461     gig::Sample* gig_sample; // pointer to the gig::Sample to
462     // which the sample data should be
463     // imported to
464     Glib::ustring sample_path; // file name of the sample to be
465     // imported
466     };
467 schoenebeck 3116 std::map<gig::Sample*, SampleImportItem> m_SampleImportQueue;
468 schoenebeck 1225
469    
470     void on_action_file_new();
471     void on_action_file_open();
472     void on_action_file_save();
473     void on_action_file_save_as();
474     void on_action_file_properties();
475 persson 1261 void on_action_quit();
476 schoenebeck 1225 void show_instr_props();
477 persson 2445 bool instr_props_set_instrument();
478 persson 2507 void show_midi_rules();
479 schoenebeck 2610 void show_script_slots();
480 schoenebeck 1415 void on_action_view_status_bar();
481 schoenebeck 2918 void on_auto_restore_win_dim();
482 schoenebeck 2967 void on_save_with_temporary_file();
483 schoenebeck 2772 void on_action_refresh_all();
484 schoenebeck 2541 void on_action_warn_user_on_extensions();
485 schoenebeck 3409 void on_action_show_tooltips();
486     void on_show_tooltips_changed();
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 schoenebeck 3418 bool onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
565 persson 2442
566 schoenebeck 2683 ProgressDialog* progress_dialog;
567 schoenebeck 1225 Loader* loader;
568 schoenebeck 2683 Saver* saver;
569 schoenebeck 1382 void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false);
570 schoenebeck 2621 void updateSampleRefCountMap(gig::File* gig);
571 schoenebeck 1225
572     gig::File* file;
573 schoenebeck 1382 bool file_is_shared;
574 persson 1261 bool file_has_name;
575     bool file_is_changed;
576     std::string filename;
577 persson 1725 std::string current_gig_dir;
578     std::string current_sample_dir;
579 schoenebeck 1225
580 schoenebeck 1411 void set_file_is_shared(bool);
581    
582 persson 1261 bool file_save();
583     bool file_save_as();
584 persson 1303 bool check_if_savable();
585 persson 1261
586 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
587     bool on_button_release(Gdk::EventButton& button);
588     #else
589 schoenebeck 1225 void on_button_release(GdkEventButton* button);
590 schoenebeck 3364 #endif
591 schoenebeck 2701 void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
592     void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
593     Gtk::SelectionData& selection_data, guint, guint);
594     void on_instruments_treeview_drop_drag_data_received(
595     const Glib::RefPtr<Gdk::DragContext>& context, int, int,
596     const Gtk::SelectionData& selection_data, guint, guint time
597     );
598 schoenebeck 2610 void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
599     void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
600     Gtk::SelectionData& selection_data, guint, guint);
601 persson 1303 void on_sample_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
602 schoenebeck 1225 void on_sample_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
603     Gtk::SelectionData& selection_data, guint, guint);
604     void on_sample_label_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context,
605     int, int,
606     const Gtk::SelectionData& selection_data,
607     guint, guint time);
608 persson 1303
609 schoenebeck 2604 void script_name_changed(const Gtk::TreeModel::Path& path,
610     const Gtk::TreeModel::iterator& iter);
611 schoenebeck 2644 void script_double_clicked(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
612 schoenebeck 1225 void sample_name_changed(const Gtk::TreeModel::Path& path,
613     const Gtk::TreeModel::iterator& iter);
614     void instrument_name_changed(const Gtk::TreeModel::Path& path,
615     const Gtk::TreeModel::iterator& iter);
616 persson 2445 void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it);
617 schoenebeck 3340 bool instrument_row_visible(const Gtk::TreeModel::const_iterator& iter);
618 persson 2442 sigc::connection instrument_name_connection;
619 schoenebeck 1225
620 schoenebeck 2548 void on_action_combine_instruments();
621 schoenebeck 2624 void on_action_view_references();
622 schoenebeck 2553 void on_action_merge_files();
623     void mergeFiles(const std::vector<std::string>& filenames);
624 schoenebeck 2548
625 schoenebeck 2621 void on_sample_ref_changed(gig::Sample* oldSample, gig::Sample* newSample);
626     void on_sample_ref_count_incremented(gig::Sample* sample, int offset);
627     void on_samples_to_be_removed(std::list<gig::Sample*> samples);
628    
629 schoenebeck 2715 void add_or_replace_sample(bool replace);
630    
631 schoenebeck 1225 void __import_queued_samples();
632     void __clear();
633 schoenebeck 2553 void __refreshEntireGUI();
634 schoenebeck 3339 void updateScriptListOfMenu();
635     void assignScript(gig::Script* pScript);
636 schoenebeck 3419 void dropAllScriptSlots();
637 schoenebeck 1225
638 persson 1261 bool close_confirmation_dialog();
639 schoenebeck 1382 bool leaving_shared_mode_dialog();
640 persson 1261
641 schoenebeck 1225 Gtk::Menu* popup_menu;
642 schoenebeck 3364 #if USE_GTKMM_BUILDER
643     Gtk::Menu* sample_popup;
644     Gtk::Menu* script_popup;
645     #endif
646 persson 1261
647     bool on_delete_event(GdkEventAny* event);
648 persson 1303
649     bool first_call_to_drag_data_get;
650 persson 3469
651 schoenebeck 2464 bool is_copy_samples_unity_note_enabled() const;
652     bool is_copy_samples_fine_tune_enabled() const;
653     bool is_copy_samples_loop_enabled() const;
654 schoenebeck 1225 };
655    
656     #endif

  ViewVC Help
Powered by ViewVC