13
0

Tweak/optimize VST callback:

The audioMasterAutomate callback from plugin to host does include
the parameter-value.

Previously there was a redundant call
Plugin::parameter_changed_externally() -> get_parameter
-> VSTPlugin::get_parameter()   back into the plugin to query the value.

calling back into the plugin from the callback, may explain
oddities and/or crashes with some VSTs.
This commit is contained in:
Robin Gareus 2017-02-28 20:08:03 +01:00
parent c7168b387b
commit a80920c016
3 changed files with 11 additions and 1 deletions

View File

@ -333,7 +333,7 @@ protected:
/* Called when a parameter of the plugin is changed outside of this /* Called when a parameter of the plugin is changed outside of this
* host's control (typical via a plugin's own GUI/editor) * host's control (typical via a plugin's own GUI/editor)
*/ */
void parameter_changed_externally (uint32_t which, float val); virtual void parameter_changed_externally (uint32_t which, float val);
/* should be overridden by plugin API specific derived types to /* should be overridden by plugin API specific derived types to
* actually implement changing the parameter. The derived type should * actually implement changing the parameter. The derived type should

View File

@ -40,6 +40,7 @@ class PluginInsert;
class LIBARDOUR_API VSTPlugin : public Plugin class LIBARDOUR_API VSTPlugin : public Plugin
{ {
public: public:
friend class Session;
VSTPlugin (AudioEngine &, Session &, VSTHandle *); VSTPlugin (AudioEngine &, Session &, VSTHandle *);
VSTPlugin (const VSTPlugin& other); VSTPlugin (const VSTPlugin& other);
virtual ~VSTPlugin (); virtual ~VSTPlugin ();
@ -99,6 +100,7 @@ public:
protected: protected:
void parameter_changed_externally (uint32_t which, float val);
void set_plugin (AEffect *); void set_plugin (AEffect *);
gchar* get_chunk (bool) const; gchar* get_chunk (bool) const;
int set_chunk (gchar const *, bool); int set_chunk (gchar const *, bool);

View File

@ -137,6 +137,14 @@ VSTPlugin::set_parameter (uint32_t which, float newval)
} }
} }
void
VSTPlugin::parameter_changed_externally (uint32_t which, float value )
{
ParameterChangedExternally (which, value); /* EMIT SIGNAL */
Plugin::set_parameter (which, value);
}
uint32_t uint32_t
VSTPlugin::nth_parameter (uint32_t n, bool& ok) const VSTPlugin::nth_parameter (uint32_t n, bool& ok) const
{ {