diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 1738b8da774..ac5ff8e6d6e 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2888,7 +2888,7 @@ OSC::_sel_plugin (int id, lo_address addr) sur->plugin_id = 0; sur->plug_page = 1; if (sur->sel_obs) { - sur->sel_obs->set_plugin_id(-1, 1); + sur->sel_obs->set_plugin_id(0, 1); } return 0; } else if (id < 1) { @@ -2924,7 +2924,7 @@ OSC::_sel_plugin (int id, lo_address addr) sur->plug_page = 1; if (sur->sel_obs) { - sur->sel_obs->set_plugin_id(sur->plugins[sur->plugin_id - 1], sur->plug_page); + sur->sel_obs->set_plugin_id(sur->plugin_id, sur->plug_page); } return 0; } diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index a965b2f322c..5507ddbe70d 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -77,9 +77,9 @@ OSCSelectObserver::OSCSelectObserver (OSC& o, ARDOUR::Session& s, ArdourSurface: plug_size = plug_page_size; plug_page = sur->plug_page; if (sur->plugins.size () > 0) { - plug_id = sur->plugins[sur->plugin_id - 1]; + selected_piid = sur->plugin_id; } else { - plug_id = -1; + selected_piid = 0; } _group_sharing[15] = 1; refresh_strip (sur->select, sur->nsends, gainmode, true); @@ -441,7 +441,7 @@ OSCSelectObserver::send_end () void OSCSelectObserver::set_plugin_id (int id, uint32_t page) { - plug_id = id; + selected_piid = id; plug_page = page; renew_plugin (); } @@ -469,7 +469,7 @@ OSCSelectObserver::renew_plugin () { void OSCSelectObserver::plugin_init() { - if (plug_id < 0) { + if (!selected_piid) { plugin_end (); return; } @@ -480,7 +480,7 @@ OSCSelectObserver::plugin_init() } // we have a plugin number now get the processor - std::shared_ptr proc = r->nth_plugin (plug_id); + std::shared_ptr proc = r->nth_plugin (sur->plugins[selected_piid - 1]); std::shared_ptr pi; if (!(pi = std::dynamic_pointer_cast(proc))) { plugin_end (); diff --git a/libs/surfaces/osc/osc_select_observer.h b/libs/surfaces/osc/osc_select_observer.h index 171a985ddc6..30ff9978335 100644 --- a/libs/surfaces/osc/osc_select_observer.h +++ b/libs/surfaces/osc/osc_select_observer.h @@ -89,7 +89,7 @@ class OSCSelectObserver uint32_t nplug_params; uint32_t plug_page_size; uint32_t plug_page; - int plug_id; + uint32_t selected_piid; uint32_t plug_size; std::vector plug_params; int eq_bands;