@@ -72,12 +72,27 @@ source/backend/carla_%_plugin.a: .FORCE | |||
source/backend/carla_%.a: .FORCE | |||
$(MAKE) -C source/backend/$* ../carla_$*.a | |||
source/modules/jackbridge-%: .FORCE | |||
$(MAKE) -C source/modules/jackbridge ../jackbridge-$* | |||
source/modules/%.qt4.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.qt4.a | |||
source/modules/%.qt5.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.qt5.a | |||
source/modules/%.posix32.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.posix32.a | |||
source/modules/%.posix64.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.posix64.a | |||
source/modules/%.win32.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.win32.a | |||
source/modules/%.win64.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.win64.a | |||
source/modules/%.a: .FORCE | |||
$(MAKE) -C source/modules/$* ../$*.a | |||
@@ -124,31 +139,99 @@ bin/styles/carlastyle$(LIB_EXT): .FORCE | |||
$(MAKE) -C source/modules/theme | |||
# -------------------------------------------------------------- | |||
# Binaries (variants) | |||
posix32: | |||
# Binaries (posix32) | |||
LIBS_POSIX32 += source/modules/jackbridge.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_audio_basics.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_audio_devices.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_audio_formats.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_audio_processors.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_core.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_data_structures.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_events.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_graphics.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_gui_basics.posix32.a | |||
LIBS_POSIX32 += source/modules/juce_gui_extra.posix32.a | |||
LIBS_POSIX32 += source/modules/lilv.posix32.a | |||
LIBS_POSIX32 += source/modules/rtmempool.posix32.a | |||
posix32: $(LIBS_POSIX32) | |||
$(MAKE) -C source/bridges posix32 | |||
$(MAKE) -C source/discovery posix32 | |||
posix64: | |||
# -------------------------------------------------------------- | |||
# Binaries (posix64) | |||
LIBS_POSIX64 += source/modules/jackbridge.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_audio_basics.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_audio_devices.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_audio_formats.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_audio_processors.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_core.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_data_structures.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_events.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_graphics.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_gui_basics.posix64.a | |||
LIBS_POSIX64 += source/modules/juce_gui_extra.posix64.a | |||
LIBS_POSIX64 += source/modules/lilv.posix64.a | |||
LIBS_POSIX64 += source/modules/rtmempool.posix64.a | |||
posix64: $(LIBS_POSIX64) | |||
$(MAKE) -C source/bridges posix64 | |||
$(MAKE) -C source/discovery posix64 | |||
win32: | |||
# -------------------------------------------------------------- | |||
# Binaries (win32) | |||
LIBS_WIN32 += source/modules/jackbridge-win32.dll | |||
LIBS_WIN32 += source/modules/juce_audio_basics.win32.a | |||
LIBS_WIN32 += source/modules/juce_audio_devices.win32.a | |||
LIBS_WIN32 += source/modules/juce_audio_formats.win32.a | |||
LIBS_WIN32 += source/modules/juce_audio_processors.win32.a | |||
LIBS_WIN32 += source/modules/juce_core.win32.a | |||
LIBS_WIN32 += source/modules/juce_data_structures.win32.a | |||
LIBS_WIN32 += source/modules/juce_events.win32.a | |||
LIBS_WIN32 += source/modules/juce_graphics.win32.a | |||
LIBS_WIN32 += source/modules/juce_gui_basics.win32.a | |||
LIBS_WIN32 += source/modules/juce_gui_extra.win32.a | |||
LIBS_WIN32 += source/modules/lilv.win32.a | |||
LIBS_WIN32 += source/modules/rtmempool.win32.a | |||
win32: $(LIBS_WIN32) | |||
$(MAKE) -C source/bridges win32 | |||
$(MAKE) -C source/discovery win32 | |||
win64: | |||
# -------------------------------------------------------------- | |||
# Binaries (win64) | |||
LIBS_WIN64 += source/modules/jackbridge-win64.dll | |||
LIBS_WIN64 += source/modules/juce_audio_basics.win64.a | |||
LIBS_WIN64 += source/modules/juce_audio_devices.win64.a | |||
LIBS_WIN64 += source/modules/juce_audio_formats.win64.a | |||
LIBS_WIN64 += source/modules/juce_audio_processors.win64.a | |||
LIBS_WIN64 += source/modules/juce_core.win64.a | |||
LIBS_WIN64 += source/modules/juce_data_structures.win64.a | |||
LIBS_WIN64 += source/modules/juce_events.win64.a | |||
LIBS_WIN64 += source/modules/juce_graphics.win64.a | |||
LIBS_WIN64 += source/modules/juce_gui_basics.win64.a | |||
LIBS_WIN64 += source/modules/juce_gui_extra.win64.a | |||
LIBS_WIN64 += source/modules/lilv.win64.a | |||
LIBS_WIN64 += source/modules/rtmempool.win64.a | |||
win64: $(LIBS_WIN64) | |||
$(MAKE) -C source/bridges win64 | |||
$(MAKE) -C source/discovery win64 | |||
# -------------------------------------------------------------- | |||
# Binaries (wine) | |||
wine32: | |||
$(MAKE) -C source/modules jackbridge-wine32 | |||
$(LINK) source/modules/jackbridge-win32.dll.so source/bridges/jackbridge-win32.dll | |||
cp -f source/modules/jackbridge-win32.dll.so bin/jackbridge-win32.dll | |||
wine64: | |||
$(MAKE) -C source/modules jackbridge-wine64 | |||
$(LINK) source/modules/jackbridge-win64.dll.so source/bridges/jackbridge-win64.dll | |||
cp -f source/modules/jackbridge-win64.dll.so bin/jackbridge-win64.dll | |||
# -------------------------------------------------------------- | |||
# Resources | |||
@@ -382,6 +382,7 @@ CARLA_EXPORT const char* const* carla_get_engine_driver_device_names(uint index) | |||
*/ | |||
CARLA_EXPORT const EngineDriverDeviceInfo* carla_get_engine_driver_device_info(uint index, const char* name); | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Get how many internal plugins are available. | |||
*/ | |||
@@ -392,6 +393,7 @@ CARLA_EXPORT uint carla_get_internal_plugin_count(); | |||
* @param index Internal plugin Id | |||
*/ | |||
CARLA_EXPORT const CarlaNativePluginInfo* carla_get_internal_plugin_info(uint index); | |||
#endif | |||
#ifdef __cplusplus | |||
/*! | |||
@@ -30,7 +30,8 @@ | |||
#include "juce_audio_formats.h" | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
#if (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) && ! defined(BUILD_BRIDGE) | |||
# define USE_JUCE_GUI | |||
# include "juce_gui_basics.h" | |||
#endif | |||
@@ -522,6 +523,7 @@ const char* carla_get_supported_file_extensions() | |||
retText += ";*.gig;*.sfz"; | |||
#endif | |||
#ifndef BUILD_BRIDGE | |||
// Audio files | |||
{ | |||
using namespace juce; | |||
@@ -537,6 +539,7 @@ const char* carla_get_supported_file_extensions() | |||
retText += String(";*" + (*eit)).toRawUTF8(); | |||
} | |||
} | |||
#endif | |||
// MIDI files | |||
retText += ";*.mid;*.midi"; | |||
@@ -593,6 +596,7 @@ const EngineDriverDeviceInfo* carla_get_engine_driver_device_info(uint index, co | |||
return nullptr; | |||
} | |||
#ifndef BUILD_BRIDGE | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
uint carla_get_internal_plugin_count() | |||
@@ -646,6 +650,7 @@ const CarlaNativePluginInfo* carla_get_internal_plugin_info(uint index) | |||
return &info; | |||
} | |||
#endif | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -732,7 +737,7 @@ bool carla_engine_init(const char* driverName, const char* clientName) | |||
if (gStandalone.engine->init(clientName)) | |||
{ | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
#ifdef USE_JUCE_GUI | |||
juce::initialiseJuce_GUI(); | |||
#endif | |||
gStandalone.lastError = "No error"; | |||
@@ -802,7 +807,7 @@ bool carla_engine_init_bridge(const char audioBaseName[6+1], const char controlB | |||
if (gStandalone.engine->init(clientName)) | |||
{ | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
#ifdef USE_JUCE_GUI | |||
juce::initialiseJuce_GUI(); | |||
#endif | |||
gStandalone.lastError = "No error"; | |||
@@ -837,7 +842,7 @@ bool carla_engine_close() | |||
if (! closed) | |||
gStandalone.lastError = gStandalone.engine->getLastError(); | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
#ifdef USE_JUCE_GUI | |||
juce::shutdownJuce_GUI(); | |||
#endif | |||
delete gStandalone.engine; | |||
@@ -455,6 +455,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
break; | |||
case PLUGIN_INTERNAL: | |||
#ifndef BUILD_BRIDGE | |||
/*if (std::strcmp(label, "FluidSynth") == 0) | |||
{ | |||
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); | |||
@@ -476,6 +477,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
plugin = CarlaPlugin::newLinuxSampler(initializer, "SFZ", use16Outs); | |||
}*/ | |||
plugin = CarlaPlugin::newNative(initializer); | |||
#endif | |||
break; | |||
case PLUGIN_LADSPA: | |||
@@ -503,17 +505,23 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
break; | |||
case PLUGIN_GIG: | |||
#ifndef BUILD_BRIDGE | |||
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); | |||
plugin = CarlaPlugin::newFileGIG(initializer, use16Outs); | |||
#endif | |||
break; | |||
case PLUGIN_SF2: | |||
#ifndef BUILD_BRIDGE | |||
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); | |||
plugin = CarlaPlugin::newFileSF2(initializer, use16Outs); | |||
#endif | |||
break; | |||
case PLUGIN_SFZ: | |||
#ifndef BUILD_BRIDGE | |||
plugin = CarlaPlugin::newFileSFZ(initializer); | |||
#endif | |||
break; | |||
} | |||
} | |||
@@ -214,7 +214,7 @@ public: | |||
CarlaThread("CarlaEngineBridge"), | |||
fIsRunning(false) | |||
{ | |||
carla_debug("CarlaEngineBridge::CarlaEngineBridge()"); | |||
carla_stdout("CarlaEngineBridge::CarlaEngineBridge(%s, %s, %s)", audioBaseName, controlBaseName, timeBaseName); | |||
fShmAudioPool.filename = "/carla-bridge_shm_"; | |||
fShmAudioPool.filename += audioBaseName; | |||
@@ -295,6 +295,9 @@ public: | |||
opcode = fShmControl.readOpcode(); | |||
CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeNull, opcode); | |||
const uint32_t stackBufferSize = fShmControl.readUInt(); | |||
CARLA_SAFE_ASSERT_INT2(stackBufferSize == sizeof(StackBuffer), stackBufferSize, sizeof(StackBuffer)); | |||
const uint32_t shmStructSize = fShmControl.readUInt(); | |||
CARLA_SAFE_ASSERT_INT2(shmStructSize == sizeof(BridgeShmControl), shmStructSize, sizeof(BridgeShmControl)); | |||
@@ -312,8 +315,9 @@ public: | |||
carla_stdout("Carla Client Info:"); | |||
carla_stdout(" BufferSize: %i", pData->bufferSize); | |||
carla_stdout(" SampleRate: %f", pData->sampleRate); | |||
carla_stdout(" sizeof(BridgeShmControl): %i/" P_SIZE, shmStructSize, sizeof(BridgeShmControl)); | |||
carla_stdout(" sizeof(BridgeTimeInfo): %i/" P_SIZE, timeStructSize, sizeof(BridgeTimeInfo)); | |||
carla_stdout(" sizeof(StackBuffer): %i/" P_SIZE, stackBufferSize, sizeof(StackBuffer)); | |||
carla_stdout(" sizeof(BridgeShmControl): %i/" P_SIZE, shmStructSize, sizeof(BridgeShmControl)); | |||
carla_stdout(" sizeof(BridgeTimeInfo): %i/" P_SIZE, timeStructSize, sizeof(BridgeTimeInfo)); | |||
CarlaThread::startThread(); | |||
CarlaEngine::init(clientName); | |||
@@ -135,7 +135,7 @@ const EngineEvent& CarlaEngineEventPort::getEvent(const uint32_t index) const no | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(kIsInput, kFallbackEngineEvent); | |||
CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, kFallbackEngineEvent); | |||
CARLA_SAFE_ASSERT_RETURN(kProcessMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK || kProcessMode == ENGINE_PROCESS_MODE_PATCHBAY, kFallbackEngineEvent); | |||
CARLA_SAFE_ASSERT_RETURN(kProcessMode != ENGINE_PROCESS_MODE_SINGLE_CLIENT && kProcessMode != ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS, kFallbackEngineEvent); | |||
CARLA_SAFE_ASSERT_RETURN(index < kMaxEngineEventInternalCount, kFallbackEngineEvent); | |||
return fBuffer[index]; | |||
@@ -155,7 +155,7 @@ bool CarlaEngineEventPort::writeControlEvent(const uint32_t time, const uint8_t | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(! kIsInput, false); | |||
CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, false); | |||
CARLA_SAFE_ASSERT_RETURN(kProcessMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK || kProcessMode == ENGINE_PROCESS_MODE_PATCHBAY, false); | |||
CARLA_SAFE_ASSERT_RETURN(kProcessMode != ENGINE_PROCESS_MODE_SINGLE_CLIENT && kProcessMode != ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS, false); | |||
CARLA_SAFE_ASSERT_RETURN(type != kEngineControlEventTypeNull, false); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS, false); | |||
CARLA_SAFE_ASSERT(value >= 0.0f && value <= 1.0f); | |||
@@ -200,7 +200,7 @@ bool CarlaEngineEventPort::writeMidiEvent(const uint32_t time, const uint8_t cha | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(! kIsInput, false); | |||
CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, false); | |||
CARLA_SAFE_ASSERT_RETURN(kProcessMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK || kProcessMode == ENGINE_PROCESS_MODE_PATCHBAY, false); | |||
CARLA_SAFE_ASSERT_RETURN(kProcessMode != ENGINE_PROCESS_MODE_SINGLE_CLIENT && kProcessMode != ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS, false); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS, false); | |||
CARLA_SAFE_ASSERT_RETURN(size > 0 && size <= EngineMidiEvent::kDataSize, false); | |||
CARLA_SAFE_ASSERT_RETURN(data != nullptr, false); | |||
@@ -1908,6 +1908,7 @@ public: | |||
} | |||
carla_stdout("Carla Server Info:"); | |||
carla_stdout(" sizeof(StackBuffer): " P_SIZE, sizeof(StackBuffer)); | |||
carla_stdout(" sizeof(BridgeShmControl): " P_SIZE, sizeof(BridgeShmControl)); | |||
carla_stdout(" sizeof(BridgeTimeInfo): " P_SIZE, sizeof(BridgeTimeInfo)); | |||
@@ -1916,6 +1917,7 @@ public: | |||
// initial values | |||
fShmControl.writeOpcode(kPluginBridgeOpcodeNull); | |||
fShmControl.writeInt(static_cast<int32_t>(sizeof(StackBuffer))); | |||
fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeShmControl))); | |||
fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeTimeInfo))); | |||
@@ -2081,6 +2083,7 @@ CarlaPlugin* CarlaPlugin::newBridge(const Initializer& init, BinaryType btype, P | |||
if (! plugin->init(init.filename, init.name, init.label, bridgeBinary)) | |||
{ | |||
init.engine->registerEnginePlugin(init.id, nullptr); | |||
delete plugin; | |||
return nullptr; | |||
} | |||
@@ -175,10 +175,11 @@ void CarlaPluginThread::run() | |||
break; | |||
case PLUGIN_THREAD_BRIDGE: | |||
//env.insert("ENGINE_BRIDGE_SHM_IDS", fExtra2.buffer()); | |||
//env.insert("ENGINE_BRIDGE_CLIENT_NAME", name); | |||
//env.insert("ENGINE_BRIDGE_OSC_URL", QString("%1/%2").arg(fEngine->getOscServerPathUDP()).arg(fPlugin->getId())); | |||
//env.insert("WINEDEBUG", "-all"); | |||
// FIXME | |||
carla_setenv("ENGINE_BRIDGE_SHM_IDS", fExtra2.buffer()); | |||
carla_setenv("ENGINE_BRIDGE_CLIENT_NAME", name.toRawUTF8()); | |||
carla_setenv("ENGINE_BRIDGE_OSC_URL", String(String(fEngine->getOscServerPathUDP()) + String("/") + String(fPlugin->getId())).toRawUTF8()); | |||
carla_setenv("WINEDEBUG", "-all"); | |||
/* osc-url */ arguments.add(String(fEngine->getOscServerPathUDP()) + String("/") + String(fPlugin->getId())); | |||
/* stype */ arguments.add(fExtra1.buffer()); | |||
@@ -23,10 +23,6 @@ | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
// --------------------------------------------------------------------- | |||
CarlaBridgeClient::CarlaBridgeClient(const char* const uiTitle) | |||
@@ -28,18 +28,19 @@ | |||
# include <signal.h> | |||
#endif | |||
// TODO | |||
#if 0 | |||
#include "juce_core.h" | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
# include "juce_gui_basics.h" | |||
using juce::JUCEApplication; | |||
using juce::JUCEApplicationBase; | |||
using juce::String; | |||
using juce::Timer; | |||
#endif | |||
#include "juce_core.h" | |||
using CarlaBackend::CarlaEngine; | |||
using CarlaBackend::EngineCallbackOpcode; | |||
using CarlaBackend::EngineCallbackOpcode2Str; | |||
using juce::File; | |||
using juce::String; | |||
@@ -101,11 +102,11 @@ static void initSignalHandler() | |||
// ------------------------------------------------------------------------- | |||
#if 0 | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
static CarlaBridge::CarlaBridgeClient* gBridgeClient = nullptr; | |||
class CarlaJuceApp : public JUCEApplication, | |||
Timer | |||
private Timer | |||
{ | |||
public: | |||
CarlaJuceApp() {} | |||
@@ -154,10 +155,6 @@ static JUCEApplicationBase* juce_CreateApplication() { return new CarlaJuceApp() | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
// ------------------------------------------------------------------------- | |||
class CarlaPluginClient : public CarlaBridgeClient | |||
@@ -184,9 +181,6 @@ public: | |||
{ | |||
carla_debug("CarlaPluginClient::~CarlaPluginClient()"); | |||
#if 0 | |||
gBridgeClient = nullptr; | |||
#endif | |||
carla_engine_close(); | |||
} | |||
@@ -198,7 +192,6 @@ public: | |||
void oscInit(const char* const url) | |||
{ | |||
CarlaBridgeClient::oscInit(url); | |||
fEngine->setOscBridgeData(&fOscData); | |||
} | |||
@@ -221,10 +214,11 @@ public: | |||
gIsInitiated = true; | |||
#if 0 | |||
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
gBridgeClient = this; | |||
JUCEApplicationBase::createInstance = &juce_CreateApplication; | |||
JUCEApplicationBase::main(JUCE_MAIN_FUNCTION_ARGS); | |||
gBridgeClient = nullptr; | |||
#else | |||
for (; ! gCloseNow;) | |||
{ | |||
@@ -240,7 +234,6 @@ public: | |||
return; (void)argc; (void)argv; | |||
} | |||
#if 1 | |||
void idle() | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(fEngine != nullptr,); | |||
@@ -259,7 +252,6 @@ public: | |||
} | |||
} | |||
} | |||
#endif | |||
// --------------------------------------------------------------------- | |||
// plugin management | |||
@@ -312,7 +304,7 @@ public: | |||
// --------------------------------------------------------------------- | |||
protected: | |||
void handleCallback(const CarlaBackend::EngineCallbackOpcode action, const int value1, const int value2, const float value3, const char* const valueStr) | |||
void handleCallback(const EngineCallbackOpcode action, const int value1, const int value2, const float value3, const char* const valueStr) | |||
{ | |||
CARLA_BACKEND_USE_NAMESPACE; | |||
@@ -354,9 +346,9 @@ private: | |||
const CarlaEngine* fEngine; | |||
String fProjFilename; | |||
static void callback(void* ptr, CarlaBackend::EngineCallbackOpcode action, unsigned int pluginId, int value1, int value2, float value3, const char* valueStr) | |||
static void callback(void* ptr, EngineCallbackOpcode action, unsigned int pluginId, int value1, int value2, float value3, const char* valueStr) | |||
{ | |||
carla_debug("CarlaPluginClient::callback(%p, %i:%s, %i, %i, %i, %f, \"%s\")", ptr, action, CarlaBackend::EngineCallbackOpcode2Str(action), pluginId, value1, value2, value3, valueStr); | |||
carla_debug("CarlaPluginClient::callback(%p, %i:%s, %i, %i, %i, %f, \"%s\")", ptr, action, EngineCallbackOpcode2Str(action), pluginId, value1, value2, value3, valueStr); | |||
CARLA_SAFE_ASSERT_RETURN(ptr != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId == 0,); | |||
@@ -455,7 +455,6 @@ OBJS_POSIX32 += \ | |||
../backend/plugin/CarlaPluginInternal__posix32.o \ | |||
../backend/plugin/CarlaPluginThread__posix32.o \ | |||
../backend/plugin/CarlaPluginUi__posix32.o \ | |||
../backend/plugin/NativePlugin__posix32.o \ | |||
../backend/plugin/LadspaPlugin__posix32.o \ | |||
../backend/plugin/DssiPlugin__posix32.o \ | |||
../backend/plugin/Lv2Plugin__posix32.o \ | |||
@@ -513,7 +512,6 @@ OBJS_POSIX64 += \ | |||
../backend/plugin/CarlaPluginInternal__posix64.o \ | |||
../backend/plugin/CarlaPluginThread__posix64.o \ | |||
../backend/plugin/CarlaPluginUi__posix64.o \ | |||
../backend/plugin/NativePlugin__posix64.o \ | |||
../backend/plugin/LadspaPlugin__posix64.o \ | |||
../backend/plugin/DssiPlugin__posix64.o \ | |||
../backend/plugin/Lv2Plugin__posix64.o \ | |||
@@ -559,8 +557,12 @@ OBJS_WIN32 = CarlaBridgePlugin__win32.o \ | |||
# carla-engine | |||
OBJS_WIN32 += \ | |||
../backend/engine/CarlaEngine__win32.o \ | |||
../backend/engine/CarlaEngineClient__win32.o \ | |||
../backend/engine/CarlaEngineData__win32.o \ | |||
../backend/engine/CarlaEngineInternal__win32.o \ | |||
../backend/engine/CarlaEngineOsc__win32.o \ | |||
../backend/engine/CarlaEngineOscSend__win32.o \ | |||
../backend/engine/CarlaEnginePorts__win32.o \ | |||
../backend/engine/CarlaEngineThread__win32.o \ | |||
../backend/engine/CarlaEngineBridge__win32.o \ | |||
../backend/engine/CarlaEngineJack__win32.o | |||
@@ -571,16 +573,13 @@ OBJS_WIN32 += \ | |||
../backend/plugin/CarlaPluginInternal__win32.o \ | |||
../backend/plugin/CarlaPluginThread__win32.o \ | |||
../backend/plugin/CarlaPluginUi__win32.o \ | |||
../backend/plugin/NativePlugin__win32.o \ | |||
../backend/plugin/LadspaPlugin__win32.o \ | |||
../backend/plugin/DssiPlugin__win32.o \ | |||
../backend/plugin/Lv2Plugin__win32.o \ | |||
../backend/plugin/VstPlugin__win32.o \ | |||
../backend/plugin/Vst3Plugin__win32.o \ | |||
../backend/plugin/AuPlugin__win32.o \ | |||
../backend/plugin/JucePlugin__win32.o \ | |||
../backend/plugin/FluidSynthPlugin__win32.o \ | |||
../backend/plugin/LinuxSamplerPlugin__win32.o | |||
../backend/plugin/JucePlugin__win32.o | |||
# carla-standalone | |||
OBJS_WIN32 += \ | |||
@@ -615,8 +614,12 @@ OBJS_WIN64 = CarlaBridgePlugin__win64.o \ | |||
# carla-engine | |||
OBJS_WIN64 += \ | |||
../backend/engine/CarlaEngine__win64.o \ | |||
../backend/engine/CarlaEngineClient__win64.o \ | |||
../backend/engine/CarlaEngineData__win64.o \ | |||
../backend/engine/CarlaEngineInternal__win64.o \ | |||
../backend/engine/CarlaEngineOsc__win64.o \ | |||
../backend/engine/CarlaEngineOscSend__win64.o \ | |||
../backend/engine/CarlaEnginePorts__win64.o \ | |||
../backend/engine/CarlaEngineThread__win64.o \ | |||
../backend/engine/CarlaEngineBridge__win64.o \ | |||
../backend/engine/CarlaEngineJack__win64.o | |||
@@ -627,16 +630,13 @@ OBJS_WIN64 += \ | |||
../backend/plugin/CarlaPluginInternal__win64.o \ | |||
../backend/plugin/CarlaPluginThread__win64.o \ | |||
../backend/plugin/CarlaPluginUi__win64.o \ | |||
../backend/plugin/NativePlugin__win64.o \ | |||
../backend/plugin/LadspaPlugin__win64.o \ | |||
../backend/plugin/DssiPlugin__win64.o \ | |||
../backend/plugin/Lv2Plugin__win64.o \ | |||
../backend/plugin/VstPlugin__win64.o \ | |||
../backend/plugin/Vst3Plugin__win64.o \ | |||
../backend/plugin/AuPlugin__win64.o \ | |||
../backend/plugin/JucePlugin__win64.o \ | |||
../backend/plugin/FluidSynthPlugin__win64.o \ | |||
../backend/plugin/LinuxSamplerPlugin__win64.o | |||
../backend/plugin/JucePlugin__win64.o | |||
# carla-standalone | |||
OBJS_WIN64 += \ | |||
@@ -94,7 +94,7 @@ LIBS += ../modules/juce_gui_extra.a | |||
LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS) | |||
endif | |||
POSIX_BUILD_FLAGS = $(BUILD_CXX_FLAGS) | |||
POSIX_BUILD_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE | |||
POSIX_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32 -L/usr/lib/i386-linux-gnu | |||
POSIX_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu | |||
POSIX_LINK_FLAGS = $(LINK_FLAGS) | |||
@@ -103,7 +103,7 @@ ifneq ($(HAIKU),true) | |||
POSIX_LINK_FLAGS += -ldl | |||
endif | |||
WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS) | |||
WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE | |||
WIN_32BIT_FLAGS = $(32BIT_FLAGS) | |||
WIN_64BIT_FLAGS = $(64BIT_FLAGS) | |||
WIN_LINK_FLAGS = $(LINK_FLAGS) $(EXTRA_LIBS) | |||
@@ -25,6 +25,11 @@ | |||
# include "juce_audio_processors.h" | |||
#endif | |||
#ifdef BUILD_BRIDGE | |||
# undef HAVE_FLUIDSYNTH | |||
# undef HAVE_LINUXSAMPLER | |||
#endif | |||
#include "CarlaLadspaUtils.hpp" | |||
#include "CarlaDssiUtils.cpp" | |||
#include "CarlaLv2Utils.hpp" | |||
@@ -31,8 +31,8 @@ | |||
@see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_AU | |||
*/ | |||
#if defined(JUCE_WINDOWS) || defined(JUCE_MAC) | |||
# define JUCE_PLUGINHOST_VST3 1 // FIXME | |||
#if JUCE_WINDOWS || JUCE_MAC | |||
# define JUCE_PLUGINHOST_VST3 1 | |||
#else | |||
# define JUCE_PLUGINHOST_VST3 0 | |||
#endif | |||
@@ -42,8 +42,12 @@ | |||
@see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST | |||
*/ | |||
#define JUCE_PLUGINHOST_AU 1 | |||
#if JUCE_MAC | |||
# define JUCE_PLUGINHOST_AU 1 | |||
#else | |||
# define JUCE_PLUGINHOST_AU 0 | |||
#endif | |||
#define JUCE_PLUGINHOST_LADSPA 1 | |||
#define JUCE_PLUGINHOST_LADSPA 0 | |||
#endif // CARLA_JUCE_AUDIO_PROCESSORS_APPCONFIG_H_INCLUDED |
@@ -29,7 +29,8 @@ | |||
#ifndef JUCE_WIN32_COMSMARTPTR_H_INCLUDED | |||
#define JUCE_WIN32_COMSMARTPTR_H_INCLUDED | |||
#if ! (defined (_MSC_VER) || defined (__uuidof)) | |||
// FIXME | |||
#if 1 //! (defined (_MSC_VER) || defined (__uuidof)) | |||
template<typename Type> struct UUIDGetter { static CLSID get() { jassertfalse; return CLSID(); } }; | |||
#define __uuidof(x) UUIDGetter<x>::get() | |||
#endif | |||
@@ -90,11 +90,11 @@ struct BridgeTimeInfo { | |||
struct BridgeShmControl { | |||
union { | |||
void* runServer; | |||
char _padServer[32]; | |||
char _padServer[64]; | |||
}; | |||
union { | |||
void* runClient; | |||
char _padClient[32]; | |||
char _padClient[64]; | |||
}; | |||
StackBuffer buffer; | |||
}; | |||
@@ -44,10 +44,10 @@ | |||
*/ | |||
struct HeapBuffer { | |||
uint32_t size; | |||
std::size_t head, tail, wrtn; | |||
bool invalidateCommit; | |||
uint8_t* buf; | |||
uint32_t size; | |||
uint32_t head, tail, wrtn; | |||
bool invalidateCommit; | |||
uint8_t* buf; | |||
void copyDataFrom(const HeapBuffer& rb) noexcept | |||
{ | |||
@@ -63,9 +63,9 @@ struct HeapBuffer { | |||
struct StackBuffer { | |||
static const uint32_t size = 4096; | |||
std::size_t head, tail, wrtn; | |||
bool invalidateCommit; | |||
uint8_t buf[size]; | |||
uint32_t head, tail, wrtn; | |||
bool invalidateCommit; | |||
uint8_t buf[size]; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
@@ -192,7 +192,7 @@ public: | |||
return tryRead(&d, sizeof(double)) ? d : 0.0; | |||
} | |||
void readCustomData(void* const data, const std::size_t size) noexcept | |||
void readCustomData(void* const data, const uint32_t size) noexcept | |||
{ | |||
if (! tryRead(data, size)) | |||
carla_zeroBytes(data, size); | |||
@@ -242,7 +242,7 @@ public: | |||
tryWrite(&value, sizeof(double)); | |||
} | |||
void writeCustomData(const void* const value, const std::size_t size) noexcept | |||
void writeCustomData(const void* const value, const uint32_t size) noexcept | |||
{ | |||
tryWrite(value, size); | |||
} | |||
@@ -268,7 +268,7 @@ protected: | |||
// ------------------------------------------------------------------- | |||
bool tryRead(void* const buf, const std::size_t size) noexcept | |||
bool tryRead(void* const buf, const uint32_t size) noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, false); | |||
CARLA_SAFE_ASSERT_RETURN(buf != nullptr, false); | |||
@@ -281,9 +281,9 @@ protected: | |||
uint8_t* const bytebuf(static_cast<uint8_t*>(buf)); | |||
const std::size_t head(fBuffer->head); | |||
const std::size_t tail(fBuffer->tail); | |||
const std::size_t wrap((head > tail) ? 0 : fBuffer->size); | |||
const uint32_t head(fBuffer->head); | |||
const uint32_t tail(fBuffer->tail); | |||
const uint32_t wrap((head > tail) ? 0 : fBuffer->size); | |||
if (size > wrap + head - tail) | |||
{ | |||
@@ -291,12 +291,12 @@ protected: | |||
return false; | |||
} | |||
std::size_t readto(tail + size); | |||
uint32_t readto(tail + size); | |||
if (readto > fBuffer->size) | |||
{ | |||
readto -= fBuffer->size; | |||
const std::size_t firstpart(fBuffer->size - tail); | |||
const uint32_t firstpart(fBuffer->size - tail); | |||
std::memcpy(bytebuf, fBuffer->buf + tail, firstpart); | |||
std::memcpy(bytebuf + firstpart, fBuffer->buf, readto); | |||
} | |||
@@ -312,7 +312,7 @@ protected: | |||
return true; | |||
} | |||
void tryWrite(const void* const buf, const std::size_t size) noexcept | |||
void tryWrite(const void* const buf, const uint32_t size) noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(buf != nullptr,); | |||
@@ -321,9 +321,9 @@ protected: | |||
const uint8_t* const bytebuf(static_cast<const uint8_t*>(buf)); | |||
const std::size_t tail(fBuffer->tail); | |||
const std::size_t wrtn(fBuffer->wrtn); | |||
const std::size_t wrap((tail > wrtn) ? 0 : fBuffer->size); | |||
const uint32_t tail(fBuffer->tail); | |||
const uint32_t wrtn(fBuffer->wrtn); | |||
const uint32_t wrap((tail > wrtn) ? 0 : fBuffer->size); | |||
if (size >= wrap + tail - wrtn) | |||
{ | |||
@@ -332,12 +332,12 @@ protected: | |||
return; | |||
} | |||
std::size_t writeto(wrtn + size); | |||
uint32_t writeto(wrtn + size); | |||
if (writeto > fBuffer->size) | |||
{ | |||
writeto -= fBuffer->size; | |||
const std::size_t firstpart(fBuffer->size - wrtn); | |||
const uint32_t firstpart(fBuffer->size - wrtn); | |||
std::memcpy(fBuffer->buf + wrtn, bytebuf, firstpart); | |||
std::memcpy(fBuffer->buf, bytebuf + firstpart, writeto); | |||
} | |||
@@ -112,8 +112,6 @@ public: | |||
// NOTE: must have been locked before | |||
bool get(const LV2_Atom*& atom, uint32_t& portIndex) noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(atom != nullptr, false); | |||
if (const LV2_Atom* const retAtom = readAtom(portIndex)) | |||
{ | |||
atom = retAtom; | |||