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 | |
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')
-rw-r--r-- | libs/ardour/audioengine.cc | 3 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 2 | ||||
-rw-r--r-- | libs/ardour/plugin_manager.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_vst.cc | 2 | ||||
-rw-r--r-- | libs/ardour/vst_plugin.cc | 26 |
5 files changed, 22 insertions, 13 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 3d2c4b7e9d..19e6c27ba4 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -41,9 +41,6 @@ #include "ardour/utils.h" #include "ardour/event_type_map.h" #include "ardour/io.h" -#ifdef VST_SUPPORT -#include <fst.h> -#endif #include "ardour/timestamps.h" diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index b1b934c43f..594b4fcd48 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -315,7 +315,7 @@ ARDOUR::init (bool use_vst, bool try_optimization) #ifdef VST_SUPPORT - if (Config->get_use_vst() && fst_init ()) { + if (Config->get_use_vst() && fst_init (0)) { return -1; } #endif diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index bf62412700..c665c72126 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -526,7 +526,7 @@ PluginManager::vst_discover (string path) info->unique_id = buf; info->category = "VST"; info->path = path; - // need to set info->creator but FST doesn't provide it + info->creator = finfo->creator; info->index = 0; info->n_inputs = finfo->numInputs; info->n_outputs = finfo->numOutputs; diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index 89fb2a8397..86b541f467 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -52,7 +52,7 @@ long Session::vst_callback (AEffect* effect, SHOW_CALLBACK ("am callback, opcode = %d", opcode); if (effect && effect->user) { - plug = static_cast<VSTPlugin*> (effect->user); + plug = (VSTPlugin*) (effect->user); session = &plug->session(); } else { plug = 0; 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); } |