LMMS
Loading...
Searching...
No Matches
juce_Initialisation.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
39
49
50
51//==============================================================================
78
79
80//==============================================================================
87#if DOXYGEN
88 #define START_JUCE_APPLICATION(AppClass)
89#else
90 #if JUCE_WINDOWS && ! defined (_CONSOLE)
91 #define JUCE_MAIN_FUNCTION \
92 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (28251) \
93 int __stdcall WinMain (struct HINSTANCE__*, struct HINSTANCE__*, char*, int) \
94 JUCE_END_IGNORE_WARNINGS_MSVC
95 #define JUCE_MAIN_FUNCTION_ARGS
96 #else
97 #define JUCE_MAIN_FUNCTION int main (int argc, char* argv[])
98 #define JUCE_MAIN_FUNCTION_ARGS argc, (const char**) argv
99 #endif
100
101 #if JUCE_IOS
102
103 #define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
104 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
105 juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); } \
106 void* juce_GetIOSCustomDelegateClass() { return nullptr; } \
107 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
108
109 #define JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass) \
110 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
111 juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); } \
112 void* juce_GetIOSCustomDelegateClass() { return [DelegateClass class]; } \
113 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
114
115 #define JUCE_MAIN_FUNCTION_DEFINITION \
116 extern "C" JUCE_MAIN_FUNCTION \
117 { \
118 juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; \
119 juce::JUCEApplicationBase::iOSCustomDelegate = juce_GetIOSCustomDelegateClass(); \
120 return juce::JUCEApplicationBase::main (JUCE_MAIN_FUNCTION_ARGS); \
121 }
122
123 #elif JUCE_ANDROID
124
125 #define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
126 extern "C" juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
127
128 #define JUCE_MAIN_FUNCTION_DEFINITION
129
130 #else
131
132 #define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
133 juce::JUCEApplicationBase* juce_CreateApplication(); \
134 juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
135
136 #define JUCE_MAIN_FUNCTION_DEFINITION \
137 extern "C" JUCE_MAIN_FUNCTION \
138 { \
139 juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; \
140 return juce::JUCEApplicationBase::main (JUCE_MAIN_FUNCTION_ARGS); \
141 }
142
143 #endif
144
145 #if JucePlugin_Build_Standalone
146 #if JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP
147 #define START_JUCE_APPLICATION(AppClass) JUCE_CREATE_APPLICATION_DEFINE(AppClass)
148 #if JUCE_IOS
149 #define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass)
150 #endif
151 #else
152 #define START_JUCE_APPLICATION(AppClass) static_assert(false, "You are trying to use START_JUCE_APPLICATION in an audio plug-in. Define JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 if you want to use a custom standalone target app.");
153 #if JUCE_IOS
154 #define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) static_assert(false, "You are trying to use START_JUCE_APPLICATION in an audio plug-in. Define JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 if you want to use a custom standalone target app.");
155 #endif
156 #endif
157 #else
158
159 #define START_JUCE_APPLICATION(AppClass) \
160 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
161 JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
162 JUCE_MAIN_FUNCTION_DEFINITION \
163 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
164
165 #if JUCE_IOS
206 #define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) \
207 JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass) \
208 JUCE_MAIN_FUNCTION_DEFINITION
209 #endif
210 #endif
211#endif
212
213} // namespace juce
#define final
Definition DistrhoDefines.h:74
ScopedJuceInitialiser_GUI()
Definition juce_MessageManager.cpp:482
#define JUCE_CALLTYPE
#define JUCE_API
Definition juce_StandardHeader.h:152
void initialiseJuce_GUI()
Definition carla_juce.cpp:37
void shutdownJuce_GUI()
Definition carla_juce.cpp:52
Definition carla_juce.cpp:31