/[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 3472 - (hide annotations) (download) (as text)
Sat Feb 16 19:56:56 2019 UTC (5 years, 2 months ago) by persson
File MIME type: text/x-c++hdr
File size: 24889 byte(s)
* Use std::thread when building with newer glibmm, as Glib::Thread is
  deprecated

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

  ViewVC Help
Powered by ViewVC