Add initial GUI support for global monitor states

This commit is contained in:
Robin Gareus 2017-01-16 19:54:20 +01:00
parent 88d797bd64
commit cf5a0de709
6 changed files with 131 additions and 8 deletions

View File

@ -264,6 +264,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, video_timeline(0) , video_timeline(0)
, global_actions (X_("global")) , global_actions (X_("global"))
, ignore_dual_punch (false) , ignore_dual_punch (false)
, ignore_session_monitoring (false)
, main_window_visibility (0) , main_window_visibility (0)
, editor (0) , editor (0)
, mixer (0) , mixer (0)
@ -281,9 +282,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, play_selection_controllable (new TransportControllable ("transport play selection", *this, TransportControllable::PlaySelection)) , play_selection_controllable (new TransportControllable ("transport play selection", *this, TransportControllable::PlaySelection))
, rec_controllable (new TransportControllable ("transport rec-enable", *this, TransportControllable::RecordEnable)) , rec_controllable (new TransportControllable ("transport rec-enable", *this, TransportControllable::RecordEnable))
, time_info_box (0) , time_info_box (0)
, auto_input_button (ArdourButton::led_default_elements)
, auto_return_button (ArdourButton::led_default_elements) , auto_return_button (ArdourButton::led_default_elements)
, follow_edits_button (ArdourButton::led_default_elements) , follow_edits_button (ArdourButton::led_default_elements)
, auto_input_button (ArdourButton::led_default_elements)
, auditioning_alert_button (_("Audition")) , auditioning_alert_button (_("Audition"))
, solo_alert_button (_("Solo")) , solo_alert_button (_("Solo"))
, feedback_alert_button (_("Feedback")) , feedback_alert_button (_("Feedback"))

View File

@ -391,6 +391,9 @@ protected:
bool ignore_dual_punch; bool ignore_dual_punch;
void toggle_punch_in (); void toggle_punch_in ();
void toggle_punch_out (); void toggle_punch_out ();
bool ignore_session_monitoring;
void toggle_session_monitoring_in ();
void toggle_session_monitoring_disk ();
void show_loop_punch_ruler_and_disallow_hide (); void show_loop_punch_ruler_and_disallow_hide ();
void reenable_hide_loop_punch_ruler_if_appropriate (); void reenable_hide_loop_punch_ruler_if_appropriate ();
void toggle_auto_return (); void toggle_auto_return ();
@ -526,6 +529,10 @@ private:
ArdourButton punch_out_button; ArdourButton punch_out_button;
ArdourButton layered_button; ArdourButton layered_button;
ArdourButton monitor_in_button;
ArdourButton monitor_disk_button;
ArdourButton auto_input_button;
Gtk::Label punch_label; Gtk::Label punch_label;
Gtk::Label layered_label; Gtk::Label layered_label;
@ -539,7 +546,6 @@ private:
ArdourButton auto_return_button; ArdourButton auto_return_button;
ArdourButton follow_edits_button; ArdourButton follow_edits_button;
ArdourButton auto_input_button;
ArdourButton click_button; ArdourButton click_button;
ArdourButton sync_button; ArdourButton sync_button;

View File

