Consolidate ToggleAction cast, use new API
Furthermore we can assume that all Actions are registered and Unregistered actions will ::abort() execution.
This commit is contained in:
parent
00934aec0d
commit
8244026533
|
@ -5996,9 +5996,8 @@ ARDOUR_UI::monitor_dim_all ()
|
|||
}
|
||||
boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor = mon->monitor_control ();
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "monitor-dim-all");
|
||||
assert (act); Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
assert (tact); _monitor->set_dim_all (tact->get_active());
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), "monitor-dim-all");
|
||||
_monitor->set_dim_all (tact->get_active());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -6010,9 +6009,8 @@ ARDOUR_UI::monitor_cut_all ()
|
|||
}
|
||||
boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor = mon->monitor_control ();
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all");
|
||||
assert (act); Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
assert (tact); _monitor->set_cut_all (tact->get_active());
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), "monitor-cut-all");
|
||||
_monitor->set_cut_all (tact->get_active());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -6024,7 +6022,6 @@ ARDOUR_UI::monitor_mono ()
|
|||
}
|
||||
boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor = mon->monitor_control ();
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "monitor-mono");
|
||||
assert (act); Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
assert (tact);_monitor->set_mono (tact->get_active());
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), "monitor-mono");
|
||||
_monitor->set_mono (tact->get_active());
|
||||
}
|
||||
|
|
|
@ -594,9 +594,8 @@ ARDOUR_UI::error_alert_press (GdkEventButton* ev)
|
|||
if (ev->button == 1) {
|
||||
if (_log_not_acknowledged == LogLevelError) {
|
||||
// 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"));
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (tact && tact->get_active()) {
|
||||
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("toggle-log-window"));
|
||||
if (tact->get_active()) {
|
||||
do_toggle = false;
|
||||
}
|
||||
}
|
||||
|
@ -781,12 +780,7 @@ ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
|
|||
void
|
||||
ARDOUR_UI::toggle_follow_edits ()
|
||||
{
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
|
||||
assert (act);
|
||||
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
assert (tact);
|
||||
|
||||
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("ToggleFollowEdits"));
|
||||
UIConfiguration::instance().set_follow_edits (tact->get_active ());
|
||||
}
|
||||
|
||||
|
|
|
@ -941,14 +941,10 @@ ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
|
|||
void
|
||||
ARDOUR_UI::toggle_mixer_space()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer");
|
||||
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
if (tact->get_active()) {
|
||||
mixer->maximise_mixer_space ();
|
||||
} else {
|
||||
mixer->restore_mixer_space ();
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Common", "ToggleMaximalMixer");
|
||||
if (tact->get_active()) {
|
||||
mixer->maximise_mixer_space ();
|
||||
} else {
|
||||
mixer->restore_mixer_space ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,14 +129,7 @@ ARDOUR_UI::toggle_click ()
|
|||
void
|
||||
ARDOUR_UI::toggle_session_monitoring_in ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("SessionMonitorIn"));
|
||||
if (!act) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (!tact) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorIn"));
|
||||
|
||||
if (tact->get_active() && _session->config.get_session_monitoring () == MonitorInput) {
|
||||
return;
|
||||
|
@ -155,14 +148,7 @@ ARDOUR_UI::toggle_session_monitoring_in ()
|
|||
void
|
||||
ARDOUR_UI::toggle_session_monitoring_disk ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("SessionMonitorDisk"));
|
||||
if (!act) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (!tact) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorDisk"));
|
||||
if (tact->get_active() && _session->config.get_session_monitoring () == MonitorDisk) {
|
||||
return;
|
||||
}
|
||||
|
@ -180,15 +166,11 @@ ARDOUR_UI::toggle_session_monitoring_disk ()
|
|||
void
|
||||
ARDOUR_UI::unset_dual_punch ()
|
||||
{
|
||||
Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
|
||||
|
||||
if (action) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
|
||||
if (tact) {
|
||||
ignore_dual_punch = true;
|
||||
tact->set_active (false);
|
||||
ignore_dual_punch = false;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "TogglePunch");
|
||||
if (tact) {
|
||||
ignore_dual_punch = true;
|
||||
tact->set_active (false);
|
||||
ignore_dual_punch = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,42 +181,20 @@ ARDOUR_UI::toggle_punch ()
|
|||
return;
|
||||
}
|
||||
|
||||
Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "TogglePunch");
|
||||
|
||||
if (action) {
|
||||
/* drive the other two actions from this one */
|
||||
Glib::RefPtr<ToggleAction> in_action = ActionManager::get_toggle_action ("Transport", "TogglePunchIn");
|
||||
Glib::RefPtr<ToggleAction> out_action = ActionManager::get_toggle_action ("Transport", "TogglePunchOut");
|
||||
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
|
||||
|
||||
if (!tact) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* drive the other two actions from this one */
|
||||
|
||||
Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
|
||||
Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
|
||||
|
||||
if (in_action && out_action) {
|
||||
Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
|
||||
Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
|
||||
tiact->set_active (tact->get_active());
|
||||
toact->set_active (tact->get_active());
|
||||
}
|
||||
}
|
||||
in_action->set_active (tact->get_active());
|
||||
out_action->set_active (tact->get_active());
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_punch_in ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchIn"));
|
||||
if (!act) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (!tact) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("TogglePunchIn"));
|
||||
|
||||
if (tact->get_active() != _session->config.get_punch_in()) {
|
||||
_session->config.set_punch_in (tact->get_active ());
|
||||
|
@ -252,15 +212,7 @@ ARDOUR_UI::toggle_punch_in ()
|
|||
void
|
||||
ARDOUR_UI::toggle_punch_out ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchOut"));
|
||||
if (!act) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (!tact) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("TogglePunchOut"));
|
||||
|
||||
if (tact->get_active() != _session->config.get_punch_out()) {
|
||||
_session->config.set_punch_out (tact->get_active ());
|
||||
|
@ -278,17 +230,9 @@ ARDOUR_UI::toggle_punch_out ()
|
|||
void
|
||||
ARDOUR_UI::show_loop_punch_ruler_and_disallow_hide ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
||||
if (!act) {
|
||||
return;
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
||||
|
||||
act->set_sensitive (false);
|
||||
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (!tact) {
|
||||
return;
|
||||
}
|
||||
tact->set_sensitive (false);
|
||||
|
||||
if (!tact->get_active()) {
|
||||
tact->set_active ();
|
||||
|
@ -311,25 +255,18 @@ ARDOUR_UI::reenable_hide_loop_punch_ruler_if_appropriate ()
|
|||
void
|
||||
ARDOUR_UI::toggle_video_sync()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "ToggleVideoSync");
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
_session->config.set_use_video_sync (tact->get_active());
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "ToggleVideoSync");
|
||||
_session->config.set_use_video_sync (tact->get_active());
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_editing_space()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
|
||||
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
if (tact->get_active()) {
|
||||
maximise_editing_space ();
|
||||
} else {
|
||||
restore_editing_space ();
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Common", "ToggleMaximalEditor");
|
||||
if (tact->get_active()) {
|
||||
maximise_editing_space ();
|
||||
} else {
|
||||
restore_editing_space ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -398,27 +335,21 @@ ARDOUR_UI::parameter_changed (std::string p)
|
|||
} else if (p == "auto-input") {
|
||||
ActionManager::map_some_state ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_input));
|
||||
} else if (p == "session-monitoring") {
|
||||
Glib::RefPtr<Action> iact = ActionManager::get_action (X_("Transport"), X_("SessionMonitorIn"));
|
||||
Glib::RefPtr<Action> dact = ActionManager::get_action (X_("Transport"), X_("SessionMonitorDisk"));
|
||||
if (iact && dact) {
|
||||
Glib::RefPtr<ToggleAction> tdact = Glib::RefPtr<ToggleAction>::cast_dynamic(dact);
|
||||
Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(iact);
|
||||
if (tdact && tiact) {
|
||||
switch (_session->config.get_session_monitoring ()) {
|
||||
case MonitorDisk:
|
||||
tdact->set_active (true);
|
||||
tiact->set_active (false);
|
||||
break;
|
||||
case MonitorInput:
|
||||
tiact->set_active (true);
|
||||
tdact->set_active (false);
|
||||
break;
|
||||
default:
|
||||
tdact->set_active (false);
|
||||
tiact->set_active (false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tiact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorIn"));
|
||||
Glib::RefPtr<ToggleAction> tdact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorDisk"));
|
||||
switch (_session->config.get_session_monitoring ()) {
|
||||
case MonitorDisk:
|
||||
tdact->set_active (true);
|
||||
tiact->set_active (false);
|
||||
break;
|
||||
case MonitorInput:
|
||||
tiact->set_active (true);
|
||||
tdact->set_active (false);
|
||||
break;
|
||||
default:
|
||||
tdact->set_active (false);
|
||||
tiact->set_active (false);
|
||||
break;
|
||||
}
|
||||
} else if (p == "punch-out") {
|
||||
ActionManager::map_some_state ("Transport", "TogglePunchOut", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_out));
|
||||
|
|
|
@ -801,14 +801,10 @@ Editor::load_bindings ()
|
|||
void
|
||||
Editor::toggle_skip_playback ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), "toggle-skip-playback");
|
||||
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
bool s = Config->get_skip_playback ();
|
||||
if (tact->get_active() != s) {
|
||||
Config->set_skip_playback (tact->get_active());
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), "toggle-skip-playback");
|
||||
bool s = Config->get_skip_playback ();
|
||||
if (tact->get_active() != s) {
|
||||
Config->set_skip_playback (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -857,42 +853,29 @@ Editor::toggle_ruler_visibility (RulerType rt)
|
|||
break;
|
||||
}
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), action);
|
||||
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
update_ruler_visibility ();
|
||||
store_ruler_visibility ();
|
||||
}
|
||||
update_ruler_visibility ();
|
||||
store_ruler_visibility ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_summary ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
_session->config.set_show_summary (tact->get_active ());
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("ToggleSummary"));
|
||||
_session->config.set_show_summary (tact->get_active ());
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_group_tabs ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
_session->config.set_show_group_tabs (tact->get_active ());
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("ToggleGroupTabs"));
|
||||
_session->config.set_show_group_tabs (tact->get_active ());
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_close_video_sensitive (bool onoff)
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("CloseVideo"));
|
||||
if (act) {
|
||||
act->set_sensitive (onoff);
|
||||
}
|
||||
act->set_sensitive (onoff);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1364,29 +1347,16 @@ Editor::zoom_focus_action (ZoomFocus focus)
|
|||
abort(); /*NOTREACHED*/
|
||||
}
|
||||
|
||||
act = ActionManager::get_action (X_("Zoom"), action);
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
} else {
|
||||
error << string_compose (_("programming error: %1: %2"), "Editor::zoom_focus_action could not find action to match focus.", action) << endmsg;
|
||||
}
|
||||
|
||||
return RefPtr<RadioAction> ();
|
||||
return ActionManager::get_radio_action (X_("Zoom"), action);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_sound_midi_notes ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
|
||||
|
||||
if (act) {
|
||||
bool s = UIConfiguration::instance().get_sound_midi_notes();
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (tact->get_active () != s) {
|
||||
UIConfiguration::instance().set_sound_midi_notes (tact->get_active());
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("sound-midi-notes"));
|
||||
bool s = UIConfiguration::instance().get_sound_midi_notes();
|
||||
if (tact->get_active () != s) {
|
||||
UIConfiguration::instance().set_sound_midi_notes (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1436,12 +1406,9 @@ Editor::parameter_changed (std::string p)
|
|||
_summary_hbox.hide ();
|
||||
}
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("ToggleSummary"));
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
} else if (p == "show-group-tabs") {
|
||||
|
||||
|
@ -1454,36 +1421,25 @@ Editor::parameter_changed (std::string p)
|
|||
|
||||
reset_controls_layout_width ();
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("ToggleGroupTabs"));
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
} else if (p == "timecode-offset" || p == "timecode-offset-negative") {
|
||||
update_just_timecode ();
|
||||
} else if (p == "sound-midi-notes") {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
|
||||
|
||||
if (act) {
|
||||
bool s = UIConfiguration::instance().get_sound_midi_notes();
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("sound-midi-notes"));
|
||||
bool s = UIConfiguration::instance().get_sound_midi_notes();
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
} else if (p == "show-region-gain") {
|
||||
set_gain_envelope_visibility ();
|
||||
} else if (p == "skip-playback") {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-skip-playback"));
|
||||
|
||||
if (act) {
|
||||
bool s = Config->get_skip_playback ();
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("toggle-skip-playback"));
|
||||
bool s = Config->get_skip_playback ();
|
||||
if (tact->get_active () != s) {
|
||||
tact->set_active (s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,14 +208,7 @@ Editor::set_current_movable (boost::shared_ptr<Movable> m)
|
|||
void
|
||||
Editor::mouse_mode_object_range_toggled()
|
||||
{
|
||||
MouseMode m = mouse_mode;
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range"));
|
||||
assert (act);
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
assert (tact);
|
||||
|
||||
set_mouse_mode (m, true); // call this so the button styles can get updated
|
||||
set_mouse_mode (mouse_mode, true); /* updates set-mouse-mode-range */
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -1682,7 +1682,6 @@ RefPtr<Action>
|
|||
EditorRegions::hide_action () const
|
||||
{
|
||||
return ActionManager::get_action (X_("RegionList"), X_("rlHide"));
|
||||
|
||||
}
|
||||
|
||||
RefPtr<Action>
|
||||
|
@ -1700,15 +1699,11 @@ EditorRegions::remove_unused_regions_action () const
|
|||
RefPtr<ToggleAction>
|
||||
EditorRegions::toggle_full_action () const
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("RegionList"), X_("rlShowAll"));
|
||||
assert (act);
|
||||
return Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
return ActionManager::get_toggle_action (X_("RegionList"), X_("rlShowAll"));
|
||||
}
|
||||
|
||||
RefPtr<ToggleAction>
|
||||
EditorRegions::toggle_show_auto_regions_action () const
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("RegionList"), X_("rlShowAuto"));
|
||||
assert (act);
|
||||
return Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
return ActionManager::get_toggle_action (X_("RegionList"), X_("rlShowAuto"));
|
||||
}
|
||||
|
|
|
@ -550,8 +550,7 @@ StepEntry::note_length ()
|
|||
{
|
||||
double base_time = 4.0 / (double) length_divisor_adjustment.get_value();
|
||||
|
||||
RefPtr<Action> act = ActionManager::get_action ("StepEditing/toggle-triplet");
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("StepEditing/toggle-triplet");
|
||||
bool triplets = tact->get_active ();
|
||||
|
||||
if (triplets) {
|
||||
|
|
|
@ -265,10 +265,8 @@ TimeInfoBox::selection_changed ()
|
|||
case Editing::MouseObject:
|
||||
if (selection.regions.empty()) {
|
||||
if (selection.points.empty()) {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("MouseMode", "set-mouse-mode-object-range");
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
|
||||
if (tact && tact->get_active() && !selection.time.empty()) {
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("MouseMode", "set-mouse-mode-object-range");
|
||||
if (tact->get_active() && !selection.time.empty()) {
|
||||
/* show selected range */
|
||||
selection_start->set_off (false);
|
||||
selection_end->set_off (false);
|
||||
|
@ -315,10 +313,9 @@ TimeInfoBox::selection_changed ()
|
|||
|
||||
case Editing::MouseRange:
|
||||
if (selection.time.empty()) {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("MouseMode", "set-mouse-mode-object-range");
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("MouseMode", "set-mouse-mode-object-range");
|
||||
|
||||
if (tact && tact->get_active() && !selection.regions.empty()) {
|
||||
if (tact->get_active() && !selection.regions.empty()) {
|
||||
/* show selected regions */
|
||||
s = selection.regions.start();
|
||||
e = selection.regions.end_sample();
|
||||
|
|
Loading…
Reference in New Issue
Block a user