summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2018-01-02 10:22:42 -0800
committerLen Ovens <len@ovenwerks.net>2018-01-02 10:23:11 -0800
commit15fa89c8dd30e42f461f788d0b7be30f11e68a82 (patch)
treec1c1d266122b08da975b94063217175ff431b3a0 /libs/surfaces
parentf3185032a02c545d9e8b0309bfc4a765f3b2d391 (diff)
OSC: Plugin activate should detect no plugins
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/osc/osc.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index eeb13106e9..c9f4b707c1 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -4535,21 +4535,23 @@ OSC::sel_plugin_activate (float state, lo_message msg)
return -1;
}
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) {
- boost::shared_ptr<Processor> redi=r->nth_plugin (sur->plugins[sur->plugin_id -1]);
- if (redi) {
- boost::shared_ptr<PluginInsert> pi;
- if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
- if(state > 0) {
- pi->activate();
- } else {
- pi->deactivate();
+ if (r) {
+ boost::shared_ptr<Processor> redi=r->nth_plugin (sur->plugins[sur->plugin_id -1]);
+ if (redi) {
+ boost::shared_ptr<PluginInsert> pi;
+ if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
+ if(state > 0) {
+ pi->activate();
+ } else {
+ pi->deactivate();
+ }
+ return 0;
}
- return 0;
}
}
}