@ -84,7 +84,7 @@ ARDOUR_UI::setup_tooltips ()
set_tip (midi_panic_button, _("MIDI Panic\nSend note off and reset controller messages on all MIDI channels")); set_tip (midi_panic_button, _("MIDI Panic\nSend note off and reset controller messages on all MIDI channels"));
set_tip (auto_return_button, _("Return to last playback start when stopped")); set_tip (auto_return_button, _("Return to last playback start when stopped"));
set_tip (follow_edits_button, _("Playhead follows Range tool clicks, and Range selections")); set_tip (follow_edits_button, _("Playhead follows Range tool clicks, and Range selections"));
set_tip (auto_input_button, _("Be sensible about input monitoring")); set_tip (auto_input_button, _("Track Input Monitoring automatically follows transport state"));
set_tip (click_button, _("Enable/Disable audio click")); set_tip (click_button, _("Enable/Disable audio click"));
set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything")); set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition")); set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
@ -349,6 +349,11 @@ ARDOUR_UI::setup_transport ()
act = ActionManager::get_action ("Transport", "TogglePunchOut"); act = ActionManager::get_action ("Transport", "TogglePunchOut");
punch_out_button.set_related_action (act); punch_out_button.set_related_action (act);
act = ActionManager::get_action ("Transport", "SessionMonitorIn");
monitor_in_button.set_related_action (act);
act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
monitor_disk_button.set_related_action (act);
/* connect signals */ /* connect signals */
ARDOUR_UI::Clock.connect (sigc::mem_fun (primary_clock, &AudioClock::set)); ARDOUR_UI::Clock.connect (sigc::mem_fun (primary_clock, &AudioClock::set));
ARDOUR_UI::Clock.connect (sigc::mem_fun (secondary_clock, &AudioClock::set)); ARDOUR_UI::Clock.connect (sigc::mem_fun (secondary_clock, &AudioClock::set));
@ -371,7 +376,6 @@ ARDOUR_UI::setup_transport ()
auto_return_button.set_name ("transport option button"); auto_return_button.set_name ("transport option button");
follow_edits_button.set_name ("transport option button"); follow_edits_button.set_name ("transport option button");
auto_input_button.set_name ("transport option button");
solo_alert_button.set_name ("rude solo"); solo_alert_button.set_name ("rude solo");
auditioning_alert_button.set_name ("rude audition"); auditioning_alert_button.set_name ("rude audition");
@ -394,17 +398,24 @@ ARDOUR_UI::setup_transport ()
punch_out_button.set_name ("punch button"); punch_out_button.set_name ("punch button");
layered_button.set_name (("layered button")); layered_button.set_name (("layered button"));
monitor_in_button.set_name ("punch button"); // XXX
monitor_disk_button.set_name ("punch button"); // XXX
auto_input_button.set_name ("transport option button");
click_button.set_name ("transport button"); click_button.set_name ("transport button");
sync_button.set_name ("transport active option button"); sync_button.set_name ("transport active option button");
/* and widget text */ /* and widget text */
auto_return_button.set_text(_("Auto Return")); auto_return_button.set_text(_("Auto Return"));
follow_edits_button.set_text(_("Follow Range")); follow_edits_button.set_text(_("Follow Range"));
//auto_input_button.set_text (_("Auto Input"));
punch_in_button.set_text (_("In")); punch_in_button.set_text (_("In"));
punch_out_button.set_text (_("Out")); punch_out_button.set_text (_("Out"));
layered_button.set_text (_("Non-Layered")); layered_button.set_text (_("Non-Layered"));
monitor_in_button.set_text (_("All In"));
monitor_disk_button.set_text (_("All Disk"));
auto_input_button.set_text (_("Auto-Input"));
punch_label.set_text (_("Punch:")); punch_label.set_text (_("Punch:"));
layered_label.set_text (_("Rec:")); layered_label.set_text (_("Rec:"));
@ -425,6 +436,9 @@ ARDOUR_UI::setup_transport ()
Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start")); Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end")); Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
Gtkmm2ext::UI::instance()->set_tip (monitor_in_button, _("Force all implicit monitoed tracks to monitor input"));
Gtkmm2ext::UI::instance()->set_tip (monitor_disk_button, _("Force all implicit monitored tracks to disk-monitoring"));
/* setup icons */ /* setup icons */
click_button.set_icon (ArdourIcon::TransportMetronom); click_button.set_icon (ArdourIcon::TransportMetronom);
@ -452,6 +466,10 @@ ARDOUR_UI::setup_transport ()
punch_button_size_group->add_widget (punch_in_button); punch_button_size_group->add_widget (punch_in_button);
punch_button_size_group->add_widget (punch_out_button); punch_button_size_group->add_widget (punch_out_button);
Glib::RefPtr<SizeGroup> monitor_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
monitor_button_size_group->add_widget (monitor_in_button);
monitor_button_size_group->add_widget (monitor_disk_button);
/* and now the layout... */ /* and now the layout... */
/* top level packing */ /* top level packing */
@ -558,6 +576,15 @@ ARDOUR_UI::setup_transport ()
transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col; ++col;
transport_table.attach (monitor_in_button, col, col + 1, 0, 1 , FILL, SHRINK, 0, 2);
transport_table.attach (*(manage (new Label (""))), col + 1, col + 2, 0, 1 , FILL, SHRINK, 2, 2);
transport_table.attach (monitor_disk_button, col + 2, col + 3, 0, 1 , FILL, SHRINK, 0, 2);
transport_table.attach (auto_input_button, col, col + 3, 1, 2 , FILL, SHRINK, 0, 2);
col += 3;
transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, 2, 0); transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, 2, 0);
transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, 2, 0); transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, 2, 0);
++col; ++col;

