diff options
author | Robin Gareus <robin@gareus.org> | 2016-11-13 16:31:15 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-11-13 16:35:06 +0100 |
commit | 8b93fb02f38148c25c91ed41a4f12735be38dbf0 (patch) | |
tree | 3c10f8bc025cc8ec5489bd289b5eb27c9c6e5079 /libs/ardour/ardour | |
parent | 43bd7f5db18e2bf4c7de0bcf7f614399576712ab (diff) |
Mac VST-2.x support
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/buffer_set.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/mac_vst_plugin.h | 55 | ||||
-rw-r--r-- | libs/ardour/ardour/mac_vst_support.h | 39 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_manager.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_types.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/rc_configuration_vars.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/vst_info_file.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/vst_types.h | 3 |
8 files changed, 113 insertions, 3 deletions
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index 9ea6ab7d6a..f1b632e6e2 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -30,7 +30,7 @@ #include "ardour/libardour_visibility.h" #include "ardour/types.h" -#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT +#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined MACVST_SUPPORT #include "evoral/MIDIEvent.hpp" struct _VstEvents; typedef struct _VstEvents VstEvents; @@ -130,7 +130,7 @@ public: void forward_lv2_midi(LV2_Evbuf*, size_t, bool purge_ardour_buffer = true); #endif -#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT +#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined MACVST_SUPPORT VstEvents* get_vst_midi (size_t); #endif @@ -189,7 +189,7 @@ private: LV2Buffers _lv2_buffers; #endif -#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT +#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined MACVST_SUPPORT class VSTBuffer { public: VSTBuffer (size_t); diff --git a/libs/ardour/ardour/mac_vst_plugin.h b/libs/ardour/ardour/mac_vst_plugin.h new file mode 100644 index 0000000000..e5afab5e30 --- /dev/null +++ b/libs/ardour/ardour/mac_vst_plugin.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 Robin Gareus <robin@gareus.org> + * Copyright (C) 2004 Paul Davis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __ardour_mac_vst_plugin_h__ +#define __ardour_mac_vst_plugin_h__ + +#include "ardour/vst_plugin.h" + +struct LIBARDOUR_API _VSTHandle; +typedef struct _VSTHandle VSTHandle; + +namespace ARDOUR { + +class AudioEngine; +class Session; + +class LIBARDOUR_API MacVSTPlugin : public VSTPlugin +{ +public: + MacVSTPlugin (AudioEngine &, Session &, VSTHandle *, int unique_id); + MacVSTPlugin (const MacVSTPlugin &); + ~MacVSTPlugin (); + + std::string state_node_name () const { return "mac-vst"; } +}; + +class LIBARDOUR_API MacVSTPluginInfo : public PluginInfo +{ +public: + MacVSTPluginInfo (); + ~MacVSTPluginInfo () {} + + PluginPtr load (Session& session); + std::vector<Plugin::PresetRecord> get_presets (bool user_only) const; +}; + +} // namespace ARDOUR + +#endif /* __ardour_mac_vst_plugin_h__ */ diff --git a/libs/ardour/ardour/mac_vst_support.h b/libs/ardour/ardour/mac_vst_support.h new file mode 100644 index 0000000000..8a23960095 --- /dev/null +++ b/libs/ardour/ardour/mac_vst_support.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2016 Robin Gareus <robin@gareus.org> + * Copyright (C) 2012 Paul Davis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __mac_vst_support_h__ +#define __mac_vst_support_h__ + +#include <setjmp.h> +#include <signal.h> +#include <pthread.h> +#include <stdio.h> + +#include "ardour/libardour_visibility.h" +#include "ardour/vst_types.h" + +LIBARDOUR_API extern void (*mac_vst_error_callback)(const char *msg); +LIBARDOUR_API void mac_vst_error (const char *fmt, ...); + +LIBARDOUR_API extern VSTHandle * mac_vst_load (const char*); +LIBARDOUR_API extern int mac_vst_unload (VSTHandle *); +LIBARDOUR_API extern VSTState * mac_vst_instantiate (VSTHandle *, audioMasterCallback, void *); +LIBARDOUR_API extern void mac_vst_close (VSTState*); + +#endif /* ____mac_vst_support_h__ */ diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 1a925432a0..9de951dc23 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -47,6 +47,7 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { ARDOUR::PluginInfoList &windows_vst_plugin_info (); ARDOUR::PluginInfoList &lxvst_plugin_info (); + ARDOUR::PluginInfoList &mac_vst_plugin_info (); ARDOUR::PluginInfoList &ladspa_plugin_info (); ARDOUR::PluginInfoList &lv2_plugin_info (); ARDOUR::PluginInfoList &au_plugin_info (); @@ -110,6 +111,7 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { ARDOUR::PluginInfoList _empty_plugin_info; ARDOUR::PluginInfoList* _windows_vst_plugin_info; ARDOUR::PluginInfoList* _lxvst_plugin_info; + ARDOUR::PluginInfoList* _mac_vst_plugin_info; ARDOUR::PluginInfoList* _ladspa_plugin_info; ARDOUR::PluginInfoList* _lv2_plugin_info; ARDOUR::PluginInfoList* _au_plugin_info; @@ -127,11 +129,13 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { void lua_refresh (); void lua_refresh_cb (); void windows_vst_refresh (bool cache_only = false); + void mac_vst_refresh (bool cache_only = false); void lxvst_refresh (bool cache_only = false); void add_lrdf_data (const std::string &path); void add_ladspa_presets (); void add_windows_vst_presets (); + void add_mac_vst_presets (); void add_lxvst_presets (); void add_presets (std::string domain); @@ -142,6 +146,9 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { int windows_vst_discover_from_path (std::string path, bool cache_only = false); int windows_vst_discover (std::string path, bool cache_only = false); + int mac_vst_discover_from_path (std::string path, bool cache_only = false); + int mac_vst_discover (std::string path, bool cache_only = false); + int lxvst_discover_from_path (std::string path, bool cache_only = false); int lxvst_discover (std::string path, bool cache_only = false); diff --git a/libs/ardour/ardour/plugin_types.h b/libs/ardour/ardour/plugin_types.h index d997e2891a..3c37befc40 100644 --- a/libs/ardour/ardour/plugin_types.h +++ b/libs/ardour/ardour/plugin_types.h @@ -28,6 +28,7 @@ namespace ARDOUR { LV2, Windows_VST, LXVST, + MacVST, Lua, }; diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 62a15a3fe2..79db43a902 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -237,6 +237,7 @@ CONFIG_VARIABLE (bool, new_plugins_active, "new-plugins-active", true) CONFIG_VARIABLE (bool, use_plugin_own_gui, "use-plugin-own-gui", true) CONFIG_VARIABLE (bool, use_windows_vst, "use-windows-vst", true) CONFIG_VARIABLE (bool, use_lxvst, "use-lxvst", true) +CONFIG_VARIABLE (bool, use_macvst, "use-macvst", true) CONFIG_VARIABLE (bool, discover_vst_on_start, "discover-vst-on-start", false) CONFIG_VARIABLE (bool, verbose_plugin_scan, "verbose-plugin-scan", true) CONFIG_VARIABLE (int, vst_scan_timeout, "vst-scan-timeout", 600) /* deciseconds, per plugin, <= 0 no timeout */ diff --git a/libs/ardour/ardour/vst_info_file.h b/libs/ardour/ardour/vst_info_file.h index f253ab0b4b..b9567dec9f 100644 --- a/libs/ardour/ardour/vst_info_file.h +++ b/libs/ardour/ardour/vst_info_file.h @@ -60,6 +60,10 @@ LIBARDOUR_API extern std::vector<VSTInfo*> * vstfx_get_info_lx (char *, enum VST LIBARDOUR_API extern std::vector<VSTInfo*> * vstfx_get_info_fst (char *, enum VSTScanMode mode = VST_SCAN_USE_APP); #endif +#ifdef MACVST_SUPPORT +LIBARDOUR_API extern std::vector<VSTInfo*> * vstfx_get_info_mac (char *, enum VSTScanMode mode = VST_SCAN_USE_APP); +#endif + #ifndef VST_SCANNER_APP } // namespace #endif diff --git a/libs/ardour/ardour/vst_types.h b/libs/ardour/ardour/vst_types.h index aa6432876e..b9c62e4fe1 100644 --- a/libs/ardour/ardour/vst_types.h +++ b/libs/ardour/ardour/vst_types.h @@ -68,6 +68,9 @@ struct LIBARDOUR_API _VSTHandle main_entry_t main_entry; int plugincnt; +#ifdef MACVST_SUPPORT + int32_t res_file_id; +#endif }; typedef struct _VSTHandle VSTHandle; |