Browse Source

More API changes; Try build without juce

tags/1.9.4
falkTX 11 years ago
parent
commit
f1d717f869
5 changed files with 237 additions and 201 deletions
  1. +35
    -35
      source/Makefile.mk
  2. +84
    -64
      source/backend/CarlaBackend.hpp
  3. +3
    -2
      source/backend/CarlaHost.hpp
  4. +18
    -31
      source/backend/standalone/CarlaStandalone.cpp
  5. +97
    -69
      source/carla_backend.py

+ 35
- 35
source/Makefile.mk View File

@@ -84,23 +84,23 @@ ifneq ($(shell pkg-config --exists liblo && echo true),true)
$(error liblo missing, cannot continue)
endif

ifeq ($(LINUX),true)
ifneq ($(shell pkg-config --exists x11 && echo true),true)
$(error X11 missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists xinerama && echo true),true)
$(error Xinerama missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists xext && echo true),true)
$(error Xext missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists xcursor && echo true),true)
$(error Xcursor missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists freetype2 && echo true),true)
$(error FreeType2 missing, cannot continue)
endif
endif
# ifeq ($(LINUX),true)
# ifneq ($(shell pkg-config --exists x11 && echo true),true)
# $(error X11 missing, cannot continue)
# endif
# ifneq ($(shell pkg-config --exists xinerama && echo true),true)
# $(error Xinerama missing, cannot continue)
# endif
# ifneq ($(shell pkg-config --exists xext && echo true),true)
# $(error Xext missing, cannot continue)
# endif
# ifneq ($(shell pkg-config --exists xcursor && echo true),true)
# $(error Xcursor missing, cannot continue)
# endif
# ifneq ($(shell pkg-config --exists freetype2 && echo true),true)
# $(error FreeType2 missing, cannot continue)
# endif
# endif

# --------------------------------------------------------------
# Check for optional libs (required by backend or bridges)
@@ -150,13 +150,13 @@ DGL_FLAGS = $(shell pkg-config --cflags gl x11)
DGL_LIBS = $(shell pkg-config --libs gl x11)
endif
JACKBRIDGE_LIBS = -ldl -lpthread -lrt
JUCE_CORE_LIBS = -ldl -lpthread -lrt
JUCE_EVENTS_FLAGS = $(shell pkg-config --cflags x11)
JUCE_EVENTS_LIBS = $(shell pkg-config --libs x11)
JUCE_GRAPHICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext freetype2)
JUCE_GRAPHICS_LIBS = $(shell pkg-config --libs x11 xinerama xext freetype2)
JUCE_GUI_BASICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext xcursor)
JUCE_GUI_BASICS_LIBS = $(shell pkg-config --libs x11 xinerama xext xcursor) -ldl
# JUCE_CORE_LIBS = -ldl -lpthread -lrt
# JUCE_EVENTS_FLAGS = $(shell pkg-config --cflags x11)
# JUCE_EVENTS_LIBS = $(shell pkg-config --libs x11)
# JUCE_GRAPHICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext freetype2)
# JUCE_GRAPHICS_LIBS = $(shell pkg-config --libs x11 xinerama xext freetype2)
# JUCE_GUI_BASICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext xcursor)
# JUCE_GUI_BASICS_LIBS = $(shell pkg-config --libs x11 xinerama xext xcursor) -ldl
LILV_LIBS = -ldl -lm -lrt
ifeq ($(HAVE_ALSA),true)
RTAUDIO_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSA__
@@ -173,12 +173,12 @@ endif
ifeq ($(MACOS),true)
DGL_LIBS = -framework OpenGL -framework Cocoa
JACKBRIDGE_LIBS = -ldl -lpthread
JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
JUCE_AUDIO_DEVICES_LIBS = -framework CoreAudio -framework CoreMIDI -framework DiscRecording
JUCE_AUDIO_FORMATS_LIBS = -framework CoreAudio -framework CoreMIDI -framework QuartzCore -framework AudioToolbox
JUCE_CORE_LIBS = -framework Cocoa -framework IOKit
JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
JUCE_GUI_BASICS_LIBS = -framework Cocoa -framework Carbon -framework QuartzCore
# JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
# JUCE_AUDIO_DEVICES_LIBS = -framework CoreAudio -framework CoreMIDI -framework DiscRecording
# JUCE_AUDIO_FORMATS_LIBS = -framework CoreAudio -framework CoreMIDI -framework QuartzCore -framework AudioToolbox
# JUCE_CORE_LIBS = -framework Cocoa -framework IOKit
# JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
# JUCE_GUI_BASICS_LIBS = -framework Cocoa -framework Carbon -framework QuartzCore
LILV_LIBS = -ldl -lm
RTAUDIO_FLAGS += -D__MACOSX_CORE__
RTAUDIO_LIBS += -lpthread
@@ -188,11 +188,11 @@ endif
ifeq ($(WIN32),true)
DGL_LIBS = -lopengl32 -lgdi32
JACKBRIDGE_LIBS = -lpthread
JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
JUCE_EVENTS_LIBS = -lole32
JUCE_GRAPHICS_LIBS = -lgdi32
JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
# JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
# JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
# JUCE_EVENTS_LIBS = -lole32
# JUCE_GRAPHICS_LIBS = -lgdi32
# JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
LILV_LIBS = -lm
RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__
RTAUDIO_LIBS += -lpthread


