diff options
author | Len Ovens <len@ovenwerks.net> | 2017-06-22 22:37:38 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2017-06-22 22:40:06 -0700 |
commit | 5aad9d9a336082844acddc44a051ddb851cd67ec (patch) | |
tree | 7d8ddfb6f6032318432cace09bad99baf7003f91 /libs/surfaces/osc/osc.cc | |
parent | d972fa431ce649352c2173dfe498f7da338eac86 (diff) |
OSC: only show visible plugins (not MB channel strip PI)
Diffstat (limited to 'libs/surfaces/osc/osc.cc')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 90989c5d18..e47e145327 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2028,29 +2028,44 @@ OSC::_sel_plugin (int id, lo_address addr) // find out how many plugins we have bool plugs; int nplugs = 0; + sur->plugins.clear(); do { plugs = false; if (r->nth_plugin (nplugs)) { - /// need to check for mixbus channel strips (and exclude them) + 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); +#ifdef MIXBUS + } + } +#endif + } plugs = true; nplugs++; } } while (plugs); // limit plugin_id to actual plugins - if (!nplugs) { + if (!sur->plugins.size()) { sur->plugin_id = 0; return 0; - } else if (nplugs < id) { - sur->plugin_id = nplugs; - } else if (nplugs && !id) { + } else if (sur->plugins.size() < (uint32_t) id) { + sur->plugin_id = sur->plugins.size(); + } else if (sur->plugins.size() && !id) { sur->plugin_id = 1; } else { sur->plugin_id = id; } // we have a plugin number now get the processor - boost::shared_ptr<Processor> proc = r->nth_plugin (sur->plugin_id - 1); + boost::shared_ptr<Processor> proc = r->nth_plugin (sur->plugins[sur->plugin_id - 1]); boost::shared_ptr<PluginInsert> pi; if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(proc))) { PBD::warning << "OSC: Plugin: " << sur->plugin_id << " does not seem to be a plugin" << endmsg; @@ -3763,7 +3778,7 @@ OSC::select_plugin_parameter (const char *path, const char* types, lo_arg **argv return 1; } - boost::shared_ptr<Processor> proc = r->nth_plugin (sur->plugin_id - 1); + boost::shared_ptr<Processor> proc = r->nth_plugin (sur->plugins[sur->plugin_id - 1]); boost::shared_ptr<PluginInsert> pi; if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(proc))) { return 1; |