13
0

osc: Let OSCSelectObserver know about feedback config changes

Before this commit, OSCSelectObserver would read the feedback value when
it was created, but then never update it anymore. In practice, the
OSCSelectObserver is created on startup, and when the surface connects
and configures feeback, this value is not applied.

For example, when sending `/set_surface` with a feedback value of
4 (Send SSID as path extension), `/strip/*` would get their ssid put
into the path, but `/select/plugin/*` messages would not have their
parameter id in the path. When setting the corresponding checkbox in the
default feedback preferences, it is applied as expected.

This commit passes the new feedback value to the OSCSelectObserver
instance whenever it changes, which ensures the value is applied as
expected.
This commit is contained in:
Matthijs Kooijman 2024-06-30 13:29:09 +02:00 committed by Robin Gareus
parent 867eaa0b13
commit 142fa9f55d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 17 additions and 2 deletions

View File

@ -1873,6 +1873,9 @@ OSC::set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gm, ui
s->bank_size = b_size; s->bank_size = b_size;
s->strip_types = strips; s->strip_types = strips;
s->feedback = fb; s->feedback = fb;
if (s->sel_obs) {
s->sel_obs->set_feedback(fb);
}
s->gainmode = gm; s->gainmode = gm;
if (s->strip_types[10]) { if (s->strip_types[10]) {
s->usegroup = PBD::Controllable::UseGroup; s->usegroup = PBD::Controllable::UseGroup;
@ -1953,6 +1956,9 @@ OSC::set_surface_feedback (uint32_t fb, lo_message msg)
} }
OSCSurface *s = get_surface(get_address (msg), true); OSCSurface *s = get_surface(get_address (msg), true);
s->feedback = fb; s->feedback = fb;
if (s->sel_obs) {
s->sel_obs->set_feedback(fb);
}
strip_feedback (s, true); strip_feedback (s, true);
global_feedback (s); global_feedback (s);

View File

@ -68,8 +68,7 @@ OSCSelectObserver::OSCSelectObserver (OSC& o, ARDOUR::Session& s, ArdourSurface:
session = &s; session = &s;
addr = lo_address_new_from_url (sur->remote_url.c_str()); addr = lo_address_new_from_url (sur->remote_url.c_str());
gainmode = sur->gainmode; gainmode = sur->gainmode;
feedback = sur->feedback; set_feedback(sur->feedback);
in_line = feedback[2];
send_page_size = sur->send_page_size; send_page_size = sur->send_page_size;
send_size = send_page_size; send_size = send_page_size;
send_page = sur->send_page; send_page = sur->send_page;
@ -93,6 +92,15 @@ OSCSelectObserver::~OSCSelectObserver ()
lo_address_free (addr); lo_address_free (addr);
} }
void
OSCSelectObserver::set_feedback (std::bitset<32> fb)
{
feedback = fb;
in_line = fb[2];
// No explicit refresh, callers should take care of that to
// prevent duplicate refreshing
}
void void
OSCSelectObserver::no_strip () OSCSelectObserver::no_strip ()
{ {

View File

@ -54,6 +54,7 @@ class OSCSelectObserver
void set_plugin_id (int id, uint32_t page); void set_plugin_id (int id, uint32_t page);
void set_plugin_page (uint32_t page); void set_plugin_page (uint32_t page);
void set_plugin_size (uint32_t size); void set_plugin_size (uint32_t size);
void set_feedback (std::bitset<32> fb);
private: private:
std::shared_ptr<ARDOUR::Stripable> _strip; std::shared_ptr<ARDOUR::Stripable> _strip;