WebSockets: add record state support to surface

This commit is contained in:
Luciano Iam 2020-04-18 12:58:46 +02:00 committed by Robin Gareus
parent 5105219076
commit bfbb15011c
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 19 additions and 1 deletions

View file

@ -54,6 +54,7 @@ void
WebsocketsDispatcher::update_all_nodes (Client client) WebsocketsDispatcher::update_all_nodes (Client client)
{ {
update (client, Node::transport_roll, globals ().transport_roll ()); update (client, Node::transport_roll, globals ().transport_roll ());
update (client, Node::record_state, globals ().record_state ());
update (client, Node::tempo, globals ().tempo ()); update (client, Node::tempo, globals ().tempo ());
for (uint32_t strip_n = 0; strip_n < strips ().strip_count (); ++strip_n) { for (uint32_t strip_n = 0; strip_n < strips ().strip_count (); ++strip_n) {

View file

@ -39,7 +39,7 @@ struct TransportObserver {
struct RecordStateObserver { struct RecordStateObserver {
void operator() (ArdourFeedback* p) void operator() (ArdourFeedback* p)
{ {
// TO DO p->update_all (Node::record_state, p->globals ().record_state ());
} }
}; };

View file

@ -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 double
ArdourGlobals::tempo () const ArdourGlobals::tempo () const
{ {

View file

@ -31,6 +31,9 @@ public:
bool transport_roll () const; bool transport_roll () const;
void set_transport_roll (bool); void set_transport_roll (bool);
bool record_state () const;
void set_record_state (bool);
double tempo () const; double tempo () const;
void set_tempo (double); void set_tempo (double);
}; };