diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-25 16:03:31 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-25 16:03:31 +0000 |
commit | ac5bbf4b99635a71093f859e233ad5fe4b07453b (patch) | |
tree | 01b3760b07835a56144d78b52d6fdc65d0910213 /gtk2_ardour | |
parent | f1b0f30cd5d72e16084e4f4305e4bb5877311b2c (diff) |
use correct (RCConfig-based) name for MIDI port in generic MIDI control stuff; make monitor section track configuration params that apply to it; add use-monitor-bus option to rc option editor
git-svn-id: svn://localhost/ardour2/branches/3.0@6797 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/monitor_section.cc | 51 | ||||
-rw-r--r-- | gtk2_ardour/monitor_section.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 8 |
4 files changed, 49 insertions, 29 deletions
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 6162ef22d9..98b33081b0 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -159,21 +159,6 @@ ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuff #endif } -#if 0 -static bool -null_crossing (GdkEventCrossing* /* ignored */) -{ - return true; -} - -static void -block_prelight (Gtk::Widget& w) -{ - w.signal_enter_notify_event().connect (sigc::ptr_fun (null_crossing), false); - w.signal_leave_notify_event().connect (sigc::ptr_fun (null_crossing), false); -} -#endif - XMLNode* ARDOUR_UI::tearoff_settings (const char* name) const { diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index 9490d5a72a..e85bbf13ff 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -13,6 +13,7 @@ #include "ardour/utils.h" #include "ardour_ui.h" +#include "gui_thread.h" #include "monitor_section.h" #include "public_editor.h" #include "utils.h" @@ -252,6 +253,10 @@ MonitorSection::MonitorSection (Session* s) _tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL); _tearoff->tearoff_window().set_title (X_("Monitor")); _tearoff->tearoff_window().signal_key_press_event().connect (sigc::ptr_fun (forward_key_press), false); + + /* catch changes that affect us */ + + Config->ParameterChanged.connect (config_connection, ui_bind (&MonitorSection::parameter_changed, this, _1), gui_context()); } MonitorSection::~MonitorSection () @@ -723,17 +728,10 @@ MonitorSection::linear_gain_printer (SpinButton* button) } void -MonitorSection::map_state () +MonitorSection::update_solo_model () { - if (!_route || !_monitor) { - return; - } - - gain_control->get_adjustment()->set_value (gain_to_slider_position (_route->gain_control()->get_value())); - dim_control->get_adjustment()->set_value (_monitor->dim_level()); - solo_boost_control->get_adjustment()->set_value (_monitor->solo_boost_level()); - - const char *action_name; + const char* action_name; + Glib::RefPtr<Action> act; if (Config->get_solo_control_is_listen_control()) { switch (Config->get_listen_position()) { @@ -741,15 +739,13 @@ MonitorSection::map_state () action_name = X_("solo-use-afl"); break; case PreFaderListen: - action_name = X_("solo-use-afl"); + action_name = X_("solo-use-pfl"); break; } } else { action_name = X_("solo-use-in-place"); } - - Glib::RefPtr<Action> act; - + act = ActionManager::get_action (X_("Solo"), action_name); if (act) { Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (act); @@ -757,7 +753,23 @@ MonitorSection::map_state () ract->set_active (true); } } +} +void +MonitorSection::map_state () +{ + if (!_route || !_monitor) { + return; + } + + gain_control->get_adjustment()->set_value (gain_to_slider_position (_route->gain_control()->get_value())); + dim_control->get_adjustment()->set_value (_monitor->dim_level()); + solo_boost_control->get_adjustment()->set_value (_monitor->solo_boost_level()); + + Glib::RefPtr<Action> act; + + update_solo_model (); + act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all"); if (act) { Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); @@ -871,3 +883,14 @@ MonitorSection::solo_cut_changed () { Config->set_solo_mute_gain (slider_position_to_gain (solo_cut_adjustment.get_value())); } + +void +MonitorSection::parameter_changed (std::string name) +{ + if (name == "solo-control-is-listen-control" || + name == "listen-position") { + update_solo_model (); + } else if (name == "solo-mute-gain") { + solo_cut_adjustment.set_value (gain_to_slider_position (Config->get_solo_mute_gain())); + } +} diff --git a/gtk2_ardour/monitor_section.h b/gtk2_ardour/monitor_section.h index ca6b546f3f..65d460d84d 100644 --- a/gtk2_ardour/monitor_section.h +++ b/gtk2_ardour/monitor_section.h @@ -117,4 +117,8 @@ class MonitorSection : public RouteUI void solo_blink (bool); bool cancel_solo (GdkEventButton*); void solo_cut_changed (); + void update_solo_model (); + void parameter_changed (std::string); + + PBD::ScopedConnection config_connection; }; diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 1440081d57..88a650ad87 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1205,6 +1205,14 @@ RCOptionEditor::RCOptionEditor () add_option (_("Audio"), new OptionEditorHeading (_("Monitoring"))); + add_option (_("Audio"), + new BoolOption ( + "use-monitor-bus", + _("Use a monitor bus (allows AFL/PFL and more control)"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_monitor_bus), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_monitor_bus) + )); + ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> ( "monitoring-model", _("Monitoring handled by"), |