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.

90 lines
3.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-9 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. #include "juce_RTAS_DigiCode_Header.h"
  19. /*
  20. This file is used to include and build the required digidesign CPP files without your project
  21. needing to reference the files directly. Because these files will be found via your include path,
  22. this means that the project doesn't have to change to cope with people's SDKs being in different
  23. locations.
  24. Important note on Windows: In your project settings for the three juce_RTAS_DigiCode.cpp files and
  25. the juce_RTAS_Wrapper.cpp file, you need to set the calling convention to "__stdcall".
  26. If you don't do this, you'll get some unresolved externals and will spend a long time wondering what's
  27. going on... All the other files in your project can be set to use the normal __cdecl convention.
  28. If you get an error building the includes statements below, check your paths - there's a full
  29. list of the necessary Digidesign paths in juce_RTAS_Wrapper.cpp
  30. */
  31. #if JucePlugin_Build_RTAS
  32. #if WINDOWS_VERSION
  33. //==============================================================================
  34. #undef _UNICODE
  35. #undef UNICODE
  36. #if JucePlugin_Build_VST
  37. #define DllMain DllMainRTAS
  38. #include "DLLMain.cpp"
  39. #undef DllMain
  40. extern BOOL WINAPI DllMainVST (HINSTANCE instance, DWORD dwReason, LPVOID);
  41. // This overloaded DllMain can work as either an RTAS or a VST..
  42. extern "C" BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD ul_reason_for_call, LPVOID lpReserved)
  43. {
  44. if (GetModuleHandle ("DAE.DLL") != 0)
  45. return DllMainRTAS (hInstance, ul_reason_for_call, lpReserved);
  46. else
  47. return DllMainVST (hInstance, ul_reason_for_call, lpReserved);
  48. }
  49. #else
  50. #include "DLLMain.cpp"
  51. #endif
  52. #include "DefaultSwap.cpp"
  53. #else
  54. //==============================================================================
  55. #include "PlugInInitialize.cpp"
  56. #include "Dispatcher.cpp"
  57. #endif
  58. #else
  59. #if _MSC_VER
  60. // (defining these stubs just makes it easier to quickly turn off the RTAS build without removing
  61. // the exports table from your project settings)
  62. short __stdcall NewPlugIn (void*) { return 0; }
  63. short __stdcall _PI_GetRoutineDescriptor (long, void*) { return 0; }
  64. #endif
  65. #endif