From 896a0a991cc44418f58903fe5dd1c58001c87314 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 5 May 2010 14:09:58 +0000 Subject: rename latched solo option and reverse its meaning; add exclusive solo button functionality in monitor section; add solo/mute override control in monitor section git-svn-id: svn://localhost/ardour2/branches/3.0@7059 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour3_ui_dark.rc.in | 9 +++++ gtk2_ardour/monitor_section.cc | 78 +++++++++++++++++++++++++++++++++++++-- gtk2_ardour/monitor_section.h | 5 ++- gtk2_ardour/rc_option_editor.cc | 8 ++-- 4 files changed, 91 insertions(+), 9 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index da13db4e90..dc50a77a18 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -408,6 +408,13 @@ style "mixer_solo_button_active" = "solo_button_active" ythickness = 0 } +style "monitor_opt_button" = "small_button" +{ + font_name = "@FONT_SMALLER@" + bg[ACTIVE] = { 1.0, 0.749, 0.247 } + fg[ACTIVE] = { 0, 0, 0 } +} + style "monitor_mono_button" = "small_button" { bg[ACTIVE] = { 0.725, 0.925, 0.949 } @@ -1663,6 +1670,8 @@ widget "*MonitorMonoButton" style:highest "monitor_mono_button" widget "*MonitorMonoButton*" style:highest "monitor_mono_button" widget "*MonitorInvertButton" style:highest "monitor_invert_button" widget "*MonitorInvertButton*" style:highest "monitor_invert_button" +widget "*MonitorOptButton" style:highest "monitor_opt_button" +widget "*MonitorOptButton*" style:highest "monitor_opt_button" widget "*BypassButton" style:highest "red_when_active" widget "*BypassButton*" style:highest "red_when_active" widget "*TransportSoloAlert" style:highest "flashing_alert" diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index 95b9e5c6a5..f3a668804b 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -52,7 +52,8 @@ MonitorSection::MonitorSection (Session* s) , mono_button (_("mono")) , rude_solo_button (_("soloing")) , rude_audition_button (_("auditioning")) - , exclusive_solo_button (_("Exclusive solo")) + , exclusive_solo_button (_("Exclusive")) + , solo_mute_override_button (_("Solo/Mute")) { Glib::RefPtr act; @@ -127,7 +128,6 @@ MonitorSection::MonitorSection (Session* s) act->connect_proxy (pfl_button); } - /* Solo Boost */ solo_boost_control = new VolumeController (little_knob_pixbuf, &solo_boost_adjustment, false, 30, 30); @@ -158,13 +158,34 @@ MonitorSection::MonitorSection (Session* s) solo_packer->pack_start (*spin_packer, true, true); - exclusive_solo_button.set_name (X_("MonitorCutButton")); + exclusive_solo_button.set_name (X_("MonitorOptButton")); + ARDOUR_UI::instance()->set_tip (&exclusive_solo_button, _("Exclusive solo means that only 1 solo is active at a time")); + + act = ActionManager::get_action (X_("Monitor"), X_("toggle-exclusive-solo")); + if (act) { + act->connect_proxy (exclusive_solo_button); + } + solo_mute_override_button.set_name (X_("MonitorOptButton")); + ARDOUR_UI::instance()->set_tip (&solo_mute_override_button, _("If enabled, solo will override mute\n(a soloed & muted track or bus will be audible)")); + + act = ActionManager::get_action (X_("Monitor"), X_("toggle-mute-overrides-solo")); + if (act) { + act->connect_proxy (solo_mute_override_button); + } + + HBox* solo_opt_box = manage (new HBox); + solo_opt_box->set_spacing (12); + solo_opt_box->set_homogeneous (true); + solo_opt_box->pack_start (exclusive_solo_button); + solo_opt_box->pack_start (solo_mute_override_button); + solo_opt_box->show (); + upper_packer.set_spacing (12); upper_packer.pack_start (rude_solo_button, false, false); upper_packer.pack_start (rude_audition_button, false, false); upper_packer.pack_start (solo_model_box, false, false); - upper_packer.pack_start (exclusive_solo_button, false, false); + upper_packer.pack_start (*solo_opt_box, false, false); upper_packer.pack_start (*solo_packer, false, false); act = ActionManager::get_action (X_("Monitor"), X_("monitor-cut-all")); @@ -411,6 +432,38 @@ MonitorSection::set_button_names () solo_button_label.set_text ("rec"); } +void +MonitorSection::toggle_exclusive_solo () +{ + if (!_monitor) { + return; + } + + Glib::RefPtr act = ActionManager::get_action (X_("Monitor"), "toggle-exclusive-solo"); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + Config->set_exclusive_solo (tact->get_active()); + } + +} + + +void +MonitorSection::toggle_mute_overrides_solo () +{ + if (!_monitor) { + return; + } + + Glib::RefPtr act = ActionManager::get_action (X_("Monitor"), "toggle-mute-overrides-solo"); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + cerr << "Set solo_mute_override to " << tact->get_active() << endl; + Config->set_solo_mute_override (tact->get_active()); + } +} + + void MonitorSection::dim_all () { @@ -537,6 +590,7 @@ MonitorSection::register_actions () { string action_name; string action_descr; + Glib::RefPtr act; monitor_actions = ActionGroup::create (X_("Monitor")); ActionManager::add_action_group (monitor_actions); @@ -550,6 +604,22 @@ MonitorSection::register_actions () ActionManager::register_toggle_action (monitor_actions, "monitor-dim-all", "", sigc::mem_fun (*this, &MonitorSection::dim_all)); + act = ActionManager::register_toggle_action (monitor_actions, "toggle-exclusive-solo", "", + sigc::mem_fun (*this, &MonitorSection::toggle_exclusive_solo)); + + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + tact->set_active (Config->get_exclusive_solo()); + + act = ActionManager::register_toggle_action (monitor_actions, "toggle-mute-overrides-solo", "", + sigc::mem_fun (*this, &MonitorSection::toggle_mute_overrides_solo)); + + tact = Glib::RefPtr::cast_dynamic(act); + tact->set_active (Config->get_solo_mute_override()); + + /* map from RC config */ + + + /* note the 1-based counting (for naming - backend uses 0-based) */ for (uint32_t chn = 1; chn <= 16; ++chn) { diff --git a/gtk2_ardour/monitor_section.h b/gtk2_ardour/monitor_section.h index a77efdb82c..d543ea1acd 100644 --- a/gtk2_ardour/monitor_section.h +++ b/gtk2_ardour/monitor_section.h @@ -92,6 +92,8 @@ class MonitorSection : public RouteUI void dim_all (); void cut_all (); void mono (); + void toggle_exclusive_solo (); + void toggle_mute_overrides_solo (); void dim_level_changed (); void solo_boost_changed (); void gain_value_changed (); @@ -115,6 +117,7 @@ class MonitorSection : public RouteUI BindableToggleButton rude_solo_button; BindableToggleButton rude_audition_button; BindableToggleButton exclusive_solo_button; + BindableToggleButton solo_mute_override_button; void do_blink (bool); void solo_blink (bool); @@ -124,7 +127,7 @@ class MonitorSection : public RouteUI void solo_cut_changed (); void update_solo_model (); void parameter_changed (std::string); - + PBD::ScopedConnection config_connection; PBD::ScopedConnectionList control_connections; diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index bf1ba93216..1bc4f0a252 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1195,10 +1195,10 @@ RCOptionEditor::RCOptionEditor () add_option (_("Audio"), new BoolOption ( - "solo-latched", - _("Latched solo"), - sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_latched), - sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_latched) + "exclusive-solo", + _("Exclusive solo"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_exclusive_solo), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_exclusive_solo) )); add_option (_("Audio"), -- cgit v1.2.3