13
0

OSC: only show visible plugins (not MB channel strip PI)

This commit is contained in:
Len Ovens 2017-06-22 22:37:38 -07:00
parent d972fa431c
commit 5aad9d9a33
3 changed files with 24 additions and 8 deletions

View File

@ -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;

View File

@ -126,6 +126,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
uint32_t plug_page_size; // plugin page size (number of controls)
int plugin_id; // id of current plugin
std::vector<int> plug_params; // vector to store ports that are controls
std::vector<int> plugins; // stores allowable plugins with index (work around MB strip PIs)
int send_page; // current send page
uint32_t send_page_size; // send page size in channels
PBD::ScopedConnection proc_connection; // for processor signal monitoring

View File

@ -326,7 +326,7 @@ OSCSelectObserver::plugin_init()
}
// 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))) {
return;