+ 84
- 64
source/backend/CarlaBackend.hpp View File

@@ -47,7 +47,18 @@ CARLA_BACKEND_START_NAMESPACE
const unsigned int MAX_DEFAULT_PLUGINS = 99; //!< Maximum default number of loadable plugins.
const unsigned int MAX_RACK_PLUGINS = 16; //!< Maximum number of loadable plugins in rack mode.
const unsigned int MAX_PATCHBAY_PLUGINS = 255; //!< Maximum number of loadable plugins in patchbay mode.
const unsigned int MAX_DEFAULT_PARAMETERS = 200; //!< Maximum default number of parameters allowed.\see OPTION_MAX_PARAMETERS
const unsigned int MAX_DEFAULT_PARAMETERS = 200; //!< Maximum default number of parameters allowed.\see ENGINE_OPTION_MAX_PARAMETERS

/*!
* @defgroup EngineDriverHints Engine Driver Hints
*
* Various engine driver hints.
* @{
*/
const unsigned int ENGINE_DRIVER_HAS_CONTROL_PANEL = 0x1; //!< Engine driver has custom control-panel.
const unsigned int ENGINE_DRIVER_VARIABLE_BUFFER_SIZE = 0x2; //!< Engine driver can change buffer-size on the fly.
const unsigned int ENGINE_DRIVER_VARIABLE_SAMPLE_RATE = 0x4; //!< Engine driver can change sample-rate on the fly.
/**@}*/

/*!
* @defgroup PluginHints Plugin Hints
@@ -105,20 +116,29 @@ const unsigned int PARAMETER_USES_CUSTOM_TEXT = 0x400; //!< Parameter uses custo
/**@}*/

/*!
* @defgroup CustomDataTypes Custom Data types
* @defgroup CustomDataTypes Custom Data Types
*
* The type defines how the \param value in the CustomData struct is stored.\n
* Types are valid URIs. Any non-string or non-simple type (not integral) is saved in a base64 encoded format.
* \see CustomData
* @{
*/
const char* const CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"; //!< Chunk type URI.
const char* const CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string"; //!< String type URI.
const char* const CUSTOM_DATA_KEY_UI_X = "http://kxstudio.sf.net/carla/ui#x"; //!< UI X URI.
const char* const CUSTOM_DATA_KEY_UI_Y = "http://kxstudio.sf.net/carla/ui#y"; //!< UI Y URI.
const char* const CUSTOM_DATA_KEY_UI_WIDTH = "http://kxstudio.sf.net/carla/ui#width"; //!< UI width URI.
const char* const CUSTOM_DATA_KEY_UI_HEIGHT = "http://kxstudio.sf.net/carla/ui#height"; //!< UI height URI.
const char* const CUSTOM_DATA_KEY_UI_VISIBLE = "http://kxstudio.sf.net/carla/ui#visible"; //!< UI visible URI.
const char* const CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"; //!< Chunk type URI.
const char* const CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string"; //!< String type URI.
/**@}*/

/*!
* @defgroup CustomDataKeys Custom Data Keys
*
* \see CustomData
* @{
*/
const char* const CUSTOM_DATA_KEY_OPTIONS = "CarlaOptions"; //!< Options URI.
const char* const CUSTOM_DATA_KEY_UI_X = "CarlaUI:X"; //!< UI X URI.
const char* const CUSTOM_DATA_KEY_UI_Y = "CarlaUI:Y"; //!< UI Y URI.
const char* const CUSTOM_DATA_KEY_UI_WIDTH = "CarlaUI:Width"; //!< UI width URI.
const char* const CUSTOM_DATA_KEY_UI_HEIGHT = "CarlaUI:Height"; //!< UI height URI.
const char* const CUSTOM_DATA_KEY_UI_VISIBLE = "CarlaUI:Visible"; //!< UI visible URI.
/**@}*/

