Browse Source

Run juce messages on linux host thread; Update juce icon; Cleanup

tags/1.9.8
falkTX 8 years ago
parent
commit
4dedc0c657
11 changed files with 65 additions and 14 deletions
  1. BIN
      resources/48x48/juce.png
  2. +1
    -1
      resources/ui/carla_about_juce.ui
  3. +9
    -0
      source/backend/CarlaStandalone.cpp
  4. +39
    -3
      source/backend/engine/CarlaEngineNative.cpp
  5. +3
    -0
      source/backend/plugin/CarlaPluginNative.cpp
  6. +7
    -7
      source/bridges-plugin/Makefile
  7. +2
    -1
      source/includes/CarlaNative.h
  8. +1
    -1
      source/modules/juce_events/messages/juce_MessageManager.h
  9. +1
    -0
      source/plugin/carla-lv2.cpp
  10. +1
    -0
      source/plugin/carla-vst.cpp
  11. +1
    -1
      source/utils/CarlaJuceAudioProcessors.cpp

BIN
resources/48x48/juce.png View File

Before After
Width: 48  |  Height: 48  |  Size: 3.2KB Width: 48  |  Height: 48  |  Size: 3.2KB

+ 1
- 1
resources/ui/carla_about_juce.ui View File

@@ -111,7 +111,7 @@ It contains pretty much everything you're likely to need to create most applicat
JUCE is licensed under the GNU Public Licence version 2.0. JUCE is licensed under the GNU Public Licence version 2.0.
One module (juce_core) is permissively licensed under the ISC. One module (juce_core) is permissively licensed under the ISC.


Copyright (C) 2015 - ROLI Ltd.</string>
Copyright (C) 2017 ROLI Ltd.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>


+ 9
- 0
source/backend/CarlaStandalone.cpp View File

@@ -429,6 +429,15 @@ void carla_engine_idle()
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,);


gStandalone.engine->idle(); gStandalone.engine->idle();

#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
using juce::MessageManager;

const MessageManager* const msgMgr(MessageManager::getInstanceWithoutCreating());
CARLA_SAFE_ASSERT_RETURN(msgMgr != nullptr,);

for (; msgMgr->dispatchNextMessageOnSystemQueue(true);) {}
#endif
} }


bool carla_is_engine_running() bool carla_is_engine_running()


+ 39
- 3
source/backend/engine/CarlaEngineNative.cpp View File

@@ -45,7 +45,6 @@
using juce::File; using juce::File;
using juce::FloatVectorOperations; using juce::FloatVectorOperations;
using juce::MemoryOutputStream; using juce::MemoryOutputStream;
using juce::ScopedJuceInitialiser_GUI;
using juce::ScopedPointer; using juce::ScopedPointer;
using juce::String; using juce::String;
using juce::XmlDocument; using juce::XmlDocument;
@@ -53,6 +52,27 @@ using juce::XmlElement;


CARLA_BACKEND_START_NAMESPACE CARLA_BACKEND_START_NAMESPACE


static int numScopedInitInstances = 0;

class OptionalScopedJuceInitialiser_GUI
{
public:
OptionalScopedJuceInitialiser_GUI(bool performInit)
: fPerformInit(performInit)
{
if (fPerformInit && numScopedInitInstances++ == 0)
juce::initialiseJuce_GUI();
}
~OptionalScopedJuceInitialiser_GUI()
{
if (fPerformInit && --numScopedInitInstances == 0)
juce::shutdownJuce_GUI();
}

private:
bool fPerformInit;
};

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


class CarlaEngineNativeUI : public CarlaExternalUI class CarlaEngineNativeUI : public CarlaExternalUI
@@ -594,8 +614,11 @@ public:
fIsActive(false), fIsActive(false),
fIsRunning(false), fIsRunning(false),
fUiServer(this), fUiServer(this),
fNeedsJuceMsgIdle(host->dispatcher(pHost->handle,
NATIVE_HOST_OPCODE_INTERNAL_PLUGIN, 0, 0, nullptr, 0.0f) == 0),
fOptionsForced(false), fOptionsForced(false),
fWaitForReadyMsg(false)
fWaitForReadyMsg(false),
kJuceGuiInit(fNeedsJuceMsgIdle)
{ {
carla_debug("CarlaEngineNative::CarlaEngineNative()"); carla_debug("CarlaEngineNative::CarlaEngineNative()");


@@ -1640,6 +1663,18 @@ protected:
fUiServer.stopPipeServer(1000); fUiServer.stopPipeServer(1000);
break; break;
} }

#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
if (fNeedsJuceMsgIdle)
{
using juce::MessageManager;

const MessageManager* const msgMgr(MessageManager::getInstanceWithoutCreating());
CARLA_SAFE_ASSERT_RETURN(msgMgr != nullptr,);

for (; msgMgr->dispatchNextMessageOnSystemQueue(true);) {}
}
#endif
} }


// ------------------------------------------------------------------- // -------------------------------------------------------------------
@@ -1830,11 +1865,12 @@ private:
bool fIsActive, fIsRunning; bool fIsActive, fIsRunning;
CarlaEngineNativeUI fUiServer; CarlaEngineNativeUI fUiServer;


bool fNeedsJuceMsgIdle;
bool fOptionsForced; bool fOptionsForced;
bool fWaitForReadyMsg; bool fWaitForReadyMsg;
char fTmpBuf[STR_MAX+1]; char fTmpBuf[STR_MAX+1];


const ScopedJuceInitialiser_GUI juceGuiInit;
const OptionalScopedJuceInitialiser_GUI kJuceGuiInit;


