OSC: Plugin activate should detect no plugins
This commit is contained in:
parent
f3185032a0
commit
15fa89c8dd
@ -4535,21 +4535,23 @@ OSC::sel_plugin_activate (float state, lo_message msg)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
OSCSurface *sur = get_surface(get_address (msg));
|
OSCSurface *sur = get_surface(get_address (msg));
|
||||||
boost::shared_ptr<Stripable> s = sur->select;
|
if (sur->plugins.size() > 0) {
|
||||||
|
boost::shared_ptr<Stripable> s = sur->select;
|
||||||
|
|
||||||
boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (s);
|
boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (s);
|
||||||
|
|
||||||
if (r) {
|
if (r) {
|
||||||
boost::shared_ptr<Processor> redi=r->nth_plugin (sur->plugins[sur->plugin_id -1]);
|
boost::shared_ptr<Processor> redi=r->nth_plugin (sur->plugins[sur->plugin_id -1]);
|
||||||
if (redi) {
|
if (redi) {
|
||||||
boost::shared_ptr<PluginInsert> pi;
|
boost::shared_ptr<PluginInsert> pi;
|
||||||
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
|
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
|
||||||
if(state > 0) {
|
if(state > 0) {
|
||||||
pi->activate();
|
pi->activate();
|
||||||
} else {
|
} else {
|
||||||
pi->deactivate();
|
pi->deactivate();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user