Implementations for Plugin-Preset-Load to set automation
authorRobin Gareus <robin@gareus.org>
Tue, 21 Feb 2017 14:24:02 +0000 (15:24 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 21 Feb 2017 14:24:20 +0000 (15:24 +0100)
libs/ardour/ladspa_plugin.cc
libs/ardour/luaproc.cc
libs/ardour/lv2_plugin.cc
libs/ardour/vst_plugin.cc

index b5106cb4ca9b4b0b21915c6081fe1df796bc202d..075dc4b579b87a8a5977e8bc4f409f46fad08196 100644 (file)
@@ -808,6 +808,7 @@ LadspaPlugin::load_preset (PresetRecord r)
                for (uint32_t i = 0; i < (uint32_t) defs->count; ++i) {
                        if (parameter_is_input (defs->items[i].pid)) {
                                set_parameter(defs->items[i].pid, defs->items[i].value);
+                               PresetPortSetValue (defs->items[i].pid, defs->items[i].value); /* EMIT SIGNAL */
                        }
                }
                lrdf_free_setting_values(defs);
index 4bc2c00c8ba2e836533fadcddedb544ce4616d06..9b51565b9ca15a83664bc17cf80430427e1a6920 100644 (file)
@@ -1125,7 +1125,10 @@ LuaProc::load_preset (PresetRecord r)
                                assert (index);
                                assert (value);
                                LocaleGuard lg;
-                               set_parameter (atoi (index->value().c_str()), atof (value->value().c_str ()));
+                               const uint32_t p = atoi (index->value().c_str());
+                               const float v = atof (value->value().c_str ());
+                               set_parameter (p, v);
+                               PresetPortSetValue (p, v); /* EMIT SIGNAL */
                        }
                }
                return Plugin::load_preset(r);
index a1a7ce860a4d56ceea7cb754c4b97d8c8d93662e..7923bb66a1577d18c1a6ee179d5bc3f49ed64069 100644 (file)
@@ -1434,6 +1434,7 @@ set_port_value(const char* port_symbol,
        const uint32_t port_index = self->port_index(port_symbol);
        if (port_index != (uint32_t)-1) {
                self->set_parameter(port_index, *(const float*)value);
+               self->PresetPortSetValue (port_index, *(const float*)value); /* EMIT SIGNAL */
        }
 }
 
index 2b3a98d3c85c8292ab7addcb5a6c0807356a5bf2..44972151f0c7c3c3e30f6663ce7b377b79b65918 100644 (file)
@@ -446,8 +446,10 @@ VSTPlugin::load_user_preset (PresetRecord r)
 
                                                assert (index);
                                                assert (value);
-
-                                               set_parameter (atoi (index->value().c_str()), atof (value->value().c_str ()));
+                                               const uint32_t p = atoi (index->value().c_str());
+                                               const float v = atof (value->value().c_str ());
+                                               set_parameter (p, v);
+                                               PresetPortSetValue (p, v); /* EMIT SIGNAL */
                                }
                        }
                        return true;