diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-07 02:23:56 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-07 02:23:56 +0100 |
commit | 9c97724fc96792a544f4efd1593eaf6e966d3645 (patch) | |
tree | 66d224018835636fc3ab58b163fb1412c7c2b32b | |
parent | 7598e71b65a782863552c90b49404b5dd0dbef99 (diff) |
Fix OSC endless loop for tracks with hidden plugins
-rw-r--r-- | libs/surfaces/osc/osc.cc | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 4daf6dd6f9..e7dce2cca2 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -3083,32 +3083,25 @@ OSC::_sel_plugin (int id, lo_address addr) return 1; } - // find out how many plugins we have - bool plugs; - int nplugs = 0; + /* find out how many plugins we have */ sur->plugins.clear(); - do { - plugs = false; - if (r->nth_plugin (nplugs)) { - if (r->nth_plugin(nplugs)->display_to_user()) { -#ifdef MIXBUS - // need to check for mixbus channel strips (and exclude them) - boost::shared_ptr<Processor> proc = r->nth_plugin (nplugs); - boost::shared_ptr<PluginInsert> pi; - if ((pi = boost::dynamic_pointer_cast<PluginInsert>(proc))) { - - if (!pi->is_channelstrip()) { -#endif - sur->plugins.push_back (nplugs); - nplugs++; + for (int nplugs = 0; true; ++nplugs) { + boost::shared_ptr<Processor> proc = r->nth_plugin (nplugs); + if (!proc) { + break; + } + if (!r->nth_plugin(nplugs)->display_to_user()) { + continue; + } #ifdef MIXBUS - } - } -#endif - } - plugs = true; + /* need to check for mixbus channel strips (and exclude them) */ + boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(proc); + if (pi && pi->is_channelstrip()) { + continue; } - } while (plugs); +#endif + sur->plugins.push_back (nplugs); + } // limit plugin_id to actual plugins if (sur->plugins.size() < 1) { |