3 * Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef CARLA_JUCE_HPP_INCLUDED
19 #define CARLA_JUCE_HPP_INCLUDED
21 #include "AppConfig.h"
22 #include "CarlaDefines.h"
25 # if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
26 # define USE_STANDALONE_JUCE_APPLICATION
28 # define USE_REFCOUNTER_JUCE_MESSAGE_MANAGER
32 #ifdef USE_STANDALONE_JUCE_APPLICATION
33 # include <functional>
42 void initialiseJuce_GUI();
44 void shutdownJuce_GUI();
45 const char* getVersion();
47 struct ScopedJuceInitialiser_GUI
{
48 ScopedJuceInitialiser_GUI();
49 ~ScopedJuceInitialiser_GUI();
52 #ifdef USE_REFCOUNTER_JUCE_MESSAGE_MANAGER
53 struct ReferenceCountedJuceMessageMessager
{
54 ReferenceCountedJuceMessageMessager();
55 ~ReferenceCountedJuceMessageMessager();
60 void setMessageManagerForThisThread();
61 void dispatchMessageManagerMessages();
64 #ifdef USE_STANDALONE_JUCE_APPLICATION
65 void setupAndUseMainApplication(std::function
<void()> idleFn
, volatile bool* closedSignalPtr
);
68 } // namespace CarlaJUCE
70 #endif // CARLA_JUCE_HPP_INCLUDED