View File

@ -513,6 +513,13 @@ ARDOUR_UI::install_actions ()
act = global_actions.register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames, false)); act = global_actions.register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames, false));
ActionManager::session_sensitive_actions.push_back (act); ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_toggle_action (transport_actions, X_("SessionMonitorIn"), _("All Input"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_session_monitoring_in));
act->set_short_label (_("All In"));
ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_toggle_action (transport_actions, X_("SessionMonitorDisk"), _("All Disk"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_session_monitoring_disk));
act->set_short_label (_("All Disk"));
ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_toggle_action (transport_actions, X_("TogglePunchIn"), _("Punch In"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_punch_in)); act = global_actions.register_toggle_action (transport_actions, X_("TogglePunchIn"), _("Punch In"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_punch_in));
act->set_short_label (_("In")); act->set_short_label (_("In"));
ActionManager::session_sensitive_actions.push_back (act); ActionManager::session_sensitive_actions.push_back (act);

View File

@ -23,6 +23,7 @@
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "pbd/unwind.h"
#include <gtkmm2ext/utils.h> #include <gtkmm2ext/utils.h>
@ -128,6 +129,64 @@ ARDOUR_UI::toggle_click ()
ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking); ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking);
} }
void
ARDOUR_UI::toggle_session_monitoring_in ()
{
if (ignore_session_monitoring) {
return;
}
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;
}
if (tact->get_active()) {
Glib::RefPtr<Action> dact = ActionManager::get_action (X_("Transport"), X_("SessionMonitorDisk"));
if (dact) {
Glib::RefPtr<ToggleAction> tdact = Glib::RefPtr<ToggleAction>::cast_dynamic(dact);
if (tdact) {
PBD::Unwinder<bool> (ignore_session_monitoring, true);
tdact->set_active (false);
}
}
_session->config.set_session_monitoring (MonitorInput);
} else {
_session->config.set_session_monitoring (MonitorAuto);
}
}
void
ARDOUR_UI::toggle_session_monitoring_disk ()
{
if (ignore_session_monitoring) {
return;
}
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;
}
if (tact->get_active()) {
Glib::RefPtr<Action> iact = ActionManager::get_action (X_("Transport"), X_("SessionMonitorIn"));
if (iact) {
Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(iact);
if (tiact) {
PBD::Unwinder<bool> (ignore_session_monitoring, true);
tiact->set_active (false);
}
}
_session->config.set_session_monitoring (MonitorDisk);
} else {
_session->config.set_session_monitoring (MonitorAuto);
}
}
void void
ARDOUR_UI::unset_dual_punch () ARDOUR_UI::unset_dual_punch ()
{ {
@ -340,6 +399,27 @@ ARDOUR_UI::parameter_changed (std::string p)
ActionManager::map_some_state ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return)); ActionManager::map_some_state ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return));
} else if (p == "auto-input") { } else if (p == "auto-input") {
ActionManager::map_some_state ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::get_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);
break;
case MonitorInput:
tiact->set_active (true);
break;
default:
tdact->set_active (false);
tiact->set_active (false);
break;
}
}
}
} else if (p == "punch-out") { } else if (p == "punch-out") {
ActionManager::map_some_state ("Transport", "TogglePunchOut", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_out)); ActionManager::map_some_state ("Transport", "TogglePunchOut", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_out));
if (!_session->config.get_punch_out()) { if (!_session->config.get_punch_out()) {

View File

@ -1940,6 +1940,8 @@ RouteUI::parameter_changed (string const & p)
check_rec_enable_sensitivity (); check_rec_enable_sensitivity ();
} else if (p == "use-monitor-bus" || p == "solo-control-is-listen-control" || p == "listen-position") { } else if (p == "use-monitor-bus" || p == "solo-control-is-listen-control" || p == "listen-position") {
set_button_names (); set_button_names ();
} else if (p == "session-monitoring") {
update_monitoring_display ();
} else if (p == "auto-input") { } else if (p == "auto-input") {
update_monitoring_display (); update_monitoring_display ();
} else if (p == "blink-rec-arm") { } else if (p == "blink-rec-arm") {