The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #if _MSC_VER || defined (__MINGW32__) || defined (__MINGW64__)
  18. #include <windows.h>
  19. #endif
  20. #include "../../juce_core/system/juce_TargetPlatform.h"
  21. #include "../utility/juce_CheckSettingMacros.h"
  22. #include "juce_IncludeModuleHeaders.h"
  23. namespace juce
  24. {
  25. AudioProcessor::WrapperType PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_Undefined;
  26. }
  27. #if _MSC_VER || JUCE_MINGW
  28. #if JucePlugin_Build_RTAS
  29. extern "C" BOOL WINAPI DllMainRTAS (HINSTANCE, DWORD, LPVOID);
  30. #endif
  31. extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved)
  32. {
  33. if (reason == DLL_PROCESS_ATTACH)
  34. Process::setCurrentModuleInstanceHandle (instance);
  35. #if JucePlugin_Build_RTAS
  36. if (GetModuleHandleA ("DAE.DLL") != 0)
  37. {
  38. #if JucePlugin_Build_AAX
  39. if (! File::getSpecialLocation (File::currentExecutableFile).hasFileExtension ("aaxplugin"))
  40. #endif
  41. return DllMainRTAS (instance, reason, reserved);
  42. }
  43. #endif
  44. ignoreUnused (reserved);
  45. return TRUE;
  46. }
  47. #endif
  48. //==============================================================================
  49. /** Somewhere in the codebase of your plugin, you need to implement this function
  50. and make it return a new instance of the filter subclass that you're building.
  51. */
  52. extern AudioProcessor* JUCE_CALLTYPE createPluginFilter();
  53. AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type)
  54. {
  55. AudioProcessor::setTypeOfNextNewPlugin (type);
  56. AudioProcessor* const pluginInstance = createPluginFilter();
  57. AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined);
  58. // your createPluginFilter() method must return an object!
  59. jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type);
  60. return pluginInstance;
  61. }