OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
juce_Initialisation.h
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
23 namespace juce
24{
25
26//==============================================================================
38JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI();
39
48JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI();
49
50
51//==============================================================================
69 class JUCE_API ScopedJuceInitialiser_GUI final
70{
71 public:
73 ScopedJuceInitialiser_GUI();
74
76 ~ScopedJuceInitialiser_GUI();
77
78 JUCE_DECLARE_NON_COPYABLE (ScopedJuceInitialiser_GUI)
79 JUCE_DECLARE_NON_MOVEABLE (ScopedJuceInitialiser_GUI)
80};
81
82
83//==============================================================================
90#if DOXYGEN
91 #define START_JUCE_APPLICATION(AppClass)
92#else
93 #if JUCE_WINDOWS && ! defined (_CONSOLE)
94 #define JUCE_MAIN_FUNCTION \
95 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (28251) \
96 int __stdcall WinMain (struct HINSTANCE__*, struct HINSTANCE__*, char*, int) \
97 JUCE_END_IGNORE_WARNINGS_MSVC
98 #define JUCE_MAIN_FUNCTION_ARGS
99 #else
100 #define JUCE_MAIN_FUNCTION int main (int argc, char* argv[])
101 #define JUCE_MAIN_FUNCTION_ARGS argc, (const char**) argv
102 #endif
103
104 #if JUCE_IOS
105
106 #define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
107 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
108 juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); } \
109 void* juce_GetIOSCustomDelegateClass() { return nullptr; } \
110 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
111
112 #define JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass) \
113 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
114 juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); } \
115 void* juce_GetIOSCustomDelegateClass() { return [DelegateClass class]; } \
116 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
117
118 #define JUCE_MAIN_FUNCTION_DEFINITION \
119 extern "C" JUCE_MAIN_FUNCTION \
120 { \
121 juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; \
122 juce::JUCEApplicationBase::iOSCustomDelegate = juce_GetIOSCustomDelegateClass(); \
123 return juce::JUCEApplicationBase::main (JUCE_MAIN_FUNCTION_ARGS); \
124 }
125
126 #elif JUCE_ANDROID
127
128 #define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
129 extern "C" juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
130
131 #define JUCE_MAIN_FUNCTION_DEFINITION
132
133 #else
134
135 #define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
136 juce::JUCEApplicationBase* juce_CreateApplication(); \
137 juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
138
139 #define JUCE_MAIN_FUNCTION_DEFINITION \
140 extern "C" JUCE_MAIN_FUNCTION \
141 { \
142 juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; \
143 return juce::JUCEApplicationBase::main (JUCE_MAIN_FUNCTION_ARGS); \
144 }
145
146 #endif
147
148 #if JucePlugin_Build_Standalone
149 #if JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP
150 #define START_JUCE_APPLICATION(AppClass) JUCE_CREATE_APPLICATION_DEFINE(AppClass)
151 #if JUCE_IOS
152 #define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass)
153 #endif
154 #else
155 #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.");
156 #if JUCE_IOS
157 #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.");
158 #endif
159 #endif
160 #else
161
162 #define START_JUCE_APPLICATION(AppClass) \
163 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
164 JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
165 JUCE_MAIN_FUNCTION_DEFINITION \
166 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
167
168 #if JUCE_IOS
209 #define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) \
210 JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass) \
211 JUCE_MAIN_FUNCTION_DEFINITION
212 #endif
213 #endif
214#endif
215
216} // namespace juce
juce::ScopedJuceInitialiser_GUI
Definition juce_Initialisation.h:70