start using ActionMap in preference to ActionManager
This commit is contained in:
parent
eb48c14ec4
commit
4423945643
@ -255,42 +255,42 @@ ARDOUR_UI::setup_transport ()
|
|||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
/* setup actions */
|
/* setup actions */
|
||||||
|
|
||||||
act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
|
act = global_actions.find_action (X_("Transport"), X_("ToggleExternalSync"));
|
||||||
sync_button.set_related_action (act);
|
sync_button.set_related_action (act);
|
||||||
sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
|
sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
|
||||||
|
|
||||||
sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
|
sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
|
||||||
|
|
||||||
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
|
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
|
||||||
act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
|
act = global_actions.find_action (X_("Main"), X_("cancel-solo"));
|
||||||
solo_alert_button.set_related_action (act);
|
solo_alert_button.set_related_action (act);
|
||||||
auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
|
auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
|
||||||
error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
|
error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
|
||||||
act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
|
act = editor->find_action (X_("Editor"), X_("toggle-log-window"));
|
||||||
error_alert_button.set_related_action(act);
|
error_alert_button.set_related_action(act);
|
||||||
error_alert_button.set_fallthrough_to_parent(true);
|
error_alert_button.set_fallthrough_to_parent(true);
|
||||||
|
|
||||||
layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
|
layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
|
||||||
|
|
||||||
editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
|
editor_visibility_button.set_related_action (global_actions.find_action (X_("Common"), X_("change-editor-visibility")));
|
||||||
mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
|
mixer_visibility_button.set_related_action (global_actions.find_action (X_("Common"), X_("change-mixer-visibility")));
|
||||||
prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
|
prefs_visibility_button.set_related_action (global_actions.find_action (X_("Common"), X_("change-preferences-visibility")));
|
||||||
|
|
||||||
act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
|
act = global_actions.find_action ("Transport", "ToggleAutoReturn");
|
||||||
auto_return_button.set_related_action (act);
|
auto_return_button.set_related_action (act);
|
||||||
act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
|
act = global_actions.find_action (X_("Transport"), X_("ToggleFollowEdits"));
|
||||||
follow_edits_button.set_related_action (act);
|
follow_edits_button.set_related_action (act);
|
||||||
act = ActionManager::get_action ("Transport", "ToggleAutoInput");
|
act = global_actions.find_action ("Transport", "ToggleAutoInput");
|
||||||
auto_input_button.set_related_action (act);
|
auto_input_button.set_related_action (act);
|
||||||
|
|
||||||
act = ActionManager::get_action ("Transport", "TogglePunchIn");
|
act = global_actions.find_action ("Transport", "TogglePunchIn");
|
||||||
punch_in_button.set_related_action (act);
|
punch_in_button.set_related_action (act);
|
||||||
act = ActionManager::get_action ("Transport", "TogglePunchOut");
|
act = global_actions.find_action ("Transport", "TogglePunchOut");
|
||||||
punch_out_button.set_related_action (act);
|
punch_out_button.set_related_action (act);
|
||||||
|
|
||||||
act = ActionManager::get_action ("Transport", "SessionMonitorIn");
|
act = global_actions.find_action ("Transport", "SessionMonitorIn");
|
||||||
monitor_in_button.set_related_action (act);
|
monitor_in_button.set_related_action (act);
|
||||||
act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
|
act = global_actions.find_action ("Transport", "SessionMonitorDisk");
|
||||||
monitor_disk_button.set_related_action (act);
|
monitor_disk_button.set_related_action (act);
|
||||||
|
|
||||||
/* connect signals */
|
/* connect signals */
|
||||||
@ -594,7 +594,7 @@ ARDOUR_UI::error_alert_press (GdkEventButton* ev)
|
|||||||
if (ev->button == 1) {
|
if (ev->button == 1) {
|
||||||
if (_log_not_acknowledged == LogLevelError) {
|
if (_log_not_acknowledged == LogLevelError) {
|
||||||
// just acknowledge the error, don't hide the log if it's already visible
|
// just acknowledge the error, don't hide the log if it's already visible
|
||||||
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
|
RefPtr<Action> act = editor->find_action (X_("Editor"), X_("toggle-log-window"));
|
||||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||||
if (tact && tact->get_active()) {
|
if (tact && tact->get_active()) {
|
||||||
do_toggle = false;
|
do_toggle = false;
|
||||||
@ -781,7 +781,7 @@ ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
|
|||||||
void
|
void
|
||||||
ARDOUR_UI::toggle_follow_edits ()
|
ARDOUR_UI::toggle_follow_edits ()
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
|
RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("ToggleFollowEdits"));
|
||||||
assert (act);
|
assert (act);
|
||||||
|
|
||||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
|
||||||
|
@ -448,7 +448,6 @@ Editor::Editor ()
|
|||||||
, _stepping_axis_view (0)
|
, _stepping_axis_view (0)
|
||||||
, quantize_dialog (0)
|
, quantize_dialog (0)
|
||||||
, _main_menu_disabler (0)
|
, _main_menu_disabler (0)
|
||||||
, myactions (X_("editor"))
|
|
||||||
{
|
{
|
||||||
/* we are a singleton */
|
/* we are a singleton */
|
||||||
|
|
||||||
|
@ -2318,8 +2318,6 @@ private:
|
|||||||
void toggle_reg_sens (Glib::RefPtr<Gtk::ActionGroup> group, char const * name, char const * label, sigc::slot<void> slot);
|
void toggle_reg_sens (Glib::RefPtr<Gtk::ActionGroup> group, char const * name, char const * label, sigc::slot<void> slot);
|
||||||
void radio_reg_sens (Glib::RefPtr<Gtk::ActionGroup> action_group, Gtk::RadioAction::Group& radio_group, char const * name, char const * label, sigc::slot<void> slot);
|
void radio_reg_sens (Glib::RefPtr<Gtk::ActionGroup> action_group, Gtk::RadioAction::Group& radio_group, char const * name, char const * label, sigc::slot<void> slot);
|
||||||
|
|
||||||
Gtkmm2ext::ActionMap myactions;
|
|
||||||
|
|
||||||
friend class Drag;
|
friend class Drag;
|
||||||
friend class RegionCutDrag;
|
friend class RegionCutDrag;
|
||||||
friend class RegionDrag;
|
friend class RegionDrag;
|
||||||
|
@ -100,6 +100,7 @@ Mixer_UI::instance ()
|
|||||||
|
|
||||||
Mixer_UI::Mixer_UI ()
|
Mixer_UI::Mixer_UI ()
|
||||||
: Tabbable (_content, _("Mixer"))
|
: Tabbable (_content, _("Mixer"))
|
||||||
|
, ActionMapOwner (X_("mixer"))
|
||||||
, no_track_list_redisplay (false)
|
, no_track_list_redisplay (false)
|
||||||
, in_group_row_change (false)
|
, in_group_row_change (false)
|
||||||
, track_menu (0)
|
, track_menu (0)
|
||||||
@ -113,7 +114,6 @@ Mixer_UI::Mixer_UI ()
|
|||||||
, _maximised (false)
|
, _maximised (false)
|
||||||
, _show_mixer_list (true)
|
, _show_mixer_list (true)
|
||||||
, _strip_selection_change_without_scroll (false)
|
, _strip_selection_change_without_scroll (false)
|
||||||
, myactions (X_("mixer"))
|
|
||||||
, _selection (*this, *this)
|
, _selection (*this, *this)
|
||||||
{
|
{
|
||||||
register_actions ();
|
register_actions ();
|
||||||
|
@ -80,7 +80,7 @@ protected:
|
|||||||
virtual bool row_drop_possible_vfunc (const Gtk::TreeModel::Path&, const Gtk::SelectionData&) const;
|
virtual bool row_drop_possible_vfunc (const Gtk::TreeModel::Path&, const Gtk::SelectionData&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Mixer_UI : public ArdourWidgets::Tabbable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public AxisViewProvider
|
class Mixer_UI : public ArdourWidgets::Tabbable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public AxisViewProvider, public Gtkmm2ext::ActionMapOwner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Mixer_UI* instance();
|
static Mixer_UI* instance();
|
||||||
@ -407,7 +407,6 @@ private:
|
|||||||
|
|
||||||
void escape ();
|
void escape ();
|
||||||
|
|
||||||
Gtkmm2ext::ActionMap myactions;
|
|
||||||
RouteProcessorSelection _selection;
|
RouteProcessorSelection _selection;
|
||||||
AxisViewSelection _axis_targets;
|
AxisViewSelection _axis_targets;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace ArdourWidgets {
|
|||||||
class TearOff;
|
class TearOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MonitorSection : public RouteUI, public Gtk::EventBox
|
class MonitorSection : public RouteUI, public Gtk::EventBox, public Gtkmm2ext::StaticActionMapOwner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MonitorSection (ARDOUR::Session*);
|
MonitorSection (ARDOUR::Session*);
|
||||||
@ -55,6 +55,8 @@ public:
|
|||||||
|
|
||||||
PluginSelector* plugin_selector() { return _plugin_selector; }
|
PluginSelector* plugin_selector() { return _plugin_selector; }
|
||||||
|
|
||||||
|
Gtkmm2ext::ActionMap& my_actions() const { return myactions; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Gtk::HBox hpacker;
|
Gtk::HBox hpacker;
|
||||||
Gtk::VBox vpacker;
|
Gtk::VBox vpacker;
|
||||||
|
@ -392,7 +392,7 @@ private:
|
|||||||
PBD::ScopedConnectionList _iomap_connection;
|
PBD::ScopedConnectionList _iomap_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARDOUR::SessionHandlePtr
|
class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARDOUR::SessionHandlePtr, Gtkmm2ext::StaticActionMapOwner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ProcessorOperation {
|
enum ProcessorOperation {
|
||||||
@ -444,6 +444,8 @@ public:
|
|||||||
sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorSelected;
|
sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorSelected;
|
||||||
sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorUnselected;
|
sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorUnselected;
|
||||||
|
|
||||||
|
Gtkmm2ext::ActionMap& my_actions() const { return myactions; }
|
||||||
|
|
||||||
static Glib::RefPtr<Gtk::ActionGroup> processor_box_actions;
|
static Glib::RefPtr<Gtk::ActionGroup> processor_box_actions;
|
||||||
static Gtkmm2ext::Bindings* bindings;
|
static Gtkmm2ext::Bindings* bindings;
|
||||||
static void register_actions();
|
static void register_actions();
|
||||||
|
@ -32,6 +32,7 @@ sigc::signal<void> PublicEditor::DropDownKeys;
|
|||||||
|
|
||||||
PublicEditor::PublicEditor (Gtk::Widget& content)
|
PublicEditor::PublicEditor (Gtk::Widget& content)
|
||||||
: Tabbable (content, _("Editor"))
|
: Tabbable (content, _("Editor"))
|
||||||
|
, ActionMapOwner (X_("editor"))
|
||||||
, _suspend_route_redisplay_counter (0)
|
, _suspend_route_redisplay_counter (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ using ARDOUR::samplecnt_t;
|
|||||||
* of PublicEditor need not be recompiled if private methods or member variables
|
* of PublicEditor need not be recompiled if private methods or member variables
|
||||||
* change.
|
* change.
|
||||||
*/
|
*/
|
||||||
class PublicEditor : public ArdourWidgets::Tabbable, public ARDOUR::SessionHandlePtr, public AxisViewProvider
|
class PublicEditor : public ArdourWidgets::Tabbable, public ARDOUR::SessionHandlePtr, public AxisViewProvider, public Gtkmm2ext::ActionMapOwner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PublicEditor (Gtk::Widget& content);
|
PublicEditor (Gtk::Widget& content);
|
||||||
|
@ -59,6 +59,7 @@ _rest_event_handler (GtkWidget* /*widget*/, gpointer arg)
|
|||||||
|
|
||||||
StepEntry::StepEntry (StepEditor& seditor)
|
StepEntry::StepEntry (StepEditor& seditor)
|
||||||
: ArdourWindow (string_compose (_("Step Entry: %1"), seditor.name()))
|
: ArdourWindow (string_compose (_("Step Entry: %1"), seditor.name()))
|
||||||
|
, ActionMapOwner (X_("step entry"))
|
||||||
, _current_note_length (1.0)
|
, _current_note_length (1.0)
|
||||||
, _current_note_velocity (64)
|
, _current_note_velocity (64)
|
||||||
, triplet_button ("3")
|
, triplet_button ("3")
|
||||||
@ -87,7 +88,6 @@ StepEntry::StepEntry (StepEditor& seditor)
|
|||||||
, _piano (0)
|
, _piano (0)
|
||||||
, piano (0)
|
, piano (0)
|
||||||
, se (&seditor)
|
, se (&seditor)
|
||||||
, myactions (X_("step entry"))
|
|
||||||
{
|
{
|
||||||
register_actions ();
|
register_actions ();
|
||||||
load_bindings ();
|
load_bindings ();
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
class StepEditor;
|
class StepEditor;
|
||||||
|
|
||||||
class StepEntry : public ArdourWindow
|
class StepEntry : public ArdourWindow, public Gtkmm2ext::ActionMapOwner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StepEntry (StepEditor&);
|
StepEntry (StepEditor&);
|
||||||
@ -165,7 +165,6 @@ private:
|
|||||||
bool radio_button_release (GdkEventButton*, Gtk::RadioButton*, int);
|
bool radio_button_release (GdkEventButton*, Gtk::RadioButton*, int);
|
||||||
|
|
||||||
void load_bindings ();
|
void load_bindings ();
|
||||||
Gtkmm2ext::ActionMap myactions;
|
|
||||||
Gtkmm2ext::Bindings* bindings;
|
Gtkmm2ext::Bindings* bindings;
|
||||||
|
|
||||||
void inc_note_velocity ();
|
void inc_note_velocity ();
|
||||||
|
Loading…
Reference in New Issue
Block a user