mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Clean up main plugin entry point
This commit is contained in:
+11
-14
@@ -25,9 +25,11 @@
|
|||||||
#define VST_EXPORT __attribute__((visibility("default")))
|
#define VST_EXPORT __attribute__((visibility("default")))
|
||||||
|
|
||||||
// The main entry point for VST plugins should be called `VSTPluginMain``. The
|
// The main entry point for VST plugins should be called `VSTPluginMain``. The
|
||||||
// other one exist for legacy reasons since some old hosts might still use
|
// other one exist for legacy reasons since some old hosts might still use them.
|
||||||
// them.`
|
// There's also another possible legacy entry point just called `main`, but GCC
|
||||||
extern "C" {
|
// will refuse to compile a function called `main` that's not a regular C++ main
|
||||||
|
// function
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main VST plugin entry point. We first set up a bridge that connects to a
|
* The main VST plugin entry point. We first set up a bridge that connects to a
|
||||||
* Wine process that hosts the Windows VST plugin. We then create and return a
|
* Wine process that hosts the Windows VST plugin. We then create and return a
|
||||||
@@ -37,17 +39,8 @@ extern "C" {
|
|||||||
* manual memory management. Clean up is done when we receive the `effClose`
|
* manual memory management. Clean up is done when we receive the `effClose`
|
||||||
* opcode from the VST host (i.e. opcode 1).`
|
* opcode from the VST host (i.e. opcode 1).`
|
||||||
*/
|
*/
|
||||||
extern VST_EXPORT AEffect* VSTPluginMain(audioMasterCallback);
|
extern "C" VST_EXPORT AEffect* VSTPluginMain(
|
||||||
|
audioMasterCallback host_callback) {
|
||||||
// There's also another possible legacy entry point just called `main`, but GCC
|
|
||||||
// will refuse to compile a function called `main` that's not a regular C++ main
|
|
||||||
// function
|
|
||||||
VST_EXPORT AEffect* main_plugin(audioMasterCallback audioMaster) {
|
|
||||||
return VSTPluginMain(audioMaster);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VST_EXPORT AEffect* VSTPluginMain(audioMasterCallback host_callback) {
|
|
||||||
try {
|
try {
|
||||||
// This is the only place where we have to use manual memory management.
|
// This is the only place where we have to use manual memory management.
|
||||||
// The bridge's destructor is called when the `effClose` opcode is
|
// The bridge's destructor is called when the `effClose` opcode is
|
||||||
@@ -63,3 +56,7 @@ VST_EXPORT AEffect* VSTPluginMain(audioMasterCallback host_callback) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" VST_EXPORT AEffect* main_plugin(audioMasterCallback audioMaster) {
|
||||||
|
return VSTPluginMain(audioMaster);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user