forked from obsproject/obs-vst
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VSTPlugin-win.cpp: Add Support for various other types of plugins
See Github Issue obsproject#11 about plugins where OBS doesn't show an interface. Fixed.
- Loading branch information
Showing
1 changed file
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/***************************************************************************** | ||
Copyright (C) 2016-2017 by Colin Edwards. | ||
Additional Code Copyright (C) 2016-2017 by c3r1c3 <[email protected]> | ||
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 | ||
|
@@ -28,15 +29,29 @@ AEffect* VSTPlugin::loadEffect() { | |
dllHandle = LoadLibraryW(wpath); | ||
bfree(wpath); | ||
if(dllHandle == nullptr) { | ||
printf("Failed trying to load VST from '%s', error %d\n", | ||
pluginPath, GetLastError()); | ||
if (errorCode == ERROR_BAD_EXE_FORMAT) { | ||
printf("Could not open library, wrong architecture."); | ||
} else { | ||
printf("Failed trying to load VST from '%s', error %d\n", | ||
pluginPath, GetLastError()); | ||
} | ||
return nullptr; | ||
} | ||
|
||
vstPluginMain mainEntryPoint = | ||
(vstPluginMain)GetProcAddress(dllHandle, "VSTPluginMain"); | ||
|
||
if (!mainEntryPoint) { | ||
if (mainEntryPoint == nullptr) { | ||
mainEntryPoint = | ||
(vstPluginMain)GetProcAddress(libraryHandle, "VstPluginMain()"); | ||
} | ||
|
||
if (mainEntryPoint == nullptr) { | ||
mainEntryPoint = (vstPluginMain)GetProcAddress(libraryHandle, "main"); | ||
} | ||
|
||
if (mainEntryPoint == nullptr) { | ||
printf("Couldn't get a pointer to plugin's main()"); | ||
return nullptr; | ||
} | ||
|
||
|