summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorLuciano Iam <lucianito@gmail.com>2020-04-18 12:58:46 +0200
committerRobin Gareus <robin@gareus.org>2020-04-20 22:59:15 +0200
commitbfbb15011c07aab847fe2592c2884b6bc27aafb8 (patch)
treeb6315a0af407a9952446624fd22a3bfbbfcfd0a9 /libs/surfaces
parent5105219076687acac15b9df85a2d7f51c7437bc8 (diff)
WebSockets: add record state support to surface
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/websockets/dispatcher.cc1
-rw-r--r--libs/surfaces/websockets/feedback.cc2
-rw-r--r--libs/surfaces/websockets/globals.cc14
-rw-r--r--libs/surfaces/websockets/globals.h3
4 files changed, 19 insertions, 1 deletions
diff --git a/libs/surfaces/websockets/dispatcher.cc b/libs/surfaces/websockets/dispatcher.cc
index 688044a8f7..f9e8fabc40 100644
--- a/libs/surfaces/websockets/dispatcher.cc
+++ b/libs/surfaces/websockets/dispatcher.cc
@@ -54,6 +54,7 @@ void
WebsocketsDispatcher::update_all_nodes (Client client)
{
update (client, Node::transport_roll, globals ().transport_roll ());
+ update (client, Node::record_state, globals ().record_state ());
update (client, Node::tempo, globals ().tempo ());
for (uint32_t strip_n = 0; strip_n < strips ().strip_count (); ++strip_n) {
diff --git a/libs/surfaces/websockets/feedback.cc b/libs/surfaces/websockets/feedback.cc
index d08238c989..582bf8b9f2 100644
--- a/libs/surfaces/websockets/feedback.cc
+++ b/libs/surfaces/websockets/feedback.cc
@@ -39,7 +39,7 @@ struct TransportObserver {
struct RecordStateObserver {
void operator() (ArdourFeedback* p)
{
- // TO DO
+ p->update_all (Node::record_state, p->globals ().record_state ());
}
};
diff --git a/libs/surfaces/websockets/globals.cc b/libs/surfaces/websockets/globals.cc
index 0689f32df9..3dd90cadd9 100644
--- a/libs/surfaces/websockets/globals.cc
+++ b/libs/surfaces/websockets/globals.cc
@@ -37,6 +37,20 @@ ArdourGlobals::set_transport_roll (bool value)
}
}
+bool
+ArdourGlobals::record_state () const
+{
+ return static_cast<bool>(session ().get_record_enabled ());
+}
+
+void
+ArdourGlobals::set_record_state (bool value)
+{
+ if ((value && !record_state ()) || (!value && record_state ())) {
+ basic_ui ().rec_enable_toggle ();
+ }
+}
+
double
ArdourGlobals::tempo () const
{
diff --git a/libs/surfaces/websockets/globals.h b/libs/surfaces/websockets/globals.h
index dd6b8b14d1..8c3e5a2009 100644
--- a/libs/surfaces/websockets/globals.h
+++ b/libs/surfaces/websockets/globals.h
@@ -31,6 +31,9 @@ public:
bool transport_roll () const;
void set_transport_roll (bool);
+ bool record_state () const;
+ void set_record_state (bool);
+
double tempo () const;
void set_tempo (double);
};