1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006 - 2008 Andreas Persson |
* Copyright (C) 2006 - 2017 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
20 |
#ifndef GIGEDIT_MAINWINDOW_H |
#ifndef GIGEDIT_MAINWINDOW_H |
21 |
#define GIGEDIT_MAINWINDOW_H |
#define GIGEDIT_MAINWINDOW_H |
22 |
|
|
23 |
#include <gig.h> |
#ifdef LIBGIG_HEADER_FILE |
24 |
|
# include LIBGIG_HEADER_FILE(gig.h) |
25 |
|
# include LIBGIG_HEADER_FILE(Serialization.h) |
26 |
|
#else |
27 |
|
# include <gig.h> |
28 |
|
# include <Serialization.h> |
29 |
|
#endif |
30 |
|
|
31 |
|
#include <gtkmm/box.h> |
32 |
#include <gtkmm/actiongroup.h> |
#include <gtkmm/actiongroup.h> |
33 |
#include <gtkmm/buttonbox.h> |
#include <gtkmm/buttonbox.h> |
34 |
#include <gtkmm/dialog.h> |
#include <gtkmm/dialog.h> |
35 |
#include <gtkmm/liststore.h> |
#include <gtkmm/liststore.h> |
36 |
|
#include <gtkmm/menu.h> |
37 |
#include <gtkmm/paned.h> |
#include <gtkmm/paned.h> |
38 |
#include <gtkmm/progressbar.h> |
#include <gtkmm/progressbar.h> |
39 |
|
#include <gtkmm/radiomenuitem.h> |
40 |
#include <gtkmm/scrolledwindow.h> |
#include <gtkmm/scrolledwindow.h> |
41 |
#include <gtkmm/treestore.h> |
#include <gtkmm/treestore.h> |
42 |
#include <gtkmm/uimanager.h> |
#include <gtkmm/uimanager.h> |
49 |
#include "regionchooser.h" |
#include "regionchooser.h" |
50 |
#include "dimregionchooser.h" |
#include "dimregionchooser.h" |
51 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
52 |
|
#include "midirules.h" |
53 |
|
#ifndef OLD_THREADS |
54 |
|
#include <glibmm/threads.h> |
55 |
|
#endif |
56 |
|
#include "ManagedWindow.h" |
57 |
|
|
58 |
class MainWindow; |
class MainWindow; |
59 |
|
|
60 |
class Table : public Gtk::Table |
class PropDialog : public ManagedWindow, |
61 |
{ |
public PropEditor<DLS::Info> { |
|
public: |
|
|
Table(int x, int y); |
|
|
void add(BoolEntry& boolentry); |
|
|
void add(BoolEntryPlus6& boolentry); |
|
|
void add(LabelWidget& labelwidget); |
|
|
private: |
|
|
int rowno; |
|
|
}; |
|
|
|
|
|
class PropDialog : public Gtk::Window { |
|
62 |
public: |
public: |
63 |
PropDialog(); |
PropDialog(); |
64 |
void set_info(DLS::Info* info); |
void set_info(DLS::Info* info); |
65 |
sigc::signal<void>& signal_info_changed(); |
void set_file(gig::File* file); |
66 |
|
|
67 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
68 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->filePropsWindowX; } |
69 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->filePropsWindowY; } |
70 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->filePropsWindowW; } |
71 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->filePropsWindowH; } |
72 |
|
|
73 |
protected: |
protected: |
74 |
sigc::signal<void> info_changed; |
ChoiceEntry<int> eFileFormat; |
75 |
StringEntry eName; |
StringEntry eName; |
76 |
StringEntry eCreationDate; |
StringEntry eCreationDate; |
77 |
StringEntryMultiLine eComments; |
StringEntryMultiLine eComments; |
92 |
Gtk::HButtonBox buttonBox; |
Gtk::HButtonBox buttonBox; |
93 |
Gtk::Button quitButton; |
Gtk::Button quitButton; |
94 |
Table table; |
Table table; |
|
int update_model; |
|
|
DLS::Info* info; |
|
95 |
|
|
96 |
template<typename T> |
gig::File* m_file; |
|
void set_member(T value, T DLS::Info::* member) { |
|
|
if (update_model == 0) { |
|
|
info->*member = value; |
|
|
info_changed(); |
|
|
} |
|
|
} |
|
97 |
|
|
98 |
template<typename C, typename T> |
void onFileFormatChanged(); |
|
void connect(C& widget, T DLS::Info::* member) { |
|
|
widget.signal_value_changed().connect( |
|
|
sigc::compose( |
|
|
sigc::bind(sigc::mem_fun(*this, &PropDialog::set_member<T>), member), |
|
|
sigc::mem_fun(widget, &C::get_value))); |
|
|
} |
|
99 |
}; |
}; |
100 |
|
|
101 |
class InstrumentProps : public Gtk::Window { |
class InstrumentProps : public ManagedWindow, |
102 |
|
public PropEditor<gig::Instrument> { |
103 |
public: |
public: |
104 |
InstrumentProps(); |
InstrumentProps(); |
105 |
void set_instrument(gig::Instrument* instrument); |
void set_instrument(gig::Instrument* instrument); |
106 |
sigc::signal<void>& signal_instrument_changed(); |
gig::Instrument* get_instrument() { return m; } |
107 |
protected: |
void update_name(); |
108 |
gig::Instrument* instrument; |
sigc::signal<void>& signal_name_changed() { |
109 |
int update_model; |
return sig_name_changed; |
|
|
|
|
template<typename T> |
|
|
void set_value(T value, sigc::slot<void, InstrumentProps*, T> setter) { |
|
|
if (update_model == 0) { |
|
|
setter(this, value); |
|
|
instrument_changed(); |
|
|
} |
|
|
} |
|
|
|
|
|
template<typename C, typename T> |
|
|
void connect(C& widget, T gig::Instrument::* member) { |
|
|
widget.signal_value_changed().connect( |
|
|
sigc::compose( |
|
|
sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>), |
|
|
sigc::bind(sigc::mem_fun(&InstrumentProps::set_member<T>), member)), |
|
|
sigc::mem_fun(widget, &C::get_value))); |
|
110 |
} |
} |
111 |
|
|
112 |
template<typename C, typename T> |
// implementation for abstract methods of interface class "ManagedWindow" |
113 |
void connect(C& widget, void (InstrumentProps::*setter)(T)) { |
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->instrPropsWindowX; } |
114 |
widget.signal_value_changed().connect( |
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->instrPropsWindowY; } |
115 |
sigc::compose( |
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->instrPropsWindowW; } |
116 |
sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>), |
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->instrPropsWindowH; } |
|
sigc::mem_fun(setter)), |
|
|
sigc::mem_fun(widget, &C::get_value))); |
|
|
} |
|
|
|
|
|
template<typename T> |
|
|
void set_member(T value, T gig::Instrument::* member) { |
|
|
instrument->*member = value; |
|
|
} |
|
117 |
|
|
118 |
|
protected: |
119 |
|
void set_Name(const gig::String& name); |
120 |
void set_IsDrum(bool value); |
void set_IsDrum(bool value); |
121 |
void set_MIDIBank(uint16_t value); |
void set_MIDIBank(uint16_t value); |
122 |
void set_MIDIProgram(uint32_t value); |
void set_MIDIProgram(uint32_t value); |
|
void set_DimensionKeyRange_low(uint8_t value); |
|
|
void set_DimensionKeyRange_high(uint8_t value); |
|
123 |
|
|
124 |
|
sigc::signal<void> sig_name_changed; |
125 |
Gtk::VBox vbox; |
Gtk::VBox vbox; |
126 |
Gtk::HButtonBox buttonBox; |
Gtk::HButtonBox buttonBox; |
127 |
Gtk::Button quitButton; |
Gtk::Button quitButton; |
138 |
BoolEntry ePianoReleaseMode; |
BoolEntry ePianoReleaseMode; |
139 |
NoteEntry eDimensionKeyRangeLow; |
NoteEntry eDimensionKeyRangeLow; |
140 |
NoteEntry eDimensionKeyRangeHigh; |
NoteEntry eDimensionKeyRangeHigh; |
|
sigc::signal<void> instrument_changed; |
|
141 |
}; |
}; |
142 |
|
|
143 |
class LoadDialog : public Gtk::Dialog { |
class ProgressDialog : public Gtk::Dialog { |
144 |
public: |
public: |
145 |
LoadDialog(const Glib::ustring& title, Gtk::Window& parent); |
ProgressDialog(const Glib::ustring& title, Gtk::Window& parent); |
146 |
void set_fraction(float fraction) { progressBar.set_fraction(fraction); } |
void set_fraction(float fraction) { progressBar.set_fraction(fraction); } |
147 |
protected: |
protected: |
148 |
Gtk::ProgressBar progressBar; |
Gtk::ProgressBar progressBar; |
153 |
Loader(const char* filename); |
Loader(const char* filename); |
154 |
void launch(); |
void launch(); |
155 |
Glib::Dispatcher& signal_progress(); |
Glib::Dispatcher& signal_progress(); |
156 |
Glib::Dispatcher& signal_finished(); |
Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error. |
157 |
|
Glib::Dispatcher& signal_error(); |
158 |
|
void progress_callback(float fraction); |
159 |
|
float get_progress(); |
160 |
|
const Glib::ustring filename; |
161 |
|
Glib::ustring error_message; |
162 |
|
gig::File* gig; |
163 |
|
|
164 |
|
private: |
165 |
|
Glib::Threads::Thread* thread; |
166 |
|
void thread_function(); |
167 |
|
Glib::Dispatcher finished_dispatcher; |
168 |
|
Glib::Dispatcher progress_dispatcher; |
169 |
|
Glib::Dispatcher error_dispatcher; |
170 |
|
Glib::Threads::Mutex progressMutex; |
171 |
|
float progress; |
172 |
|
}; |
173 |
|
|
174 |
|
class Saver : public sigc::trackable { |
175 |
|
public: |
176 |
|
Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as" |
177 |
|
void launch(); |
178 |
|
Glib::Dispatcher& signal_progress(); |
179 |
|
Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error. |
180 |
|
Glib::Dispatcher& signal_error(); |
181 |
void progress_callback(float fraction); |
void progress_callback(float fraction); |
182 |
float get_progress(); |
float get_progress(); |
|
const char* filename; |
|
183 |
gig::File* gig; |
gig::File* gig; |
184 |
|
const Glib::ustring filename; |
185 |
|
Glib::ustring error_message; |
186 |
|
|
187 |
private: |
private: |
188 |
Glib::Thread* thread; |
Glib::Threads::Thread* thread; |
189 |
void thread_function(); |
void thread_function(); |
190 |
Glib::Dispatcher finished_dispatcher; |
Glib::Dispatcher finished_dispatcher; |
191 |
Glib::Dispatcher progress_dispatcher; |
Glib::Dispatcher progress_dispatcher; |
192 |
Glib::Mutex progressMutex; |
Glib::Dispatcher error_dispatcher; |
193 |
|
Glib::Threads::Mutex progressMutex; |
194 |
float progress; |
float progress; |
195 |
}; |
}; |
196 |
|
|
197 |
class MainWindow : public Gtk::Window { |
class MainWindow : public ManagedWindow { |
198 |
public: |
public: |
199 |
MainWindow(); |
MainWindow(); |
200 |
virtual ~MainWindow(); |
virtual ~MainWindow(); |
209 |
sigc::signal<void, gig::Region*>& signal_region_changed(); |
sigc::signal<void, gig::Region*>& signal_region_changed(); |
210 |
sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed(); |
sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed(); |
211 |
sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed(); |
sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed(); |
212 |
|
sigc::signal<void, gig::Sample*>& signal_sample_changed(); |
213 |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed(); |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed(); |
214 |
|
|
215 |
sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on(); |
sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on(); |
218 |
sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit(); |
sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit(); |
219 |
sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released(); |
sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released(); |
220 |
|
|
221 |
|
sigc::signal<void, gig::Instrument*>& signal_switch_sampler_instrument(); |
222 |
|
|
223 |
|
sigc::signal<void, gig::Script*> signal_script_to_be_changed; |
224 |
|
sigc::signal<void, gig::Script*> signal_script_changed; |
225 |
|
|
226 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
227 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->mainWindowX; } |
228 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->mainWindowY; } |
229 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->mainWindowW; } |
230 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->mainWindowH; } |
231 |
|
|
232 |
protected: |
protected: |
233 |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
234 |
Glib::RefPtr<Gtk::UIManager> uiManager; |
Glib::RefPtr<Gtk::UIManager> uiManager; |
242 |
|
|
243 |
PropDialog propDialog; |
PropDialog propDialog; |
244 |
InstrumentProps instrumentProps; |
InstrumentProps instrumentProps; |
245 |
|
MidiRules midiRules; |
246 |
|
|
247 |
|
/** |
248 |
|
* Ensures that the 2 signals MainWindow::dimreg_to_be_changed_signal and |
249 |
|
* MainWindowv::dimreg_changed_signal are always triggered correctly as a |
250 |
|
* pair. It behaves similar to a "mutex lock guard" design pattern. |
251 |
|
*/ |
252 |
|
class DimRegionChangeGuard : public SignalGuard<gig::DimensionRegion*> { |
253 |
|
public: |
254 |
|
DimRegionChangeGuard(MainWindow* w, gig::DimensionRegion* pDimReg) : |
255 |
|
SignalGuard<gig::DimensionRegion*>(w->dimreg_to_be_changed_signal, w->dimreg_changed_signal, pDimReg) |
256 |
|
{ |
257 |
|
} |
258 |
|
}; |
259 |
|
|
260 |
sigc::signal<void, gig::File*> file_structure_to_be_changed_signal; |
sigc::signal<void, gig::File*> file_structure_to_be_changed_signal; |
261 |
sigc::signal<void, gig::File*> file_structure_changed_signal; |
sigc::signal<void, gig::File*> file_structure_changed_signal; |
265 |
sigc::signal<void, gig::Region*> region_changed_signal; |
sigc::signal<void, gig::Region*> region_changed_signal; |
266 |
sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal; |
sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal; |
267 |
sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal; |
sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal; |
268 |
|
sigc::signal<void, gig::Sample*> sample_changed_signal; |
269 |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal; |
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal; |
270 |
|
|
271 |
sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal; |
sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal; |
272 |
sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal; |
sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal; |
273 |
|
|
274 |
void on_instrument_selection_change(int index); |
sigc::signal<void, gig::Instrument*> switch_sampler_instrument_signal; |
275 |
|
|
276 |
|
void on_instrument_selection_change(Gtk::RadioMenuItem* item); |
277 |
void on_sel_change(); |
void on_sel_change(); |
278 |
void region_changed(); |
void region_changed(); |
279 |
void dimreg_changed(); |
void dimreg_changed(); |
280 |
|
void select_instrument(gig::Instrument* instrument); |
281 |
|
bool select_dimension_region(gig::DimensionRegion* dimRgn); |
282 |
|
void select_sample(gig::Sample* sample); |
283 |
void on_loader_progress(); |
void on_loader_progress(); |
284 |
void on_loader_finished(); |
void on_loader_finished(); |
285 |
|
void on_loader_error(); |
286 |
|
void on_saver_progress(); |
287 |
|
void on_saver_error(); |
288 |
|
void on_saver_finished(); |
289 |
|
void updateMacroMenu(); |
290 |
|
void onMacroSelected(int iMacro); |
291 |
|
void setupMacros(); |
292 |
|
void onMacrosSetupChanged(const std::vector<Serialization::Archive>& macros); |
293 |
|
void applyMacro(Serialization::Archive& macro); |
294 |
|
|
295 |
void dimreg_all_dimregs_toggled(); |
void dimreg_all_dimregs_toggled(); |
296 |
gig::Instrument* get_instrument(); |
gig::Instrument* get_instrument(); |
297 |
void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs); |
void add_region_to_dimregs(gig::Region* region, bool stereo, bool all_dimregs); |
300 |
class ModelColumns : public Gtk::TreeModel::ColumnRecord { |
class ModelColumns : public Gtk::TreeModel::ColumnRecord { |
301 |
public: |
public: |
302 |
ModelColumns() { |
ModelColumns() { |
303 |
|
add(m_col_nr); |
304 |
add(m_col_name); |
add(m_col_name); |
305 |
add(m_col_instr); |
add(m_col_instr); |
306 |
} |
} |
307 |
|
|
308 |
|
Gtk::TreeModelColumn<int> m_col_nr; |
309 |
Gtk::TreeModelColumn<Glib::ustring> m_col_name; |
Gtk::TreeModelColumn<Glib::ustring> m_col_name; |
310 |
Gtk::TreeModelColumn<gig::Instrument*> m_col_instr; |
Gtk::TreeModelColumn<gig::Instrument*> m_col_instr; |
311 |
} m_Columns; |
} m_Columns; |
318 |
Gtk::TreeView m_TreeView; |
Gtk::TreeView m_TreeView; |
319 |
Glib::RefPtr<Gtk::ListStore> m_refTreeModel; |
Glib::RefPtr<Gtk::ListStore> m_refTreeModel; |
320 |
|
|
321 |
|
Gtk::Menu* instrument_menu; |
322 |
|
|
323 |
|
std::map<gig::Sample*,int> sample_ref_count; |
324 |
|
|
325 |
class SamplesModel : public Gtk::TreeModel::ColumnRecord { |
class SamplesModel : public Gtk::TreeModel::ColumnRecord { |
326 |
public: |
public: |
327 |
SamplesModel() { |
SamplesModel() { |
328 |
add(m_col_name); |
add(m_col_name); |
329 |
add(m_col_sample); |
add(m_col_sample); |
330 |
add(m_col_group); |
add(m_col_group); |
331 |
|
add(m_col_refcount); |
332 |
|
add(m_color); |
333 |
} |
} |
334 |
|
|
335 |
Gtk::TreeModelColumn<Glib::ustring> m_col_name; |
Gtk::TreeModelColumn<Glib::ustring> m_col_name; |
336 |
Gtk::TreeModelColumn<gig::Sample*> m_col_sample; |
Gtk::TreeModelColumn<gig::Sample*> m_col_sample; |
337 |
Gtk::TreeModelColumn<gig::Group*> m_col_group; |
Gtk::TreeModelColumn<gig::Group*> m_col_group; |
338 |
|
Gtk::TreeModelColumn<Glib::ustring> m_col_refcount; |
339 |
|
Gtk::TreeModelColumn<Glib::ustring> m_color; |
340 |
} m_SamplesModel; |
} m_SamplesModel; |
341 |
|
|
342 |
class SamplesTreeStore : public Gtk::TreeStore { |
class SamplesTreeStore : public Gtk::TreeStore { |
352 |
Gtk::TreeView m_TreeViewSamples; |
Gtk::TreeView m_TreeViewSamples; |
353 |
Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel; |
Glib::RefPtr<SamplesTreeStore> m_refSamplesTreeModel; |
354 |
|
|
355 |
|
class ScriptsModel : public Gtk::TreeModel::ColumnRecord { |
356 |
|
public: |
357 |
|
ScriptsModel() { |
358 |
|
add(m_col_name); |
359 |
|
add(m_col_script); |
360 |
|
add(m_col_group); |
361 |
|
} |
362 |
|
|
363 |
|
Gtk::TreeModelColumn<Glib::ustring> m_col_name; |
364 |
|
Gtk::TreeModelColumn<gig::Script*> m_col_script; |
365 |
|
Gtk::TreeModelColumn<gig::ScriptGroup*> m_col_group; |
366 |
|
} m_ScriptsModel; |
367 |
|
|
368 |
|
class ScriptsTreeStore : public Gtk::TreeStore { |
369 |
|
public: |
370 |
|
static Glib::RefPtr<ScriptsTreeStore> create(const ScriptsModel& columns) { |
371 |
|
return Glib::RefPtr<ScriptsTreeStore>( new ScriptsTreeStore(columns) ); |
372 |
|
} |
373 |
|
protected: |
374 |
|
ScriptsTreeStore(const ScriptsModel& columns) : Gtk::TreeStore(columns) {} |
375 |
|
}; |
376 |
|
|
377 |
|
Gtk::ScrolledWindow m_ScrolledWindowScripts; |
378 |
|
Gtk::TreeView m_TreeViewScripts; |
379 |
|
Glib::RefPtr<ScriptsTreeStore> m_refScriptsTreeModel; |
380 |
|
|
381 |
Gtk::VBox dimreg_vbox; |
Gtk::VBox dimreg_vbox; |
382 |
Gtk::HBox dimreg_hbox; |
Gtk::HBox dimreg_hbox; |
383 |
Gtk::Label dimreg_label; |
Gtk::Label dimreg_label; |
384 |
Gtk::CheckButton dimreg_all_regions; |
Gtk::CheckButton dimreg_all_regions; |
385 |
Gtk::CheckButton dimreg_all_dimregs; |
Gtk::CheckButton dimreg_all_dimregs; |
386 |
Gtk::CheckButton dimreg_stereo; |
Gtk::CheckButton dimreg_stereo; |
387 |
|
|
388 |
|
Gtk::HBox legend_hbox; |
389 |
|
Gtk::Label labelLegend; |
390 |
|
Gtk::Image imageNoSample; |
391 |
|
Gtk::Label labelNoSample; |
392 |
|
Gtk::Image imageMissingSample; |
393 |
|
Gtk::Label labelMissingSample; |
394 |
|
Gtk::Image imageLooped; |
395 |
|
Gtk::Label labelLooped; |
396 |
|
Gtk::Image imageSomeLoops; |
397 |
|
Gtk::Label labelSomeLoops; |
398 |
DimRegionEdit dimreg_edit; |
DimRegionEdit dimreg_edit; |
399 |
|
|
|
Gtk::Notebook m_Notebook; |
|
400 |
Gtk::Notebook m_TreeViewNotebook; |
Gtk::Notebook m_TreeViewNotebook; |
401 |
|
|
402 |
struct SampleImportItem { |
struct SampleImportItem { |
406 |
Glib::ustring sample_path; // file name of the sample to be |
Glib::ustring sample_path; // file name of the sample to be |
407 |
// imported |
// imported |
408 |
}; |
}; |
409 |
std::list<SampleImportItem> m_SampleImportQueue; |
std::map<gig::Sample*, SampleImportItem> m_SampleImportQueue; |
410 |
|
|
411 |
|
|
412 |
void on_action_file_new(); |
void on_action_file_new(); |
416 |
void on_action_file_properties(); |
void on_action_file_properties(); |
417 |
void on_action_quit(); |
void on_action_quit(); |
418 |
void show_instr_props(); |
void show_instr_props(); |
419 |
|
bool instr_props_set_instrument(); |
420 |
|
void show_midi_rules(); |
421 |
|
void show_script_slots(); |
422 |
void on_action_view_status_bar(); |
void on_action_view_status_bar(); |
423 |
|
void on_auto_restore_win_dim(); |
424 |
|
void on_save_with_temporary_file(); |
425 |
|
void on_action_refresh_all(); |
426 |
|
void on_action_warn_user_on_extensions(); |
427 |
|
void on_action_sync_sampler_instrument_selection(); |
428 |
|
void on_action_move_root_note_with_region_moved(); |
429 |
void on_action_help_about(); |
void on_action_help_about(); |
430 |
|
|
431 |
// sample right-click popup actions |
// sample right-click popup actions |
433 |
void on_action_sample_properties(); |
void on_action_sample_properties(); |
434 |
void on_action_add_group(); |
void on_action_add_group(); |
435 |
void on_action_add_sample(); |
void on_action_add_sample(); |
436 |
|
void on_action_replace_sample(); |
437 |
|
void on_action_replace_all_samples_in_all_groups(); |
438 |
void on_action_remove_sample(); |
void on_action_remove_sample(); |
439 |
|
void on_action_remove_unused_samples(); |
440 |
|
|
441 |
|
// script right-click popup actions |
442 |
|
void on_script_treeview_button_release(GdkEventButton* button); |
443 |
|
void on_action_add_script_group(); |
444 |
|
void on_action_add_script(); |
445 |
|
void on_action_edit_script(); |
446 |
|
void on_action_remove_script(); |
447 |
|
|
448 |
void on_action_add_instrument(); |
void on_action_add_instrument(); |
449 |
|
void on_action_duplicate_instrument(); |
450 |
void on_action_remove_instrument(); |
void on_action_remove_instrument(); |
451 |
|
|
452 |
LoadDialog* load_dialog; |
void show_samples_tab(); |
453 |
|
void show_intruments_tab(); |
454 |
|
void show_scripts_tab(); |
455 |
|
|
456 |
|
void select_prev_region(); |
457 |
|
void select_next_region(); |
458 |
|
|
459 |
|
void select_next_dim_rgn_zone(); |
460 |
|
void select_prev_dim_rgn_zone(); |
461 |
|
void select_add_next_dim_rgn_zone(); |
462 |
|
void select_add_prev_dim_rgn_zone(); |
463 |
|
void select_prev_dimension(); |
464 |
|
void select_next_dimension(); |
465 |
|
|
466 |
|
Serialization::Archive m_serializationArchive; ///< Clipboard content. |
467 |
|
std::vector<Serialization::Archive> m_macros; ///< User configured list of macros. |
468 |
|
|
469 |
|
void copy_selected_dimrgn(); |
470 |
|
void paste_copied_dimrgn(); |
471 |
|
void adjust_clipboard_content(); |
472 |
|
void updateClipboardCopyAvailable(); |
473 |
|
void updateClipboardPasteAvailable(); |
474 |
|
void on_clipboard_owner_change(GdkEventOwnerChange* event); |
475 |
|
void on_clipboard_get(Gtk::SelectionData& selection_data, guint info); |
476 |
|
void on_clipboard_clear(); |
477 |
|
void on_clipboard_received(const Gtk::SelectionData& selection_data); |
478 |
|
void on_clipboard_received_targets(const std::vector<Glib::ustring>& targets); |
479 |
|
|
480 |
|
void add_instrument(gig::Instrument* instrument); |
481 |
|
Gtk::RadioMenuItem* add_instrument_to_menu(const Glib::ustring& name, |
482 |
|
int position = -1); |
483 |
|
void remove_instrument_from_menu(int index); |
484 |
|
|
485 |
|
ProgressDialog* progress_dialog; |
486 |
Loader* loader; |
Loader* loader; |
487 |
|
Saver* saver; |
488 |
void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false); |
void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false); |
489 |
|
void updateSampleRefCountMap(gig::File* gig); |
490 |
|
|
491 |
gig::File* file; |
gig::File* file; |
492 |
bool file_is_shared; |
bool file_is_shared; |
493 |
bool file_has_name; |
bool file_has_name; |
494 |
bool file_is_changed; |
bool file_is_changed; |
495 |
std::string filename; |
std::string filename; |
496 |
std::string current_dir; |
std::string current_gig_dir; |
497 |
|
std::string current_sample_dir; |
498 |
|
|
499 |
void set_file_is_shared(bool); |
void set_file_is_shared(bool); |
500 |
|
|
503 |
bool check_if_savable(); |
bool check_if_savable(); |
504 |
|
|
505 |
void on_button_release(GdkEventButton* button); |
void on_button_release(GdkEventButton* button); |
506 |
|
void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
507 |
|
void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
508 |
|
Gtk::SelectionData& selection_data, guint, guint); |
509 |
|
void on_instruments_treeview_drop_drag_data_received( |
510 |
|
const Glib::RefPtr<Gdk::DragContext>& context, int, int, |
511 |
|
const Gtk::SelectionData& selection_data, guint, guint time |
512 |
|
); |
513 |
|
void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
514 |
|
void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
515 |
|
Gtk::SelectionData& selection_data, guint, guint); |
516 |
void on_sample_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
void on_sample_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
517 |
void on_sample_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
void on_sample_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
518 |
Gtk::SelectionData& selection_data, guint, guint); |
Gtk::SelectionData& selection_data, guint, guint); |
521 |
const Gtk::SelectionData& selection_data, |
const Gtk::SelectionData& selection_data, |
522 |
guint, guint time); |
guint, guint time); |
523 |
|
|
524 |
|
void script_name_changed(const Gtk::TreeModel::Path& path, |
525 |
|
const Gtk::TreeModel::iterator& iter); |
526 |
|
void script_double_clicked(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); |
527 |
void sample_name_changed(const Gtk::TreeModel::Path& path, |
void sample_name_changed(const Gtk::TreeModel::Path& path, |
528 |
const Gtk::TreeModel::iterator& iter); |
const Gtk::TreeModel::iterator& iter); |
529 |
void instrument_name_changed(const Gtk::TreeModel::Path& path, |
void instrument_name_changed(const Gtk::TreeModel::Path& path, |
530 |
const Gtk::TreeModel::iterator& iter); |
const Gtk::TreeModel::iterator& iter); |
531 |
|
void instr_name_changed_by_instr_props(Gtk::TreeModel::iterator& it); |
532 |
|
sigc::connection instrument_name_connection; |
533 |
|
|
534 |
|
void on_action_combine_instruments(); |
535 |
|
void on_action_view_references(); |
536 |
|
void on_action_merge_files(); |
537 |
|
void mergeFiles(const std::vector<std::string>& filenames); |
538 |
|
|
539 |
|
void on_sample_ref_changed(gig::Sample* oldSample, gig::Sample* newSample); |
540 |
|
void on_sample_ref_count_incremented(gig::Sample* sample, int offset); |
541 |
|
void on_samples_to_be_removed(std::list<gig::Sample*> samples); |
542 |
|
|
543 |
|
void add_or_replace_sample(bool replace); |
544 |
|
|
545 |
void __import_queued_samples(); |
void __import_queued_samples(); |
546 |
void __clear(); |
void __clear(); |
547 |
|
void __refreshEntireGUI(); |
548 |
|
|
549 |
bool close_confirmation_dialog(); |
bool close_confirmation_dialog(); |
550 |
bool leaving_shared_mode_dialog(); |
bool leaving_shared_mode_dialog(); |
554 |
bool on_delete_event(GdkEventAny* event); |
bool on_delete_event(GdkEventAny* event); |
555 |
|
|
556 |
bool first_call_to_drag_data_get; |
bool first_call_to_drag_data_get; |
557 |
|
|
558 |
|
bool is_copy_samples_unity_note_enabled() const; |
559 |
|
bool is_copy_samples_fine_tune_enabled() const; |
560 |
|
bool is_copy_samples_loop_enabled() const; |
561 |
}; |
}; |
562 |
|
|
563 |
#endif |
#endif |