summaryrefslogtreecommitdiff
path: root/gtk2_ardour/monitor_section.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-03-25 16:03:31 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-03-25 16:03:31 +0000
commitac5bbf4b99635a71093f859e233ad5fe4b07453b (patch)
tree01b3760b07835a56144d78b52d6fdc65d0910213 /gtk2_ardour/monitor_section.cc
parentf1b0f30cd5d72e16084e4f4305e4bb5877311b2c (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/monitor_section.cc')
-rw-r--r--gtk2_ardour/monitor_section.cc51
1 files changed, 37 insertions, 14 deletions
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()));
+ }
+}