/*!
@@ -207,87 +227,109 @@ enum InternalParametersIndex SIZE_INT {
PARAMETER_MAX = -9 //!< Max value, defined for convenience.
};

/*!
* Engine process mode.
* \see ENGINE_OPTION_PROCESS_MODE
*/
enum ProcessMode SIZE_INT {
PROCESS_MODE_SINGLE_CLIENT = 0, //!< Single client mode (dynamic input/outputs as needed by plugins).
PROCESS_MODE_MULTIPLE_CLIENTS = 1, //!< Multiple client mode (1 master client + 1 client per plugin).
PROCESS_MODE_CONTINUOUS_RACK = 2, //!< Single client, 'rack' mode. Processes plugins in order of Id, with forced stereo.
PROCESS_MODE_PATCHBAY = 3, //!< Single client, 'patchbay' mode.
PROCESS_MODE_BRIDGE = 4 //!< Special mode, used in plugin-bridges only.
};

/*!
* All the available transport modes
*/
enum TransportMode SIZE_INT {
TRANSPORT_MODE_INTERNAL = 0, //!< Internal transport mode.
TRANSPORT_MODE_JACK = 1, //!< Transport from JACK, only available if driver name is "JACK".
TRANSPORT_MODE_PLUGIN = 2, //!< Transport from host, used when Carla is a plugin.
TRANSPORT_MODE_BRIDGE = 3 //!< Special mode, used in plugin-bridges only.
};

