upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)
This commit is contained in:
@ -23,7 +23,7 @@
|
||||
namespace juce
|
||||
{
|
||||
|
||||
JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = 0;
|
||||
JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = nullptr;
|
||||
JUCEApplicationBase* JUCEApplicationBase::appInstance = nullptr;
|
||||
|
||||
#if JUCE_IOS
|
||||
|
@ -107,9 +107,11 @@ public:
|
||||
If your application class returns true for this, more than one instance is
|
||||
permitted to run (except on the Mac where this isn't possible).
|
||||
|
||||
If it's false, the second instance won't start, but it you will still get a
|
||||
If it's false, the second instance won't start, but you will still get a
|
||||
callback to anotherInstanceStarted() to tell you about this - which
|
||||
gives you a chance to react to what the user was trying to do.
|
||||
|
||||
@see anotherInstanceStarted
|
||||
*/
|
||||
virtual bool moreThanOneInstanceAllowed() = 0;
|
||||
|
||||
@ -151,6 +153,9 @@ public:
|
||||
/** Indicates that the user has tried to start up another instance of the app.
|
||||
|
||||
This will get called even if moreThanOneInstanceAllowed() is false.
|
||||
It is currently only implemented on Windows and Mac.
|
||||
|
||||
@see moreThanOneInstanceAllowed
|
||||
*/
|
||||
virtual void anotherInstanceStarted (const String& commandLine) = 0;
|
||||
|
||||
@ -270,7 +275,7 @@ public:
|
||||
static int main (int argc, const char* argv[]);
|
||||
|
||||
static void appWillTerminateByForce();
|
||||
typedef JUCEApplicationBase* (*CreateInstanceFunction)();
|
||||
using CreateInstanceFunction = JUCEApplicationBase* (*)();
|
||||
static CreateInstanceFunction createInstance;
|
||||
|
||||
#if JUCE_IOS
|
||||
@ -290,8 +295,6 @@ private:
|
||||
bool stillInitialising = true;
|
||||
|
||||
struct MultipleInstanceHandler;
|
||||
friend struct MultipleInstanceHandler;
|
||||
friend struct ContainerDeletePolicy<MultipleInstanceHandler>;
|
||||
std::unique_ptr<MultipleInstanceHandler> multipleInstanceHandler;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (JUCEApplicationBase)
|
||||
|
@ -49,10 +49,10 @@ class JUCE_API CallbackMessage : public MessageManager::MessageBase
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
CallbackMessage() noexcept {}
|
||||
CallbackMessage() = default;
|
||||
|
||||
/** Destructor. */
|
||||
~CallbackMessage() {}
|
||||
~CallbackMessage() override = default;
|
||||
|
||||
//==============================================================================
|
||||
/** Called when the message is delivered.
|
||||
@ -63,7 +63,7 @@ public:
|
||||
Note that like all other messages, this object will be deleted immediately
|
||||
after this method has been invoked.
|
||||
*/
|
||||
virtual void messageCallback() = 0;
|
||||
virtual void messageCallback() override = 0;
|
||||
|
||||
private:
|
||||
// Avoid the leak-detector because for plugins, the host can unload our DLL with undelivered
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
#elif JUCE_ANDROID
|
||||
|
||||
#define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
|
||||
juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
|
||||
extern "C" juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
|
||||
|
||||
#define JUCE_MAIN_FUNCTION_DEFINITION
|
||||
|
||||
@ -155,7 +155,7 @@ public:
|
||||
|
||||
#if JUCE_IOS
|
||||
/**
|
||||
You can instruct JUCE to use a custom iOS app delegate class instaed of JUCE's default
|
||||
You can instruct JUCE to use a custom iOS app delegate class instead of JUCE's default
|
||||
app delegate. For JUCE to work you must pass all messages to JUCE's internal app delegate.
|
||||
Below is an example of minimal forwarding custom delegate. Note that you are at your own
|
||||
risk if you decide to use your own delegate and subtle, hard to debug bugs may occur.
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
//==============================================================================
|
||||
/** Creates an uninitialised message. */
|
||||
Message() noexcept;
|
||||
~Message();
|
||||
~Message() override;
|
||||
|
||||
using Ptr = ReferenceCountedObjectPtr<Message>;
|
||||
|
||||
|
@ -35,7 +35,7 @@ void Message::messageCallback()
|
||||
MessageListener::MessageListener() noexcept
|
||||
{
|
||||
// Are you trying to create a messagelistener before or after juce has been intialised??
|
||||
jassert (MessageManager::getInstanceWithoutCreating() != nullptr);
|
||||
JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
|
||||
}
|
||||
|
||||
MessageListener::~MessageListener()
|
||||
|
@ -231,6 +231,22 @@ bool MessageManager::currentThreadHasLockedMessageManager() const noexcept
|
||||
return thisThread == messageThreadId || thisThread == threadWithLock.get();
|
||||
}
|
||||
|
||||
bool MessageManager::existsAndIsLockedByCurrentThread() noexcept
|
||||
{
|
||||
if (auto i = getInstanceWithoutCreating())
|
||||
return i->currentThreadHasLockedMessageManager();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MessageManager::existsAndIsCurrentThread() noexcept
|
||||
{
|
||||
if (auto i = getInstanceWithoutCreating())
|
||||
return i->isThisTheMessageThread();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
//==============================================================================
|
||||
/* The only safe way to lock the message thread while another thread does
|
||||
@ -294,7 +310,7 @@ bool MessageManager::Lock::tryAcquire (bool lockIsMandatory) const noexcept
|
||||
|
||||
try
|
||||
{
|
||||
blockingMessage = new BlockingMessage (this);
|
||||
blockingMessage = *new BlockingMessage (this);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@ -349,7 +365,7 @@ void MessageManager::Lock::exit() const noexcept
|
||||
lockGained.set (0);
|
||||
|
||||
if (mm != nullptr)
|
||||
mm->threadWithLock = 0;
|
||||
mm->threadWithLock = {};
|
||||
|
||||
if (blockingMessage != nullptr)
|
||||
{
|
||||
@ -417,7 +433,7 @@ bool MessageManagerLock::attemptLock (Thread* threadToCheck, ThreadPoolJob* jobT
|
||||
return true;
|
||||
}
|
||||
|
||||
MessageManagerLock::~MessageManagerLock() noexcept { mmLock.exit(); }
|
||||
MessageManagerLock::~MessageManagerLock() { mmLock.exit(); }
|
||||
|
||||
void MessageManagerLock::exitSignalSent()
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ class OpenGLContext;
|
||||
|
||||
//==============================================================================
|
||||
/** See MessageManager::callFunctionOnMessageThread() for use of this function type. */
|
||||
typedef void* (MessageCallbackFunction) (void* userData);
|
||||
using MessageCallbackFunction = void* (void* userData);
|
||||
|
||||
|
||||
//==============================================================================
|
||||
@ -147,6 +147,16 @@ public:
|
||||
*/
|
||||
bool currentThreadHasLockedMessageManager() const noexcept;
|
||||
|
||||
/** Returns true if there's an instance of the MessageManager, and if the current thread
|
||||
has the lock on it.
|
||||
*/
|
||||
static bool existsAndIsLockedByCurrentThread() noexcept;
|
||||
|
||||
/** Returns true if there's an instance of the MessageManager, and if the current thread
|
||||
is running it.
|
||||
*/
|
||||
static bool existsAndIsCurrentThread() noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Sends a message to all other JUCE applications that are running.
|
||||
|
||||
@ -176,8 +186,8 @@ public:
|
||||
class JUCE_API MessageBase : public ReferenceCountedObject
|
||||
{
|
||||
public:
|
||||
MessageBase() noexcept {}
|
||||
virtual ~MessageBase() {}
|
||||
MessageBase() = default;
|
||||
~MessageBase() override = default;
|
||||
|
||||
virtual void messageCallback() = 0;
|
||||
bool post();
|
||||
@ -280,13 +290,13 @@ public:
|
||||
|
||||
//==============================================================================
|
||||
/** Provides the type of scoped lock to use with a CriticalSection. */
|
||||
typedef GenericScopedLock<Lock> ScopedLockType;
|
||||
using ScopedLockType = GenericScopedLock<Lock>;
|
||||
|
||||
/** Provides the type of scoped unlocker to use with a CriticalSection. */
|
||||
typedef GenericScopedUnlock<Lock> ScopedUnlockType;
|
||||
using ScopedUnlockType = GenericScopedUnlock<Lock>;
|
||||
|
||||
/** Provides the type of scoped try-locker to use with a CriticalSection. */
|
||||
typedef GenericScopedTryLock<Lock> ScopedTryLockType;
|
||||
using ScopedTryLockType = GenericScopedTryLock<Lock>;
|
||||
|
||||
private:
|
||||
struct BlockingMessage;
|
||||
@ -442,7 +452,7 @@ public:
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen!
|
||||
*/
|
||||
~MessageManagerLock() noexcept;
|
||||
~MessageManagerLock() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns true if the lock was successfully acquired.
|
||||
@ -462,4 +472,28 @@ private:
|
||||
JUCE_DECLARE_NON_COPYABLE (MessageManagerLock)
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** This macro is used to catch unsafe use of functions which expect to only be called
|
||||
on the message thread, or when a MessageManagerLock is in place.
|
||||
It will also fail if you try to use the function before the message manager has been
|
||||
created, which could happen if you accidentally invoke it during a static constructor.
|
||||
*/
|
||||
#define JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED \
|
||||
jassert (juce::MessageManager::existsAndIsLockedByCurrentThread());
|
||||
|
||||
/** This macro is used to catch unsafe use of functions which expect to only be called
|
||||
on the message thread.
|
||||
It will also fail if you try to use the function before the message manager has been
|
||||
created, which could happen if you accidentally invoke it during a static constructor.
|
||||
*/
|
||||
#define JUCE_ASSERT_MESSAGE_THREAD \
|
||||
jassert (juce::MessageManager::existsAndIsCurrentThread());
|
||||
|
||||
/** This macro is used to catch unsafe use of functions which expect to not be called
|
||||
outside the lifetime of the MessageManager.
|
||||
*/
|
||||
#define JUCE_ASSERT_MESSAGE_MANAGER_EXISTS \
|
||||
jassert (juce::MessageManager::getInstanceWithoutCreating() != nullptr);
|
||||
|
||||
|
||||
} // namespace juce
|
||||
|
@ -48,7 +48,6 @@ public:
|
||||
|
||||
private:
|
||||
JUCE_PUBLIC_IN_DLL_BUILD (struct Pimpl)
|
||||
friend struct ContainerDeletePolicy<Pimpl>;
|
||||
std::unique_ptr<Pimpl> pimpl;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MountedVolumeListChangeDetector)
|
||||
|
Reference in New Issue
Block a user