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.

80 lines
2.7KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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 || JUCE_MINGW
  18. #include <windows.h>
  19. #endif
  20. // Your project must contain an AppConfig.h file with your project-specific settings in it,
  21. // and your header search path must make it accessible to the module's files.
  22. #include "AppConfig.h"
  23. #include "../utility/juce_CheckSettingMacros.h"
  24. #include "juce_IncludeModuleHeaders.h"
  25. #if _MSC_VER || JUCE_MINGW
  26. #if JucePlugin_Build_RTAS
  27. extern "C" BOOL WINAPI DllMainRTAS (HINSTANCE, DWORD, LPVOID);
  28. #endif
  29. extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved)
  30. {
  31. if (reason == DLL_PROCESS_ATTACH)
  32. Process::setCurrentModuleInstanceHandle (instance);
  33. #if JucePlugin_Build_RTAS
  34. if (GetModuleHandleA ("DAE.DLL") != 0)
  35. {
  36. #if JucePlugin_Build_AAX
  37. if (! File::getSpecialLocation (File::currentExecutableFile).hasFileExtension ("aaxplugin"))
  38. #endif
  39. return DllMainRTAS (instance, reason, reserved);
  40. }
  41. #endif
  42. (void) reserved;
  43. return TRUE;
  44. }
  45. #endif
  46. //==============================================================================
  47. /** Somewhere in the codebase of your plugin, you need to implement this function
  48. and make it return a new instance of the filter subclass that you're building.
  49. */
  50. extern AudioProcessor* JUCE_CALLTYPE createPluginFilter();
  51. AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type)
  52. {
  53. AudioProcessor::setTypeOfNextNewPlugin (type);
  54. AudioProcessor* const pluginInstance = createPluginFilter();
  55. AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined);
  56. // your createPluginFilter() method must return an object!
  57. jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type);
  58. return pluginInstance;
  59. }