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.

77 lines
2.6KB

  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. #if _MSC_VER || JUCE_MINGW
  24. #if JucePlugin_Build_RTAS
  25. extern "C" BOOL WINAPI DllMainRTAS (HINSTANCE, DWORD, LPVOID);
  26. #endif
  27. extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved)
  28. {
  29. if (reason == DLL_PROCESS_ATTACH)
  30. Process::setCurrentModuleInstanceHandle (instance);
  31. #if JucePlugin_Build_RTAS
  32. if (GetModuleHandleA ("DAE.DLL") != 0)
  33. {
  34. #if JucePlugin_Build_AAX
  35. if (! File::getSpecialLocation (File::currentExecutableFile).hasFileExtension ("aaxplugin"))
  36. #endif
  37. return DllMainRTAS (instance, reason, reserved);
  38. }
  39. #endif
  40. ignoreUnused (reserved);
  41. return TRUE;
  42. }
  43. #endif
  44. //==============================================================================
  45. /** Somewhere in the codebase of your plugin, you need to implement this function
  46. and make it return a new instance of the filter subclass that you're building.
  47. */
  48. extern AudioProcessor* JUCE_CALLTYPE createPluginFilter();
  49. AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type)
  50. {
  51. AudioProcessor::setTypeOfNextNewPlugin (type);
  52. AudioProcessor* const pluginInstance = createPluginFilter();
  53. AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined);
  54. // your createPluginFilter() method must return an object!
  55. jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type);
  56. return pluginInstance;
  57. }