CarlaPlugin* _getFirstPlugin() const noexcept CarlaPlugin* _getFirstPlugin() const noexcept
{ {


+ 3
- 0
source/backend/plugin/CarlaPluginNative.cpp View File

@@ -2267,6 +2267,9 @@ protected:
case NATIVE_HOST_OPCODE_HOST_IDLE: case NATIVE_HOST_OPCODE_HOST_IDLE:
pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr); pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);
break; break;
case NATIVE_HOST_OPCODE_INTERNAL_PLUGIN:
ret = 1;
break;
} }


return ret; return ret;


+ 7
- 7
source/bridges-plugin/Makefile View File

@@ -61,6 +61,13 @@ LIBS_win32 += $(MODULEDIR)/juce_core.win32.a
LIBS_win64 += $(MODULEDIR)/juce_core.win64.a LIBS_win64 += $(MODULEDIR)/juce_core.win64.a
LINK_FLAGS += $(JUCE_CORE_LIBS) LINK_FLAGS += $(JUCE_CORE_LIBS)


LIBS_native += $(MODULEDIR)/juce_events.a
LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
LINK_FLAGS += $(JUCE_EVENTS_LIBS)

LIBS_native += $(MODULEDIR)/lilv.a LIBS_native += $(MODULEDIR)/lilv.a
LIBS_posix32 += $(MODULEDIR)/lilv.posix32.a LIBS_posix32 += $(MODULEDIR)/lilv.posix32.a
LIBS_posix64 += $(MODULEDIR)/lilv.posix64.a LIBS_posix64 += $(MODULEDIR)/lilv.posix64.a
@@ -90,13 +97,6 @@ LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)


LIBS_native += $(MODULEDIR)/juce_events.a
LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
LINK_FLAGS += $(JUCE_EVENTS_LIBS)

LIBS_native += $(MODULEDIR)/juce_graphics.a LIBS_native += $(MODULEDIR)/juce_graphics.a
LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a
LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a


+ 2
- 1
source/includes/CarlaNative.h View File

@@ -104,7 +104,8 @@ typedef enum {
NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS = 4, /** nothing */ NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS = 4, /** nothing */
NATIVE_HOST_OPCODE_RELOAD_ALL = 5, /** nothing */ NATIVE_HOST_OPCODE_RELOAD_ALL = 5, /** nothing */
NATIVE_HOST_OPCODE_UI_UNAVAILABLE = 6, /** nothing */ NATIVE_HOST_OPCODE_UI_UNAVAILABLE = 6, /** nothing */
NATIVE_HOST_OPCODE_HOST_IDLE = 7 /** nothing */
NATIVE_HOST_OPCODE_HOST_IDLE = 7, /** nothing */
NATIVE_HOST_OPCODE_INTERNAL_PLUGIN = 8 /** nothing */
} NativeHostDispatcherOpcode; } NativeHostDispatcherOpcode;


/* ------------------------------------------------------------------------------------------------------------ /* ------------------------------------------------------------------------------------------------------------


+ 1
- 1
source/modules/juce_events/messages/juce_MessageManager.h View File

@@ -189,6 +189,7 @@ public:
// Internal methods - do not use! // Internal methods - do not use!
void deliverBroadcastMessage (const String&); void deliverBroadcastMessage (const String&);
~MessageManager() noexcept; ~MessageManager() noexcept;
static bool dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages);
#endif #endif
private: private:
@@ -212,7 +213,6 @@ private:
static void* exitModalLoopCallback (void*); static void* exitModalLoopCallback (void*);
static void doPlatformSpecificInitialisation(); static void doPlatformSpecificInitialisation();
static void doPlatformSpecificShutdown(); static void doPlatformSpecificShutdown();
static bool dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages);
template <typename FunctionType> template <typename FunctionType>
struct AsyncCallInvoker : public MessageBase struct AsyncCallInvoker : public MessageBase


+ 1
- 0
source/plugin/carla-lv2.cpp View File

@@ -1087,6 +1087,7 @@ protected:
case NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS: case NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS:
case NATIVE_HOST_OPCODE_RELOAD_ALL: case NATIVE_HOST_OPCODE_RELOAD_ALL:
case NATIVE_HOST_OPCODE_HOST_IDLE: case NATIVE_HOST_OPCODE_HOST_IDLE:
case NATIVE_HOST_OPCODE_INTERNAL_PLUGIN:
// nothing // nothing
break; break;
case NATIVE_HOST_OPCODE_UI_UNAVAILABLE: case NATIVE_HOST_OPCODE_UI_UNAVAILABLE:


+ 1
- 0
source/plugin/carla-vst.cpp View File

@@ -570,6 +570,7 @@ protected:
case NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS: case NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS:
case NATIVE_HOST_OPCODE_RELOAD_ALL: case NATIVE_HOST_OPCODE_RELOAD_ALL:
case NATIVE_HOST_OPCODE_UI_UNAVAILABLE: case NATIVE_HOST_OPCODE_UI_UNAVAILABLE:
case NATIVE_HOST_OPCODE_INTERNAL_PLUGIN:
break; break;


case NATIVE_HOST_OPCODE_HOST_IDLE: case NATIVE_HOST_OPCODE_HOST_IDLE:


+ 1
- 1
source/utils/CarlaJuceAudioProcessors.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the doc/GPL.txt file. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
*/ */


#include "CarlaJuceUtils.hpp"
#include "CarlaDefines.h"


// ------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------




Loading…
Cancel
Save