summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-07-12 21:42:57 +0200
committerRobin Gareus <robin@gareus.org>2018-07-12 21:42:57 +0200
commitda6a6f1366b9e50af414ddde7ce8a95c8cbddc32 (patch)
treeff35706440062b934ea87e9560dbcb56dbbca984 /libs/surfaces
parent6bb8f1e7de744d1c7867aae66a0ac5c8719f85cd (diff)
CC121: watch Track monitoring state
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/cc121/cc121.cc20
-rw-r--r--libs/surfaces/cc121/cc121.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc
index afae36d524..76e175bb21 100644
--- a/libs/surfaces/cc121/cc121.cc
+++ b/libs/surfaces/cc121/cc121.cc
@@ -48,6 +48,7 @@
#include "ardour/filesystem_paths.h"
#include "ardour/midi_port.h"
#include "ardour/midiport_manager.h"
+#include "ardour/monitor_control.h"
#include "ardour/monitor_processor.h"
#include "ardour/profile.h"
#include "ardour/rc_configuration.h"
@@ -1075,6 +1076,7 @@ CC121::set_current_stripable (boost::shared_ptr<Stripable> r)
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (_current_stripable);
if (t) {
t->rec_enable_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&CC121::map_recenable, this), this);
+ t->monitoring_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&CC121::map_monitoring, this), this);
}
boost::shared_ptr<AutomationControl> control = _current_stripable->gain_control ();
@@ -1181,6 +1183,23 @@ CC121::map_recenable ()
} else {
get_button (Rec).set_led_state (_output_port, false);
}
+ map_monitoring ();
+}
+
+void
+CC121::map_monitoring ()
+{
+ boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (_current_stripable);
+ if (t) {
+ MonitorState state = t->monitoring_control()->monitoring_state ();
+ if (state == MonitoringInput || state == MonitoringCue) {
+ get_button(InputMonitor).set_led_state (_output_port, true);
+ } else {
+ get_button(InputMonitor).set_led_state (_output_port, false);
+ }
+ } else {
+ get_button(InputMonitor).set_led_state (_output_port, false);
+ }
}
void
@@ -1233,6 +1252,7 @@ CC121::map_stripable_state ()
map_recenable ();
map_gain ();
map_auto ();
+ map_monitoring ();
if (_current_stripable == session->monitor_out()) {
map_cut ();
diff --git a/libs/surfaces/cc121/cc121.h b/libs/surfaces/cc121/cc121.h
index 7c5bd39170..db3ef435ff 100644
--- a/libs/surfaces/cc121/cc121.h
+++ b/libs/surfaces/cc121/cc121.h
@@ -309,6 +309,7 @@ class CC121 : public ARDOUR::ControlProtocol, public AbstractUI<CC121Request> {
void map_gain ();
void map_cut ();
void map_auto ();
+ void map_monitoring ();
/* operations (defined in operations.cc) */