/*!
* Options used in the CarlaEngine::setOption() calls.\n
* All options except paths must be set before initiliazing or after closing the engine.
*/
enum OptionsType SIZE_INT {
enum EngineOptionsType SIZE_INT {
/*!
* Set the current process name.\n
* This is a convenience option, as Python lacks this functionality.
*/
OPTION_PROCESS_NAME = 0,
ENGINE_OPTION_PROCESS_NAME = 0,

/*!
* Set the engine processing mode.\n
* Default is PROCESS_MODE_MULTIPLE_CLIENTS on Linux and PROCESS_MODE_CONTINUOUS_RACK for all other OSes.
* \see ProcessMode
*/
OPTION_PROCESS_MODE = 1,
ENGINE_OPTION_PROCESS_MODE = 1,

/*!
* Set the engine transport mode.\n
* Default is TRANSPORT_MODE_INTERNAL.
* \see TransportMode
*/
OPTION_TRANSPORT_MODE = 2,
ENGINE_OPTION_TRANSPORT_MODE = 2,

/*!
* Force mono plugins as stereo, by running 2 instances at the same time.
* \note Not supported by all plugins.
* \see PLUGIN_OPTION_FORCE_STEREO
*/
OPTION_FORCE_STEREO = 3,
ENGINE_OPTION_FORCE_STEREO = 3,

/*!
* Use plugin bridges whenever possible.\n
* Default is no, EXPERIMENTAL.
*/
OPTION_PREFER_PLUGIN_BRIDGES = 4,
ENGINE_OPTION_PREFER_PLUGIN_BRIDGES = 4,

/*!
* Use UI bridges whenever possible, otherwise UIs will be handled in the main thread.\n
* Default is yes.
*/
OPTION_PREFER_UI_BRIDGES = 5,
ENGINE_OPTION_PREFER_UI_BRIDGES = 5,

/*!
* Make plugin UIs always-on-top.\n
* Default is yes.
*/
OPTION_UIS_ALWAYS_ON_TOP = 6,
ENGINE_OPTION_UIS_ALWAYS_ON_TOP = 6,

/*!
* Maximum number of parameters allowed.\n
* Default is MAX_DEFAULT_PARAMETERS.
*/
OPTION_MAX_PARAMETERS = 7,
ENGINE_OPTION_MAX_PARAMETERS = 7,

/*!
* Timeout value in ms for how much to wait for UI-Bridges to respond.\n
* Default is 4000 (4 secs).
*/
OPTION_UI_BRIDGES_TIMEOUT = 8,
ENGINE_OPTION_UI_BRIDGES_TIMEOUT = 8,

/*!
* Audio number of periods.
*/
OPTION_AUDIO_NUM_PERIODS = 9,
ENGINE_OPTION_AUDIO_NUM_PERIODS = 9,

/*!
* Audio buffer size.
*/
OPTION_AUDIO_BUFFER_SIZE = 10,
ENGINE_OPTION_AUDIO_BUFFER_SIZE = 10,

/*!
* Audio sample rate.
*/
OPTION_AUDIO_SAMPLE_RATE = 11,
ENGINE_OPTION_AUDIO_SAMPLE_RATE = 11,

/*!
* Audio device.
*/
OPTION_AUDIO_DEVICE = 12,
ENGINE_OPTION_AUDIO_DEVICE = 12,

/*!
* Set path to the resource files.\n
@@ -295,38 +337,38 @@ enum OptionsType SIZE_INT {
*
* \note Must be set for some internal plugins to work!
*/
OPTION_PATH_RESOURCES = 13,
ENGINE_OPTION_PATH_RESOURCES = 13,

#ifndef BUILD_BRIDGE
/*!
* Set path to the native plugin bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_NATIVE = 14,
ENGINE_OPTION_PATH_BRIDGE_NATIVE = 14,

/*!
* Set path to the POSIX 32bit plugin bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_POSIX32 = 15,
ENGINE_OPTION_PATH_BRIDGE_POSIX32 = 15,

/*!
* Set path to the POSIX 64bit plugin bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_POSIX64 = 16,
ENGINE_OPTION_PATH_BRIDGE_POSIX64 = 16,

/*!
* Set path to the Windows 32bit plugin bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_WIN32 = 17,
ENGINE_OPTION_PATH_BRIDGE_WIN32 = 17,

/*!
* Set path to the Windows 64bit plugin bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_WIN64 = 18,
ENGINE_OPTION_PATH_BRIDGE_WIN64 = 18,
#endif

#ifdef WANT_LV2
@@ -334,55 +376,55 @@ enum OptionsType SIZE_INT {
* Set path to the LV2 External UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_EXTERNAL = 19,
ENGINE_OPTION_PATH_BRIDGE_LV2_EXTERNAL = 19,

/*!
* Set path to the LV2 Gtk2 UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_GTK2 = 20,
ENGINE_OPTION_PATH_BRIDGE_LV2_GTK2 = 20,

/*!
* Set path to the LV2 Gtk3 UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_GTK3 = 21,
ENGINE_OPTION_PATH_BRIDGE_LV2_GTK3 = 21,

/*!
* Set path to the LV2 Ntk UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_NTK = 22,
ENGINE_OPTION_PATH_BRIDGE_LV2_NTK = 22,

/*!
* Set path to the LV2 Qt4 UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_QT4 = 23,
ENGINE_OPTION_PATH_BRIDGE_LV2_QT4 = 23,

/*!
* Set path to the LV2 Qt5 UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_QT5 = 24,
ENGINE_OPTION_PATH_BRIDGE_LV2_QT5 = 24,

/*!
* Set path to the LV2 Cocoa UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_COCOA = 25,
ENGINE_OPTION_PATH_BRIDGE_LV2_COCOA = 25,

/*!
* Set path to the LV2 Windows UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_WINDOWS = 26,
ENGINE_OPTION_PATH_BRIDGE_LV2_WINDOWS = 26,

/*!
* Set path to the LV2 X11 UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_LV2_X11 = 27,
ENGINE_OPTION_PATH_BRIDGE_LV2_X11 = 27,
#endif

#ifdef WANT_VST
@@ -390,19 +432,19 @@ enum OptionsType SIZE_INT {
* Set path to the VST Mac UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_VST_MAC = 28,
ENGINE_OPTION_PATH_BRIDGE_VST_MAC = 28,

/*!
* Set path to the VST HWND UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_VST_HWND = 29,
ENGINE_OPTION_PATH_BRIDGE_VST_HWND = 29,

/*!
* Set path to the VST X11 UI bridge executable.\n
* Default unset.
*/
OPTION_PATH_BRIDGE_VST_X11 = 30
ENGINE_OPTION_PATH_BRIDGE_VST_X11 = 30
#endif
};

@@ -677,28 +719,6 @@ enum FileCallbackType SIZE_INT {
FILE_CALLBACK_SAVE = 2
};

/*!
* Engine process mode.
* \see OPTION_PROCESS_MODE
*/
enum ProcessMode SIZE_INT {
PROCESS_MODE_SINGLE_CLIENT = 0, //!< Single client mode (dynamic input/outputs as needed by plugins).
PROCESS_MODE_MULTIPLE_CLIENTS = 1, //!< Multiple client mode (1 master client + 1 client per plugin).
PROCESS_MODE_CONTINUOUS_RACK = 2, //!< Single client, 'rack' mode. Processes plugins in order of Id, with forced stereo.
PROCESS_MODE_PATCHBAY = 3, //!< Single client, 'patchbay' mode.
PROCESS_MODE_BRIDGE = 4 //!< Special mode, used in plugin-bridges only.
};

/*!
* All the available transport modes
*/
enum TransportMode SIZE_INT {
TRANSPORT_MODE_INTERNAL = 0, //!< Internal transport mode.
TRANSPORT_MODE_JACK = 1, //!< Transport from JACK, only available if driver name is "JACK".
TRANSPORT_MODE_PLUGIN = 2, //!< Transport from host, used when Carla is a plugin.
TRANSPORT_MODE_BRIDGE = 3 //!< Special mode, used in plugin-bridges only.
};

/*!
* Engine callback function.
* \see EngineCallbackType
@@ -709,7 +729,7 @@ typedef void (*EngineCallbackFunc)(void* ptr, EngineCallbackType action, unsigne
* File callback function.
* \see FileCallbackType
*/
typedef const char* (*FileCallbackFunc)(void* ptr, FileCallbackType action, bool isDir, const char* title, const char* filter);
typedef char* (*FileCallbackFunc)(void* ptr, FileCallbackType action, bool isDir, const char* title, const char* filter);

/*!
* Parameter data.


+ 3
- 2
source/backend/CarlaHost.hpp View File

@@ -242,6 +242,7 @@ struct CarlaTransportInfo {
frame(0),
bar(0),
beat(0),
tick(0),
bpm(0.0) {}
#endif
};
@@ -282,9 +283,9 @@ CARLA_EXPORT const char* carla_get_supported_file_types();
CARLA_EXPORT unsigned int carla_get_engine_driver_count();

/*!
* Get the engine driver name \a index.
* Get the engine driver info for \a index.
*/
CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);
CARLA_EXPORT const CarlaEngineDriverInfo* carla_get_engine_driver_info(unsigned int index);

