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.

93 lines
3.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. // Your project must contain an AppConfig.h file with your project-specific settings in it,
  19. // and your header search path must make it accessible to the module's files.
  20. #include "AppConfig.h"
  21. #include "../utility/juce_CheckSettingMacros.h"
  22. #if JucePlugin_Build_RTAS
  23. #include "juce_RTAS_DigiCode_Header.h"
  24. /*
  25. This file is used to include and build the required digidesign CPP files without your project
  26. needing to reference the files directly. Because these files will be found via your include path,
  27. this means that the project doesn't have to change to cope with people's SDKs being in different
  28. locations.
  29. Important note on Windows: In your project settings for the three juce_RTAS_DigiCode.cpp files and
  30. the juce_RTAS_Wrapper.cpp file, you need to set the calling convention to "__stdcall".
  31. If you don't do this, you'll get some unresolved externals and will spend a long time wondering what's
  32. going on... All the other files in your project can be set to use the normal __cdecl convention.
  33. If you get an error building the includes statements below, check your paths - there's a full
  34. list of the necessary Digidesign paths in juce_RTAS_Wrapper.cpp
  35. */
  36. #if WINDOWS_VERSION
  37. //==============================================================================
  38. #undef _UNICODE
  39. #undef UNICODE
  40. #if JucePlugin_Build_VST
  41. #define DllMain DllMainRTAS
  42. #include <DLLMain.cpp>
  43. #undef DllMain
  44. extern BOOL WINAPI DllMainVST (HINSTANCE instance, DWORD dwReason, LPVOID);
  45. // This overloaded DllMain can work as either an RTAS or a VST..
  46. extern "C" BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD ul_reason_for_call, LPVOID lpReserved)
  47. {
  48. if (GetModuleHandleA ("DAE.DLL") != 0)
  49. return DllMainRTAS (hInstance, ul_reason_for_call, lpReserved);
  50. else
  51. return DllMainVST (hInstance, ul_reason_for_call, lpReserved);
  52. }
  53. #else
  54. #include <DLLMain.cpp>
  55. #endif
  56. #include <DefaultSwap.cpp>
  57. #else
  58. //==============================================================================
  59. #include <PlugInInitialize.cpp>
  60. #include <Dispatcher.cpp>
  61. #endif
  62. #else
  63. #if _MSC_VER
  64. short __stdcall NewPlugIn (void*) { return 0; }
  65. short __stdcall _PI_GetRoutineDescriptor (long, void*) { return 0; }
  66. #endif
  67. #endif