1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006 - 2015 Andreas Persson |
* Copyright (C) 2006 - 2016 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 |
22 |
|
|
23 |
#include <gig.h> |
#include <gig.h> |
24 |
|
|
25 |
|
#include <gtkmm/box.h> |
26 |
#include <gtkmm/actiongroup.h> |
#include <gtkmm/actiongroup.h> |
27 |
#include <gtkmm/buttonbox.h> |
#include <gtkmm/buttonbox.h> |
28 |
#include <gtkmm/dialog.h> |
#include <gtkmm/dialog.h> |
47 |
#ifndef OLD_THREADS |
#ifndef OLD_THREADS |
48 |
#include <glibmm/threads.h> |
#include <glibmm/threads.h> |
49 |
#endif |
#endif |
50 |
|
#include "ManagedWindow.h" |
51 |
|
|
52 |
class MainWindow; |
class MainWindow; |
53 |
|
|
54 |
class PropDialog : public Gtk::Window, |
class PropDialog : public ManagedWindow, |
55 |
public PropEditor<DLS::Info> { |
public PropEditor<DLS::Info> { |
56 |
public: |
public: |
57 |
PropDialog(); |
PropDialog(); |
58 |
void set_info(DLS::Info* info); |
void set_info(DLS::Info* info); |
59 |
void set_file(gig::File* file); |
void set_file(gig::File* file); |
60 |
|
|
61 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
62 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->filePropsWindowX; } |
63 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->filePropsWindowY; } |
64 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->filePropsWindowW; } |
65 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->filePropsWindowH; } |
66 |
|
|
67 |
protected: |
protected: |
68 |
ChoiceEntry<int> eFileFormat; |
ChoiceEntry<int> eFileFormat; |
69 |
StringEntry eName; |
StringEntry eName; |
92 |
void onFileFormatChanged(); |
void onFileFormatChanged(); |
93 |
}; |
}; |
94 |
|
|
95 |
class InstrumentProps : public Gtk::Window, |
class InstrumentProps : public ManagedWindow, |
96 |
public PropEditor<gig::Instrument> { |
public PropEditor<gig::Instrument> { |
97 |
public: |
public: |
98 |
InstrumentProps(); |
InstrumentProps(); |
102 |
sigc::signal<void>& signal_name_changed() { |
sigc::signal<void>& signal_name_changed() { |
103 |
return sig_name_changed; |
return sig_name_changed; |
104 |
} |
} |
105 |
|
|
106 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
107 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->instrPropsWindowX; } |
108 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->instrPropsWindowY; } |
109 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->instrPropsWindowW; } |
110 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->instrPropsWindowH; } |
111 |
|
|
112 |
protected: |
protected: |
113 |
void set_Name(const gig::String& name); |
void set_Name(const gig::String& name); |
114 |
void set_IsDrum(bool value); |
void set_IsDrum(bool value); |
188 |
float progress; |
float progress; |
189 |
}; |
}; |
190 |
|
|
191 |
class MainWindow : public Gtk::Window { |
class MainWindow : public ManagedWindow { |
192 |
public: |
public: |
193 |
MainWindow(); |
MainWindow(); |
194 |
virtual ~MainWindow(); |
virtual ~MainWindow(); |
214 |
|
|
215 |
sigc::signal<void, gig::Instrument*>& signal_switch_sampler_instrument(); |
sigc::signal<void, gig::Instrument*>& signal_switch_sampler_instrument(); |
216 |
|
|
217 |
|
sigc::signal<void, gig::Script*> signal_script_to_be_changed; |
218 |
|
sigc::signal<void, gig::Script*> signal_script_changed; |
219 |
|
|
220 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
221 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->mainWindowX; } |
222 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->mainWindowY; } |
223 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->mainWindowW; } |
224 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->mainWindowH; } |
225 |
|
|
226 |
protected: |
protected: |
227 |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
228 |
Glib::RefPtr<Gtk::UIManager> uiManager; |
Glib::RefPtr<Gtk::UIManager> uiManager; |
258 |
void on_sel_change(); |
void on_sel_change(); |
259 |
void region_changed(); |
void region_changed(); |
260 |
void dimreg_changed(); |
void dimreg_changed(); |
261 |
|
void select_instrument(gig::Instrument* instrument); |
262 |
|
bool select_dimension_region(gig::DimensionRegion* dimRgn); |
263 |
void select_sample(gig::Sample* sample); |
void select_sample(gig::Sample* sample); |
264 |
void on_loader_progress(); |
void on_loader_progress(); |
265 |
void on_loader_finished(); |
void on_loader_finished(); |
383 |
void show_midi_rules(); |
void show_midi_rules(); |
384 |
void show_script_slots(); |
void show_script_slots(); |
385 |
void on_action_view_status_bar(); |
void on_action_view_status_bar(); |
386 |
|
void on_action_refresh_all(); |
387 |
void on_action_warn_user_on_extensions(); |
void on_action_warn_user_on_extensions(); |
388 |
void on_action_sync_sampler_instrument_selection(); |
void on_action_sync_sampler_instrument_selection(); |
389 |
|
void on_action_move_root_note_with_region_moved(); |
390 |
void on_action_help_about(); |
void on_action_help_about(); |
391 |
|
|
392 |
// sample right-click popup actions |
// sample right-click popup actions |
394 |
void on_action_sample_properties(); |
void on_action_sample_properties(); |
395 |
void on_action_add_group(); |
void on_action_add_group(); |
396 |
void on_action_add_sample(); |
void on_action_add_sample(); |
397 |
|
void on_action_replace_sample(); |
398 |
void on_action_replace_all_samples_in_all_groups(); |
void on_action_replace_all_samples_in_all_groups(); |
399 |
void on_action_remove_sample(); |
void on_action_remove_sample(); |
400 |
|
void on_action_remove_unused_samples(); |
401 |
|
|
402 |
// script right-click popup actions |
// script right-click popup actions |
403 |
void on_script_treeview_button_release(GdkEventButton* button); |
void on_script_treeview_button_release(GdkEventButton* button); |
404 |
void on_action_add_script_group(); |
void on_action_add_script_group(); |
440 |
bool check_if_savable(); |
bool check_if_savable(); |
441 |
|
|
442 |
void on_button_release(GdkEventButton* button); |
void on_button_release(GdkEventButton* button); |
443 |
|
void on_instruments_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
444 |
|
void on_instruments_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
445 |
|
Gtk::SelectionData& selection_data, guint, guint); |
446 |
|
void on_instruments_treeview_drop_drag_data_received( |
447 |
|
const Glib::RefPtr<Gdk::DragContext>& context, int, int, |
448 |
|
const Gtk::SelectionData& selection_data, guint, guint time |
449 |
|
); |
450 |
void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
void on_scripts_treeview_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context); |
451 |
void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
void on_scripts_treeview_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, |
452 |
Gtk::SelectionData& selection_data, guint, guint); |
Gtk::SelectionData& selection_data, guint, guint); |
477 |
void on_sample_ref_count_incremented(gig::Sample* sample, int offset); |
void on_sample_ref_count_incremented(gig::Sample* sample, int offset); |
478 |
void on_samples_to_be_removed(std::list<gig::Sample*> samples); |
void on_samples_to_be_removed(std::list<gig::Sample*> samples); |
479 |
|
|
480 |
|
void add_or_replace_sample(bool replace); |
481 |
|
|
482 |
void __import_queued_samples(); |
void __import_queued_samples(); |
483 |
void __clear(); |
void __clear(); |
484 |
void __refreshEntireGUI(); |
void __refreshEntireGUI(); |