/*!
* Get the device names of the engine driver at \a index (for use in non-JACK drivers).\n


+ 18
- 31
source/backend/standalone/CarlaStandalone.cpp View File

@@ -26,7 +26,9 @@
#include "CarlaOscUtils.hpp"
#include "CarlaNative.h"

#include "juce_gui_basics.h"
#ifdef USE_JUCE
# include "juce_gui_basics.h"
#endif

//#include "CarlaLogThread.hpp"
//#if ! (defined(DEBUG) || defined(WANT_LOGS) || defined(BUILD_ANSI_TEST))
@@ -37,12 +39,11 @@ namespace CB = CarlaBackend;

using CB::CarlaEngine;
using CB::CarlaPlugin;
using CB::CallbackFunc;
using CB::EngineCallbackFunc;
using CB::EngineOptions;
using CB::EngineTimeInfo;

//using juce::MessageManager;

#ifdef USE_JUCE
using namespace juce;

// -----------------------------------------------------------------------
@@ -87,13 +88,15 @@ private:
};

juce_ImplementSingleton(JuceMessageThread)
#endif

// -------------------------------------------------------------------------------------------------------------------
// Single, standalone engine

struct CarlaBackendStandalone {
CallbackFunc callback;
void* callbackPtr;
EngineCallbackFunc callback;
void* callbackPtr;

CarlaEngine* engine;
CarlaString lastError;
EngineOptions options;
@@ -106,50 +109,32 @@ struct CarlaBackendStandalone {
~CarlaBackendStandalone()
{
CARLA_ASSERT(engine == nullptr);
//CARLA_ASSERT(MessageManager::getInstanceWithoutCreating() == nullptr);
#ifdef USE_JUCE
CARLA_ASSERT(MessageManager::getInstanceWithoutCreating() == nullptr);
#endif
}

#if 1
void init()
{
#ifdef USE_JUCE
JUCE_AUTORELEASEPOOL

initialiseJuce_GUI();
JuceMessageThread::getInstance();
#endif
}

void idle() {}

void close()
{
#ifdef USE_JUCE
JUCE_AUTORELEASEPOOL

JuceMessageThread::deleteInstance();
shutdownJuce_GUI();
}
#else
void init()
{
juce::initialiseJuce_GUI();

if (MessageManager* const mgr = MessageManager::getInstance())
mgr->setCurrentThreadAsMessageThread();
}

void idle()
{
if (MessageManager* const mgr = MessageManager::getInstanceWithoutCreating())
mgr->runDispatchLoopUntil(5);
}

void close()
{
if (MessageManager* const mgr = MessageManager::getInstanceWithoutCreating())
mgr->stopDispatchLoop();

juce::shutdownJuce_GUI();
}
#endif
}

CARLA_DECLARE_NON_COPY_STRUCT(CarlaBackendStandalone)
};
@@ -597,7 +582,9 @@ void carla_set_engine_option(CarlaOptionsType option, int value, const char* val
{
case CB::OPTION_PROCESS_NAME:
CARLA_SAFE_ASSERT_RETURN(valueStr != nullptr && valueStr[0] != '\0',);
#ifdef USE_JUCE
juce::Thread::setCurrentThreadName(valueStr);
#endif
break;

case CB::OPTION_PROCESS_MODE:


+ 97
- 69
source/carla_backend.py View File

@@ -92,6 +92,11 @@ MAX_RACK_PLUGINS = 16
MAX_PATCHBAY_PLUGINS = 255
MAX_DEFAULT_PARAMETERS = 200

# Engine Driver Hints
ENGINE_DRIVER_HAS_CONTROL_PANEL = 0x1
ENGINE_DRIVER_VARIABLE_BUFFER_SIZE = 0x2
ENGINE_DRIVER_VARIABLE_SAMPLE_RATE = 0x4

# Plugin Hints
PLUGIN_IS_BRIDGE = 0x001
PLUGIN_IS_RTSAFE = 0x002
@@ -126,21 +131,24 @@ PARAMETER_USES_SAMPLERATE = 0x100
PARAMETER_USES_SCALEPOINTS = 0x200
PARAMETER_USES_CUSTOM_TEXT = 0x400

# Custom Data types
# Custom Data Types
CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"
CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string"
CUSTOM_DATA_KEY_UI_X = "http://kxstudio.sf.net/carla/ui#x"
CUSTOM_DATA_KEY_UI_Y = "http://kxstudio.sf.net/carla/ui#y"
CUSTOM_DATA_KEY_UI_WIDTH = "http://kxstudio.sf.net/carla/ui#width"
CUSTOM_DATA_KEY_UI_HEIGHT = "http://kxstudio.sf.net/carla/ui#height"
CUSTOM_DATA_KEY_UI_VISIBLE = "http://kxstudio.sf.net/carla/ui#visible"

# Custom Data Keys
CUSTOM_DATA_KEY_OPTIONS = "CarlaOptions"
CUSTOM_DATA_KEY_UI_X = "CarlaUI:X"
CUSTOM_DATA_KEY_UI_Y = "CarlaUI:Y"
CUSTOM_DATA_KEY_UI_WIDTH = "CarlaUI:Width"
CUSTOM_DATA_KEY_UI_HEIGHT = "CarlaUI:Height"
CUSTOM_DATA_KEY_UI_VISIBLE = "CarlaUI:Visible"

# Patchbay Port Hints
PATCHBAY_PORT_IS_INPUT = 0x01
PATCHBAY_PORT_IS_OUTPUT = 0x02
PATCHBAY_PORT_IS_AUDIO = 0x10
PATCHBAY_PORT_IS_CV = 0x20
PATCHBAY_PORT_IS_MIDI = 0x40
PATCHBAY_PORT_IS_INPUT = 0x01
PATCHBAY_PORT_IS_OUTPUT = 0x02
PATCHBAY_PORT_IS_AUDIO = 0x10
PATCHBAY_PORT_IS_CV = 0x20
PATCHBAY_PORT_IS_MIDI = 0x40

# Binary Type
BINARY_NONE = 0
@@ -192,40 +200,53 @@ PARAMETER_PANNING = -7
PARAMETER_CTRL_CHANNEL = -8
PARAMETER_MAX = -9

# Options Type
OPTION_PROCESS_NAME = 0
OPTION_PROCESS_MODE = 1
OPTION_TRANSPORT_MODE = 2
OPTION_FORCE_STEREO = 3
OPTION_PREFER_PLUGIN_BRIDGES = 4
OPTION_PREFER_UI_BRIDGES = 5
OPTION_UIS_ALWAYS_ON_TOP = 6
OPTION_MAX_PARAMETERS = 7
OPTION_UI_BRIDGES_TIMEOUT = 8
OPTION_AUDIO_NUM_PERIODS = 9
OPTION_AUDIO_BUFFER_SIZE = 10
OPTION_AUDIO_SAMPLE_RATE = 11
OPTION_AUDIO_DEVICE = 12
OPTION_PATH_RESOURCES = 13
OPTION_PATH_BRIDGE_NATIVE = 14
OPTION_PATH_BRIDGE_POSIX32 = 15
OPTION_PATH_BRIDGE_POSIX64 = 16
OPTION_PATH_BRIDGE_WIN32 = 17
OPTION_PATH_BRIDGE_WIN64 = 18
OPTION_PATH_BRIDGE_LV2_EXTERNAL = 19
OPTION_PATH_BRIDGE_LV2_GTK2 = 20
OPTION_PATH_BRIDGE_LV2_GTK3 = 21
OPTION_PATH_BRIDGE_LV2_NTK = 22
OPTION_PATH_BRIDGE_LV2_QT4 = 23
OPTION_PATH_BRIDGE_LV2_QT5 = 24
OPTION_PATH_BRIDGE_LV2_COCOA = 25
OPTION_PATH_BRIDGE_LV2_WINDOWS = 26
OPTION_PATH_BRIDGE_LV2_X11 = 27
OPTION_PATH_BRIDGE_VST_MAC = 28
OPTION_PATH_BRIDGE_VST_HWND = 29
OPTION_PATH_BRIDGE_VST_X11 = 30

# EngineCallback Type
# Process Mode
PROCESS_MODE_SINGLE_CLIENT = 0
PROCESS_MODE_MULTIPLE_CLIENTS = 1
PROCESS_MODE_CONTINUOUS_RACK = 2
PROCESS_MODE_PATCHBAY = 3
PROCESS_MODE_BRIDGE = 4

# Transport Mode
TRANSPORT_MODE_INTERNAL = 0
TRANSPORT_MODE_JACK = 1
TRANSPORT_MODE_PLUGIN = 2
TRANSPORT_MODE_BRIDGE = 3

# Engine Options Type
ENGINE_OPTION_PROCESS_NAME = 0
ENGINE_OPTION_PROCESS_MODE = 1
ENGINE_OPTION_TRANSPORT_MODE = 2
ENGINE_OPTION_FORCE_STEREO = 3
ENGINE_OPTION_PREFER_PLUGIN_BRIDGES = 4
ENGINE_OPTION_PREFER_UI_BRIDGES = 5
ENGINE_OPTION_UIS_ALWAYS_ON_TOP = 6
ENGINE_OPTION_MAX_PARAMETERS = 7
ENGINE_OPTION_UI_BRIDGES_TIMEOUT = 8
ENGINE_OPTION_AUDIO_NUM_PERIODS = 9
ENGINE_OPTION_AUDIO_BUFFER_SIZE = 10
ENGINE_OPTION_AUDIO_SAMPLE_RATE = 11
ENGINE_OPTION_AUDIO_DEVICE = 12
ENGINE_OPTION_PATH_RESOURCES = 13
ENGINE_OPTION_PATH_BRIDGE_NATIVE = 14
ENGINE_OPTION_PATH_BRIDGE_POSIX32 = 15
ENGINE_OPTION_PATH_BRIDGE_POSIX64 = 16
ENGINE_OPTION_PATH_BRIDGE_WIN32 = 17
ENGINE_OPTION_PATH_BRIDGE_WIN64 = 18
ENGINE_OPTION_PATH_BRIDGE_LV2_EXTERNAL = 19
ENGINE_OPTION_PATH_BRIDGE_LV2_GTK2 = 20
ENGINE_OPTION_PATH_BRIDGE_LV2_GTK3 = 21
ENGINE_OPTION_PATH_BRIDGE_LV2_NTK = 22
ENGINE_OPTION_PATH_BRIDGE_LV2_QT4 = 23
ENGINE_OPTION_PATH_BRIDGE_LV2_QT5 = 24
ENGINE_OPTION_PATH_BRIDGE_LV2_COCOA = 25
ENGINE_OPTION_PATH_BRIDGE_LV2_WINDOWS = 26
ENGINE_OPTION_PATH_BRIDGE_LV2_X11 = 27
ENGINE_OPTION_PATH_BRIDGE_VST_MAC = 28
ENGINE_OPTION_PATH_BRIDGE_VST_HWND = 29
ENGINE_OPTION_PATH_BRIDGE_VST_X11 = 30

# Engine Callback Type
ENGINE_CALLBACK_DEBUG = 0
ENGINE_CALLBACK_PLUGIN_ADDED = 1
ENGINE_CALLBACK_PLUGIN_REMOVED = 2
@@ -266,24 +287,11 @@ ENGINE_CALLBACK_INFO = 36
ENGINE_CALLBACK_ERROR = 37
ENGINE_CALLBACK_QUIT = 38

# FileCallback Type
# File Callback Type
FILE_CALLBACK_DEBUG = 0
FILE_CALLBACK_OPEN = 1
FILE_CALLBACK_SAVE = 2

# Process Mode
PROCESS_MODE_SINGLE_CLIENT = 0
PROCESS_MODE_MULTIPLE_CLIENTS = 1
PROCESS_MODE_CONTINUOUS_RACK = 2
PROCESS_MODE_PATCHBAY = 3
PROCESS_MODE_BRIDGE = 4

# Transport Mode
TRANSPORT_MODE_INTERNAL = 0
TRANSPORT_MODE_JACK = 1
TRANSPORT_MODE_PLUGIN = 2
TRANSPORT_MODE_BRIDGE = 3

# Set BINARY_NATIVE
if HAIKU or LINUX or MACOS:
BINARY_NATIVE = BINARY_POSIX64 if kIs64bit else BINARY_POSIX32
@@ -402,12 +410,18 @@ class CarlaTransportInfo(Structure):
("bpm", c_double)
]

class CarlaEngineDriverInfo(Structure):
_fields_ = [
("name", c_char_p),
("hints", c_uint)
]

# ------------------------------------------------------------------------------------------------------------
# Python object dicts compatible with ctypes struct

PyParameterData = {
'type': PARAMETER_NULL,
'index': 0,
'index': PARAMETER_NULL,
'rindex': -1,
'hints': 0x0,
'midiChannel': 0,
@@ -418,9 +432,9 @@ PyParameterRanges = {
'def': 0.0,
'min': 0.0,
'max': 1.0,
'step': 0.0,
'stepSmall': 0.0,
'stepLarge': 0.0
'step': 0.01,
'stepSmall': 0.0001,
'stepLarge': 0.1
}

PyMidiProgramData = {
@@ -447,8 +461,8 @@ PyCarlaPluginInfo = {
'maker': None,
'copyright': None,
'iconName': None,
'uniqueId': 0,
'latency': 0
'patchbayClientId': 0,
'uniqueId': 0
}

PyCarlaPortCountInfo = {
@@ -469,6 +483,20 @@ PyCarlaScalePointInfo = {
'label': None
}

PyCarlaTransportInfo = {
"playing": False,
"frame": 0,
"bar": 0,
"beat": 0,
"tick": 0,
"bpm": 0.0
}

PyCarlaEngineDriverInfo = {
"name": None,
"hints": 0x0
}

# ------------------------------------------------------------------------------------------------------------
# Host Python object (Control/Standalone)

@@ -487,8 +515,8 @@ class Host(object):
self.lib.carla_get_engine_driver_count.argtypes = None
self.lib.carla_get_engine_driver_count.restype = c_uint

self.lib.carla_get_engine_driver_name.argtypes = [c_uint]
self.lib.carla_get_engine_driver_name.restype = c_char_p
self.lib.carla_get_engine_driver_info.argtypes = [c_uint]
self.lib.carla_get_engine_driver_info.restype = POINTER(CarlaEngineDriverInfo)

self.lib.carla_get_engine_driver_device_names.argtypes = [c_uint]
self.lib.carla_get_engine_driver_device_names.restype = POINTER(c_char_p)
@@ -745,8 +773,8 @@ class Host(object):
def get_engine_driver_count(self):
return self.lib.carla_get_engine_driver_count()

def get_engine_driver_name(self, index):
return self.lib.carla_get_engine_driver_name(index)
def get_engine_driver_info(self, index):
return structToDict(self.lib.carla_get_engine_driver_info(index))

def get_engine_driver_device_names(self, index):
return charStringList(self.lib.carla_get_engine_driver_device_names(index))


Loading…
Cancel
Save