diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-02-27 17:11:21 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-02-27 17:11:21 +0000 |
commit | 63189be1df97d5a8659af8b76d1ca6b10d0e9627 (patch) | |
tree | f8c4ca5abc7cdedd2913a6ebe696635140cdd64e /libs/ardour/vst_plugin.cc | |
parent | 903c0863d9c7490c86cbcb652bd362a266a6d468 (diff) |
vestige-based VST support, back-ported from 2.0-ongoing
git-svn-id: svn://localhost/ardour2/branches/3.0@4703 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r-- | libs/ardour/vst_plugin.cc | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 242d9ecfdb..cd2531d522 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -146,14 +146,14 @@ VSTPlugin::get_state() XMLNode *root = new XMLNode (state_node_name()); LocaleGuard lg (X_("POSIX")); - if (_plugin->flags & effFlagsProgramChunks) { + if (_plugin->flags & 32 /* effFlagsProgramsChunks */) { /* fetch the current chunk */ void* data; long data_size; - if ((data_size = _plugin->dispatcher (_plugin, effGetChunk, 0, 0, &data, false)) == 0) { + if ((data_size = _plugin->dispatcher (_plugin, 23 /* effGetChunk */, 0, 0, &data, false)) == 0) { return *root; } @@ -262,6 +262,8 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) if (_plugin->dispatcher (_plugin, effGetParameterProperties, which, 0, &prop, 0)) { +#ifdef VESTIGE_COMPLETE + /* i have yet to find or hear of a VST plugin that uses this */ if (prop.flags & kVstParameterUsesIntegerMinMax) { @@ -297,6 +299,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) desc.logarithmic = false; desc.sr_dependent = false; desc.label = prop.label; +#endif } else { @@ -325,7 +328,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) bool VSTPlugin::load_preset (string name) { - if (_plugin->flags & effFlagsProgramChunks) { + if (_plugin->flags & 32 /* effFlagsProgramsChunks */) { error << _("no support for presets using chunks at this time") << endmsg; return false; @@ -336,7 +339,7 @@ VSTPlugin::load_preset (string name) bool VSTPlugin::save_preset (string name) { - if (_plugin->flags & effFlagsProgramChunks) { + if (_plugin->flags & 32 /* effFlagsProgramsChunks */) { error << _("no support for presets using chunks at this time") << endmsg; return false; @@ -359,7 +362,11 @@ VSTPlugin::signal_latency () const return _user_latency; } - return _plugin->initialDelay; +#ifdef VESTIGE_HEADER + return *((nframes_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */ +#else + return _plugin->initial_delay; +#endif } set<uint32_t> @@ -424,8 +431,13 @@ string VSTPlugin::unique_id() const { char buf[32]; - snprintf (buf, sizeof (buf), "%d", _plugin->uniqueID); - return string (buf); + +#ifdef VESTIGE_HEADER + snprintf (buf, sizeof (buf), "%d", *((int32_t*) &_plugin->unused_id)); +#else + snprintf (buf, sizeof (buf), "%d", _plugin->uniqueID); +#endif + return string (buf); } |