32 |
#include <gtkmm/treestore.h> |
#include <gtkmm/treestore.h> |
33 |
#include <gtkmm/uimanager.h> |
#include <gtkmm/uimanager.h> |
34 |
#include <gtkmm/window.h> |
#include <gtkmm/window.h> |
35 |
|
#include <gtkmm/statusbar.h> |
36 |
|
#include <gtkmm/image.h> |
37 |
|
|
38 |
#include <sstream> |
#include <sstream> |
39 |
|
|
57 |
public: |
public: |
58 |
InstrumentProps(); |
InstrumentProps(); |
59 |
void set_instrument(gig::Instrument* instrument); |
void set_instrument(gig::Instrument* instrument); |
60 |
sigc::signal<void> signal_instrument_changed(); |
sigc::signal<void>& signal_instrument_changed(); |
61 |
protected: |
protected: |
62 |
|
gig::Instrument* instrument; |
63 |
|
int update_model; |
64 |
|
|
65 |
|
template<typename T> |
66 |
|
void set_value(T value, sigc::slot<void, InstrumentProps*, T> setter) { |
67 |
|
if (update_model == 0) { |
68 |
|
setter(this, value); |
69 |
|
instrument_changed(); |
70 |
|
} |
71 |
|
} |
72 |
|
|
73 |
|
template<typename C, typename T> |
74 |
|
void connect(C& widget, T gig::Instrument::* member) { |
75 |
|
widget.signal_value_changed().connect( |
76 |
|
sigc::compose( |
77 |
|
sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>), |
78 |
|
sigc::bind(sigc::mem_fun(&InstrumentProps::set_member<T>), member)), |
79 |
|
sigc::mem_fun(widget, &C::get_value))); |
80 |
|
} |
81 |
|
|
82 |
|
template<typename C, typename T> |
83 |
|
void connect(C& widget, void (InstrumentProps::*setter)(T)) { |
84 |
|
widget.signal_value_changed().connect( |
85 |
|
sigc::compose( |
86 |
|
sigc::bind(sigc::mem_fun(*this, &InstrumentProps::set_value<T>), |
87 |
|
sigc::mem_fun(setter)), |
88 |
|
sigc::mem_fun(widget, &C::get_value))); |
89 |
|
} |
90 |
|
|
91 |
|
template<typename T> |
92 |
|
void set_member(T value, T gig::Instrument::* member) { |
93 |
|
instrument->*member = value; |
94 |
|
} |
95 |
|
|
96 |
|
void set_IsDrum(bool value); |
97 |
|
void set_MIDIBank(uint16_t value); |
98 |
|
void set_MIDIProgram(uint32_t value); |
99 |
|
void set_DimensionKeyRange_low(uint8_t value); |
100 |
|
void set_DimensionKeyRange_high(uint8_t value); |
101 |
|
|
102 |
Gtk::VBox vbox; |
Gtk::VBox vbox; |
103 |
Gtk::HButtonBox buttonBox; |
Gtk::HButtonBox buttonBox; |
104 |
Gtk::Button quitButton; |
Gtk::Button quitButton; |
119 |
void add_prop(BoolEntry& prop); |
void add_prop(BoolEntry& prop); |
120 |
void add_prop(BoolEntryPlus6& prop); |
void add_prop(BoolEntryPlus6& prop); |
121 |
void add_prop(LabelWidget& prop); |
void add_prop(LabelWidget& prop); |
|
void key_range_low_changed(); |
|
|
void key_range_high_changed(); |
|
122 |
sigc::signal<void> instrument_changed; |
sigc::signal<void> instrument_changed; |
123 |
}; |
}; |
124 |
|
|
157 |
void load_file(const char* name); |
void load_file(const char* name); |
158 |
void load_instrument(gig::Instrument* instr); |
void load_instrument(gig::Instrument* instr); |
159 |
void file_changed(); |
void file_changed(); |
160 |
|
sigc::signal<void, gig::File*>& signal_file_structure_to_be_changed(); |
161 |
|
sigc::signal<void, gig::File*>& signal_file_structure_changed(); |
162 |
|
sigc::signal<void, std::list<gig::Sample*> >& signal_samples_to_be_removed(); |
163 |
|
sigc::signal<void>& signal_samples_removed(); |
164 |
|
sigc::signal<void, gig::Region*>& signal_region_to_be_changed(); |
165 |
|
sigc::signal<void, gig::Region*>& signal_region_changed(); |
166 |
|
sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed(); |
167 |
|
sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed(); |
168 |
|
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed(); |
169 |
|
|
170 |
protected: |
protected: |
171 |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
172 |
Glib::RefPtr<Gtk::UIManager> uiManager; |
Glib::RefPtr<Gtk::UIManager> uiManager; |
173 |
|
|
174 |
|
Gtk::Statusbar m_StatusBar; |
175 |
|
Gtk::Label m_AttachedStateLabel; |
176 |
|
Gtk::Image m_AttachedStateImage; |
177 |
|
|
178 |
RegionChooser m_RegionChooser; |
RegionChooser m_RegionChooser; |
179 |
DimRegionChooser m_DimRegionChooser; |
DimRegionChooser m_DimRegionChooser; |
180 |
|
|
181 |
PropDialog propDialog; |
PropDialog propDialog; |
182 |
InstrumentProps instrumentProps; |
InstrumentProps instrumentProps; |
183 |
|
|
184 |
|
sigc::signal<void, gig::File*> file_structure_to_be_changed_signal; |
185 |
|
sigc::signal<void, gig::File*> file_structure_changed_signal; |
186 |
|
sigc::signal<void, std::list<gig::Sample*> > samples_to_be_removed_signal; |
187 |
|
sigc::signal<void> samples_removed_signal; |
188 |
|
sigc::signal<void, gig::Region*> region_to_be_changed_signal; |
189 |
|
sigc::signal<void, gig::Region*> region_changed_signal; |
190 |
|
sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal; |
191 |
|
sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal; |
192 |
|
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal; |
193 |
|
|
194 |
void on_instrument_selection_change(int index); |
void on_instrument_selection_change(int index); |
195 |
void on_sel_change(); |
void on_sel_change(); |
196 |
void region_changed(); |
void region_changed(); |
265 |
void on_action_file_properties(); |
void on_action_file_properties(); |
266 |
void on_action_quit(); |
void on_action_quit(); |
267 |
void show_instr_props(); |
void show_instr_props(); |
268 |
|
void on_action_view_status_bar(); |
269 |
void on_action_help_about(); |
void on_action_help_about(); |
270 |
|
|
271 |
// sample right-click popup actions |
// sample right-click popup actions |
280 |
|
|
281 |
LoadDialog* load_dialog; |
LoadDialog* load_dialog; |
282 |
Loader* loader; |
Loader* loader; |
283 |
void load_gig(gig::File* gig, const char* filename); |
void load_gig(gig::File* gig, const char* filename, bool isSharedInstrument = false); |
284 |
|
|
285 |
gig::File* file; |
gig::File* file; |
286 |
|
bool file_is_shared; |
287 |
bool file_has_name; |
bool file_has_name; |
288 |
bool file_is_changed; |
bool file_is_changed; |
289 |
std::string filename; |
std::string filename; |
290 |
std::string current_dir; |
std::string current_dir; |
291 |
|
|
292 |
|
void set_file_is_shared(bool); |
293 |
|
|
294 |
bool file_save(); |
bool file_save(); |
295 |
bool file_save_as(); |
bool file_save_as(); |
296 |
|
bool check_if_savable(); |
297 |
|
|
298 |
void on_button_release(GdkEventButton* button); |
void on_button_release(GdkEventButton* button); |
299 |
|
void on_sample_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
300 |
void on_sample_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
void on_sample_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
301 |
Gtk::SelectionData& selection_data, guint, guint); |
Gtk::SelectionData& selection_data, guint, guint); |
302 |
void on_sample_label_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, |
void on_sample_label_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, |
303 |
int, int, |
int, int, |
304 |
const Gtk::SelectionData& selection_data, |
const Gtk::SelectionData& selection_data, |
305 |
guint, guint time); |
guint, guint time); |
306 |
|
|
307 |
void sample_name_changed(const Gtk::TreeModel::Path& path, |
void sample_name_changed(const Gtk::TreeModel::Path& path, |
308 |
const Gtk::TreeModel::iterator& iter); |
const Gtk::TreeModel::iterator& iter); |
309 |
void instrument_name_changed(const Gtk::TreeModel::Path& path, |
void instrument_name_changed(const Gtk::TreeModel::Path& path, |
313 |
void __clear(); |
void __clear(); |
314 |
|
|
315 |
bool close_confirmation_dialog(); |
bool close_confirmation_dialog(); |
316 |
|
bool leaving_shared_mode_dialog(); |
317 |
|
|
318 |
Gtk::Menu* popup_menu; |
Gtk::Menu* popup_menu; |
319 |
|
|
320 |
bool on_delete_event(GdkEventAny* event); |
bool on_delete_event(GdkEventAny* event); |
321 |
|
|
322 |
|
bool first_call_to_drag_data_get; |
323 |
}; |
}; |
324 |
|
|
325 |
#endif |
#endif |