| @@ -93,6 +93,7 @@ wine64: | |||
| # ------------------------------------------------------------------------------------------------------------------------------------------------------ | |||
| clean: | |||
| $(MAKE) clean -C source/backend | |||
| $(MAKE) clean -C source/discovery | |||
| rm -f $(RES) | |||
| rm -f $(UIs) | |||
| @@ -537,7 +537,7 @@ enum ProcessMode { | |||
| * | |||
| * \see set_callback_function() and CallbackType | |||
| */ | |||
| typedef void (*CallbackFunc)(void* ptr, CallbackType action, unsigned short pluginId, int value1, int value2, double value3, const char* valueStr); | |||
| typedef void (*CallbackFunc)(void* ptr, CallbackType action, int pluginId, int value1, int value2, double value3, const char* valueStr); | |||
| /*! | |||
| * Parameter data | |||
| @@ -20,14 +20,9 @@ | |||
| #include "carla_backend.hpp" | |||
| using CarlaBackend::CarlaEngine; | |||
| using CarlaBackend::CarlaPlugin; | |||
| // TODO - create struct for internal plugin info | |||
| // TODO - dont strdup() on const-char* returns, use static char[STR_MAX] | |||
| //CARLA_BACKEND_USE_NAMESPACE | |||
| /*! | |||
| * @defgroup CarlaBackendStandalone Carla Backend Standalone | |||
| * | |||
| @@ -36,10 +31,12 @@ using CarlaBackend::CarlaPlugin; | |||
| * @{ | |||
| */ | |||
| #if 0 | |||
| struct PluginInfo { | |||
| PluginType type; | |||
| PluginCategory category; | |||
| typedef CarlaBackend::PluginType CarlaPluginType; | |||
| typedef CarlaBackend::PluginCategory CarlaPluginCategory; | |||
| struct CarlaPluginInfo { | |||
| CarlaPluginType type; | |||
| CarlaPluginCategory category; | |||
| unsigned int hints; | |||
| const char* binary; | |||
| const char* name; | |||
| @@ -48,9 +45,9 @@ struct PluginInfo { | |||
| const char* copyright; | |||
| long uniqueId; | |||
| PluginInfo() | |||
| : type(PLUGIN_NONE), | |||
| category(PLUGIN_CATEGORY_NONE), | |||
| CarlaPluginInfo() | |||
| : type(CarlaBackend::PLUGIN_NONE), | |||
| category(CarlaBackend::PLUGIN_CATEGORY_NONE), | |||
| hints(0x0), | |||
| binary(nullptr), | |||
| name(nullptr), | |||
| @@ -60,56 +57,82 @@ struct PluginInfo { | |||
| uniqueId(0) {} | |||
| }; | |||
| struct PortCountInfo { | |||
| struct CarlaNativePluginInfo { | |||
| CarlaPluginCategory category; | |||
| unsigned int hints; | |||
| uint32_t audioIns; | |||
| uint32_t audioOuts; | |||
| uint32_t midiIns; | |||
| uint32_t midiOuts; | |||
| uint32_t parameterIns; | |||
| uint32_t parameterOuts; | |||
| const char* name; | |||
| const char* label; | |||
| const char* maker; | |||
| const char* copyright; | |||
| CarlaNativePluginInfo() | |||
| : category(CarlaBackend::PLUGIN_CATEGORY_NONE), | |||
| hints(0x0), | |||
| audioIns(0), | |||
| audioOuts(0), | |||
| midiIns(0), | |||
| midiOuts(0), | |||
| parameterIns(0), | |||
| parameterOuts(0), | |||
| name(nullptr), | |||
| label(nullptr), | |||
| maker(nullptr), | |||
| copyright(nullptr) {} | |||
| }; | |||
| struct CarlaPortCountInfo { | |||
| uint32_t ins; | |||
| uint32_t outs; | |||
| uint32_t total; | |||
| PortCountInfo() | |||
| CarlaPortCountInfo() | |||
| : ins(0), | |||
| outs(0), | |||
| total(0) {} | |||
| }; | |||
| struct ParameterInfo { | |||
| struct CarlaParameterInfo { | |||
| const char* name; | |||
| const char* symbol; | |||
| const char* unit; | |||
| uint32_t scalePointCount; | |||
| ParameterInfo() | |||
| CarlaParameterInfo() | |||
| : name(nullptr), | |||
| symbol(nullptr), | |||
| unit(nullptr), | |||
| scalePointCount(0) {} | |||
| }; | |||
| struct ScalePointInfo { | |||
| struct CarlaScalePointInfo { | |||
| double value; | |||
| const char* label; | |||
| ScalePointInfo() | |||
| CarlaScalePointInfo() | |||
| : value(0.0), | |||
| label(nullptr) {} | |||
| }; | |||
| #endif | |||
| CARLA_EXPORT const char* carla_get_extended_license_text(); | |||
| CARLA_EXPORT unsigned int carla_get_engine_driver_count(); | |||
| CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index); | |||
| CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index); | |||
| #if 0 | |||
| CARLA_EXPORT unsigned int get_internal_plugin_count(); | |||
| CARLA_EXPORT const PluginInfo* get_internal_plugin_info(unsigned int pluginId); | |||
| #endif | |||
| CARLA_EXPORT unsigned int carla_get_internal_plugin_count(); | |||
| CARLA_EXPORT const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId); | |||
| CARLA_EXPORT bool carla_engine_init(const char* driverName, const char* clientName); | |||
| CARLA_EXPORT bool carla_engine_close(); | |||
| CARLA_EXPORT bool carla_is_engine_running(); | |||
| #if 0 | |||
| CARLA_EXPORT int add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, void* extraPtr); | |||
| CARLA_EXPORT int add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, void* extraPtr); | |||
| CARLA_EXPORT bool remove_plugin(unsigned int pluginId); | |||
| CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned int pluginId); | |||
| @@ -181,6 +204,4 @@ CARLA_EXPORT void nsm_reply_save(); | |||
| /**@}*/ | |||
| //CARLA_BACKEND_END_NAMESPACE | |||
| #endif // __CARLA_STANDALONE_HPP__ | |||
| @@ -31,10 +31,11 @@ endif | |||
| # -------------------------------------------------------------- | |||
| OBJS = \ | |||
| carla_plugin.cpp.o | |||
| carla_plugin.cpp.o \ | |||
| native.cpp.o | |||
| # carla_plugin_thread.cpp.o \ | |||
| # carla_bridge.cpp.o \ | |||
| # native.cpp.o \ | |||
| # ladspa.cpp.o \ | |||
| # dssi.cpp.o \ | |||
| # lv2.cpp.o \ | |||
| @@ -20,6 +20,7 @@ | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| #if 0 | |||
| struct NativePluginMidiData { | |||
| uint32_t count; | |||
| uint32_t* indexes; | |||
| @@ -30,17 +31,17 @@ struct NativePluginMidiData { | |||
| indexes(nullptr), | |||
| ports(nullptr) {} | |||
| }; | |||
| #endif | |||
| class NativePlugin : public CarlaPlugin | |||
| { | |||
| public: | |||
| NativePlugin(CarlaEngine* const engine, const unsigned short id) | |||
| NativePlugin(CarlaEngine* const engine, const int id) | |||
| : CarlaPlugin(engine, id) | |||
| { | |||
| qDebug("NativePlugin::NativePlugin()"); | |||
| m_type = PLUGIN_INTERNAL; | |||
| #if 0 | |||
| descriptor = nullptr; | |||
| handle = h2 = nullptr; | |||
| @@ -57,8 +58,10 @@ public: | |||
| midiEventCount = 0; | |||
| memset(midiEvents, 0, sizeof(::MidiEvent) * MAX_MIDI_EVENTS * 2); | |||
| #endif | |||
| } | |||
| #if 0 | |||
| ~NativePlugin() | |||
| { | |||
| qDebug("NativePlugin::~NativePlugin()"); | |||
| @@ -1532,6 +1535,7 @@ public: | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| #endif | |||
| static size_t getPluginCount() | |||
| { | |||
| @@ -1541,6 +1545,7 @@ public: | |||
| static const PluginDescriptor* getPlugin(const size_t index) | |||
| { | |||
| maybeFirstInit(); | |||
| CARLA_ASSERT(index < pluginDescriptors.size()); | |||
| if (index < pluginDescriptors.size()) | |||
| @@ -1563,6 +1568,7 @@ public: | |||
| carla_register_native_plugin_bypass(); | |||
| carla_register_native_plugin_midiSplit(); | |||
| carla_register_native_plugin_midiThrough(); | |||
| carla_register_native_plugin_3BandEQ(); | |||
| carla_register_native_plugin_3BandSplitter(); | |||
| @@ -1573,6 +1579,7 @@ public: | |||
| #endif | |||
| } | |||
| #if 0 | |||
| // ------------------------------------------------------------------- | |||
| bool init(const char* const name, const char* const label) | |||
| @@ -1635,8 +1642,10 @@ public: | |||
| return true; | |||
| } | |||
| #endif | |||
| private: | |||
| #if 0 | |||
| const PluginDescriptor* descriptor; | |||
| PluginHandle handle, h2; | |||
| HostDescriptor host; | |||
| @@ -1648,6 +1657,7 @@ private: | |||
| uint32_t midiEventCount; | |||
| ::MidiEvent midiEvents[MAX_MIDI_EVENTS*2]; | |||
| #endif | |||
| static bool firstInit; | |||
| static std::vector<const PluginDescriptor*> pluginDescriptors; | |||
| @@ -1658,6 +1668,7 @@ std::vector<const PluginDescriptor*> NativePlugin::pluginDescriptors; | |||
| // ----------------------------------------------------------------------- | |||
| #if 0 | |||
| CarlaPlugin* CarlaPlugin::newNative(const initializer& init) | |||
| { | |||
| qDebug("CarlaPlugin::newNative(%p, \"%s\", \"%s\", \"%s\")", init.engine, init.filename, init.name, init.label); | |||
| @@ -1694,6 +1705,7 @@ CarlaPlugin* CarlaPlugin::newNative(const initializer& init) | |||
| return plugin; | |||
| } | |||
| #endif | |||
| // ----------------------------------------------------------------------- | |||
| @@ -9,7 +9,6 @@ include ../Makefile.mk | |||
| # -------------------------------------------------------------- | |||
| # Shared | |||
| LINK_FLAGS += -shared | |||
| LINK_FLAGS += $(shell pkg-config --libs liblo QtGui) | |||
| # -------------------------------------------------------------- | |||
| @@ -52,36 +51,33 @@ endif | |||
| LIBS = ../libcarla_engine.a | |||
| LIBS += ../libcarla_native.a | |||
| LIBS += ../libcarla_plugin.a | |||
| LIBS += ../libcarla_native.a | |||
| OBJS = \ | |||
| carla_standalone.cpp.o | |||
| STATIC = ../libcarla_standalone.a | |||
| TARGET = ../libcarla_standalone.so | |||
| SHARED = ../libcarla_standalone.so | |||
| # -------------------------------------------------------------- | |||
| all: $(TARGET) | |||
| all: | |||
| clean: | |||
| rm -f $(OBJS) $(STATIC) $(TARGET) | |||
| rm -f $(OBJS) $(SHARED) $(STATIC) | |||
| # -------------------------------------------------------------- | |||
| %.cpp.o: %.cpp | |||
| $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
| $(SHARED): $(OBJS) $(LIBS) | |||
| $(CXX) $^ -shared $(LINK_FLAGS) -o $@ | |||
| $(STATIC): $(OBJS) $(LIBS) | |||
| $(AR) rs $@ $^ | |||
| $(TARGET): $(OBJS) $(LIBS) | |||
| $(CXX) $^ $(LINK_FLAGS) -o $@ | |||
| test: $(OBJS) $(LIBS) | |||
| $(CXX) $^ $(LINK_FLAGS) -o $@ | |||
| # -------------------------------------------------------------- | |||
| ../libcarla_engine.a: | |||
| @@ -20,34 +20,38 @@ | |||
| #include "carla_plugin.hpp" | |||
| #include "carla_native.h" | |||
| using CarlaBackend::CarlaEngine; | |||
| using CarlaBackend::CarlaPlugin; | |||
| using CarlaBackend::CallbackFunc; | |||
| using CarlaBackend::EngineOptions; | |||
| #if 0 | |||
| int main(int argc, char* argv[]) | |||
| { | |||
| CARLA_BACKEND_USE_NAMESPACE | |||
| std::printf("%s\n", carla_get_extended_license_text()); | |||
| //std::printf("%s\n", carla_get_extended_license_text()); | |||
| //std::printf("%i\n", carla_get_engine_driver_count()); | |||
| std::printf("%i\n", carla_get_internal_plugin_count()); | |||
| return 0; | |||
| } | |||
| #endif | |||
| using CarlaBackend::CallbackFunc; | |||
| using CarlaBackend::EngineOptions; | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| // Single, standalone engine | |||
| struct CarlaBackendStandalone { | |||
| CarlaEngine* engine; | |||
| CallbackFunc callback; | |||
| EngineOptions options; | |||
| CarlaEngine* engine; | |||
| CarlaString lastError; | |||
| CarlaString procName; | |||
| EngineOptions options; | |||
| bool started; | |||
| CarlaBackendStandalone() | |||
| : engine(nullptr), | |||
| callback(nullptr), | |||
| : callback(nullptr), | |||
| engine(nullptr), | |||
| started(false) {} | |||
| } standalone; | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| @@ -105,6 +109,8 @@ const char* carla_get_extended_license_text() | |||
| return retText; | |||
| } | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| unsigned int carla_get_engine_driver_count() | |||
| { | |||
| qDebug("carla_get_engine_driver_count()"); | |||
| @@ -119,38 +125,34 @@ const char* carla_get_engine_driver_name(unsigned int index) | |||
| return CarlaEngine::getDriverName(index); | |||
| } | |||
| #if 0 | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| unsigned int get_internal_plugin_count() | |||
| unsigned int carla_get_internal_plugin_count() | |||
| { | |||
| qDebug("CarlaBackendStandalone::get_internal_plugin_count()"); | |||
| qDebug("carla_get_internal_plugin_count()"); | |||
| return CarlaBackend::CarlaPlugin::getNativePluginCount(); | |||
| return CarlaPlugin::getNativePluginCount(); | |||
| } | |||
| const PluginInfo* get_internal_plugin_info(unsigned int pluginId) | |||
| const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId) | |||
| { | |||
| qDebug("CarlaBackendStandalone::get_internal_plugin_info(%i)", pluginId); | |||
| qDebug("carla_get_internal_plugin_info(%i)", internalPluginId); | |||
| static PluginInfo info; | |||
| const PluginDescriptor* const nativePlugin = CarlaBackend::CarlaPlugin::getNativePluginDescriptor(pluginId); | |||
| static CarlaNativePluginInfo info; | |||
| CARLA_ASSERT(nativePlugin); | |||
| const PluginDescriptor* const nativePlugin = CarlaPlugin::getNativePluginDescriptor(internalPluginId); | |||
| // as internal plugin, this must never fail | |||
| if (! nativePlugin) | |||
| CARLA_ASSERT(nativePlugin != nullptr); | |||
| if (nativePlugin == nullptr) | |||
| return nullptr; | |||
| info.type = CarlaBackend::PLUGIN_INTERNAL; | |||
| info.category = static_cast<CarlaBackend::PluginCategory>(nativePlugin->category); | |||
| info.category = static_cast<CarlaPluginCategory>(nativePlugin->category); | |||
| info.hints = 0x0; | |||
| info.name = nativePlugin->name; | |||
| info.label = nativePlugin->label; | |||
| info.maker = nativePlugin->maker; | |||
| info.copyright = nativePlugin->copyright; | |||
| if (nativePlugin->hints & PLUGIN_IS_RTSAFE) | |||
| info.hints |= CarlaBackend::PLUGIN_IS_RTSAFE; | |||
| if (nativePlugin->hints & PLUGIN_IS_SYNTH) | |||
| info.hints |= CarlaBackend::PLUGIN_IS_SYNTH; | |||
| if (nativePlugin->hints & PLUGIN_HAS_GUI) | |||
| @@ -158,9 +160,20 @@ const PluginInfo* get_internal_plugin_info(unsigned int pluginId) | |||
| if (nativePlugin->hints & PLUGIN_USES_SINGLE_THREAD) | |||
| info.hints |= CarlaBackend::PLUGIN_USES_SINGLE_THREAD; | |||
| info.audioIns = nativePlugin->audioIns; | |||
| info.audioOuts = nativePlugin->audioOuts; | |||
| info.midiIns = nativePlugin->midiIns; | |||
| info.midiOuts = nativePlugin->midiOuts; | |||
| info.parameterIns = nativePlugin->parameterIns; | |||
| info.parameterOuts = nativePlugin->parameterOuts; | |||
| info.name = nativePlugin->name; | |||
| info.label = nativePlugin->label; | |||
| info.maker = nativePlugin->maker; | |||
| info.copyright = nativePlugin->copyright; | |||
| return &info; | |||
| } | |||
| #endif | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| @@ -190,19 +203,20 @@ bool carla_engine_init(const char* driverName, const char* clientName) | |||
| standalone.engine->setCallback(standalone.callback, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PROCESS_MODE, standalone.options.processMode, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_MAX_PARAMETERS, standalone.options.maxParameters, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_BUFFER_SIZE, standalone.options.preferredBufferSize, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_SAMPLE_RATE, standalone.options.preferredSampleRate, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_FORCE_STEREO, standalone.options.forceStereo, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_USE_DSSI_VST_CHUNKS, standalone.options.useDssiVstChunks, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFER_PLUGIN_BRIDGES, standalone.options.preferPluginBridges, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFER_UI_BRIDGES, standalone.options.preferUiBridges, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_OSC_UI_TIMEOUT, standalone.options.oscUiTimeout, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX32, 0, standalone.options.bridge_posix32); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX64, 0, standalone.options.bridge_posix64); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_WIN32, 0, standalone.options.bridge_win32); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_WIN64, 0, standalone.options.bridge_win64); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PROCESS_MODE, standalone.options.processMode, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_FORCE_STEREO, standalone.options.forceStereo, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFER_PLUGIN_BRIDGES, standalone.options.preferPluginBridges, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFER_UI_BRIDGES, standalone.options.preferUiBridges, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_USE_DSSI_VST_CHUNKS, standalone.options.useDssiVstChunks, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_MAX_PARAMETERS, standalone.options.maxParameters, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_BUFFER_SIZE, standalone.options.preferredBufferSize, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_SAMPLE_RATE, standalone.options.preferredSampleRate, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_OSC_UI_TIMEOUT, standalone.options.oscUiTimeout, nullptr); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_NATIVE, 0, standalone.options.bridge_native); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX32, 0, standalone.options.bridge_posix32); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX64, 0, standalone.options.bridge_posix64); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_WIN32, 0, standalone.options.bridge_win32); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_WIN64, 0, standalone.options.bridge_win64); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_LV2_GTK2, 0, standalone.options.bridge_lv2gtk2); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_LV2_GTK3, 0, standalone.options.bridge_lv2gtk3); | |||
| standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_LV2_QT4, 0, standalone.options.bridge_lv2qt4); | |||
| @@ -571,10 +571,12 @@ def checkPluginSFZ(filename, tool): | |||
| c_enum = c_int | |||
| c_nullptr = None | |||
| if kIs64bit: | |||
| c_uintptr = c_uint64 | |||
| else: | |||
| c_uintptr = c_uint32 | |||
| #if kIs64bit: | |||
| #c_uintptr = c_uint64 | |||
| #else: | |||
| #c_uintptr = c_uint32 | |||
| CallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_int, c_int, c_int, c_double, c_char_p) | |||
| class ParameterData(Structure): | |||
| _fields_ = [ | |||
| @@ -600,7 +602,7 @@ class MidiProgramData(Structure): | |||
| _fields_ = [ | |||
| ("bank", c_uint32), | |||
| ("program", c_uint32), | |||
| ("label", c_char_p) | |||
| ("name", c_char_p) | |||
| ] | |||
| class CustomData(Structure): | |||
| @@ -610,7 +612,10 @@ class CustomData(Structure): | |||
| ("value", c_char_p) | |||
| ] | |||
| class PluginInfo(Structure): | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Standalone C++ -> Python variables | |||
| class CarlaPluginInfo(Structure): | |||
| _fields_ = [ | |||
| ("type", c_enum), | |||
| ("category", c_enum), | |||
| @@ -623,14 +628,31 @@ class PluginInfo(Structure): | |||
| ("uniqueId", c_long) | |||
| ] | |||
| class PortCountInfo(Structure): | |||
| class CarlaNativePluginInfo(Structure): | |||
| _fields_ = [ | |||
| ("category", c_enum), | |||
| ("hints", c_uint), | |||
| ("audioIns", c_uint32), | |||
| ("audioOuts", c_uint32), | |||
| ("midiIns", c_uint32), | |||
| ("midiOuts", c_uint32), | |||
| ("parameterIns", c_uint32), | |||
| ("parameterOuts", c_uint32), | |||
| ("binary", c_char_p), | |||
| ("name", c_char_p), | |||
| ("label", c_char_p), | |||
| ("maker", c_char_p), | |||
| ("copyright", c_char_p) | |||
| ] | |||
| class CarlaPortCountInfo(Structure): | |||
| _fields_ = [ | |||
| ("ins", c_uint32), | |||
| ("outs", c_uint32), | |||
| ("total", c_uint32) | |||
| ] | |||
| class ParameterInfo(Structure): | |||
| class CarlaParameterInfo(Structure): | |||
| _fields_ = [ | |||
| ("name", c_char_p), | |||
| ("symbol", c_char_p), | |||
| @@ -638,16 +660,14 @@ class ParameterInfo(Structure): | |||
| ("scalePointCount", c_uint32) | |||
| ] | |||
| class ScalePointInfo(Structure): | |||
| class CarlaScalePointInfo(Structure): | |||
| _fields_ = [ | |||
| ("value", c_double), | |||
| ("label", c_char_p) | |||
| ] | |||
| CallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_int, c_int, c_int, c_double, c_char_p) | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Backend C++ -> Python object | |||
| # Standalone Python object | |||
| class Host(object): | |||
| def __init__(self, lib_prefix_arg): | |||
| @@ -673,11 +693,11 @@ class Host(object): | |||
| self.lib.carla_get_engine_driver_name.argtypes = [c_uint] | |||
| self.lib.carla_get_engine_driver_name.restype = c_char_p | |||
| #self.lib.get_internal_plugin_count.argtypes = None | |||
| #self.lib.get_internal_plugin_count.restype = c_uint | |||
| self.lib.carla_get_internal_plugin_count.argtypes = None | |||
| self.lib.carla_get_internal_plugin_count.restype = c_uint | |||
| #self.lib.get_internal_plugin_info.argtypes = [c_uint] | |||
| #self.lib.get_internal_plugin_info.restype = POINTER(PluginInfo) | |||
| self.lib.carla_get_internal_plugin_info.argtypes = [c_uint] | |||
| self.lib.carla_get_internal_plugin_info.restype = POINTER(CarlaNativePluginInfo) | |||
| self.lib.carla_engine_init.argtypes = [c_char_p, c_char_p] | |||
| self.lib.carla_engine_init.restype = c_bool | |||
| @@ -859,11 +879,11 @@ class Host(object): | |||
| def get_engine_driver_name(self, index): | |||
| return self.lib.carla_get_engine_driver_name(index) | |||
| #def get_internal_plugin_count(self): | |||
| #return self.lib.get_internal_plugin_count() | |||
| def get_internal_plugin_count(self): | |||
| return self.lib.carla_get_internal_plugin_count() | |||
| #def get_internal_plugin_info(self, index): | |||
| #return structToDict(self.lib.get_internal_plugin_info(index).contents) | |||
| def get_internal_plugin_info(self, internalPluginId): | |||
| return structToDict(self.lib.carla_get_internal_plugin_info(internalPluginId).contents) | |||
| def engine_init(self, driverName, clientName): | |||
| return self.lib.carla_engine_init(driverName.encode("utf-8"), clientName.encode("utf-8")) | |||
| @@ -1038,3 +1058,18 @@ class Host(object): | |||
| #self.lib.nsm_reply_save() | |||
| Carla.host = Host(None) | |||
| # Test available drivers | |||
| driverCount = Carla.host.get_engine_driver_count() | |||
| driverList = [] | |||
| for i in range(driverCount): | |||
| driver = cString(Carla.host.get_engine_driver_name(i)) | |||
| if driver: | |||
| driverList.append(driver) | |||
| print(i, driver) | |||
| # Test available internal plugins | |||
| pluginCount = Carla.host.get_internal_plugin_count() | |||
| for i in range(pluginCount): | |||
| plugin = Carla.host.get_internal_plugin_info(i) | |||
| print(plugin) | |||
| @@ -211,6 +211,18 @@ PLUGIN_CAN_VOLUME = 0x200 | |||
| PLUGIN_CAN_BALANCE = 0x400 | |||
| PLUGIN_CAN_FORCE_STEREO = 0x800 | |||
| # Plugin Options | |||
| PLUGIN_OPTION_FIXED_BUFFER = 0x001 | |||
| PLUGIN_OPTION_FORCE_STEREO = 0x002 | |||
| PLUGIN_OPTION_SELF_AUTOMATION = 0x004 | |||
| PLUGIN_OPTION_USE_CHUNKS = 0x008 | |||
| PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x010 | |||
| PLUGIN_OPTION_SEND_NOTE_OFF_VELO = 0x020 | |||
| PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH = 0x040 | |||
| PLUGIN_OPTION_SEND_PITCHBEND = 0x080 | |||
| PLUGIN_OPTION_VST_SUPPLY_IDLE = 0x100 | |||
| PLUGIN_OPTION_VST_UPDATE_DISPLAY = 0x200 | |||
| # Parameter Hints | |||
| PARAMETER_IS_BOOLEAN = 0x01 | |||
| PARAMETER_IS_INTEGER = 0x02 | |||
| @@ -223,9 +235,9 @@ PARAMETER_USES_CUSTOM_TEXT = 0x80 | |||
| # FIXME | |||
| # Custom Data types | |||
| CUSTOM_DATA_INVALID = None | |||
| CUSTOM_DATA_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk" | |||
| CUSTOM_DATA_STRING = "http://kxstudio.sf.net/ns/carla/string" | |||
| #CUSTOM_DATA_INVALID = None | |||
| #CUSTOM_DATA_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk" | |||
| #CUSTOM_DATA_STRING = "http://kxstudio.sf.net/ns/carla/string" | |||
| # Binary Type | |||
| BINARY_NONE = 0 | |||
| @@ -274,34 +286,34 @@ PARAMETER_VOLUME = -4 | |||
| PARAMETER_BALANCE_LEFT = -5 | |||
| PARAMETER_BALANCE_RIGHT = -6 | |||
| PARAMETER_PANNING = -7 | |||
| PARAMETER_MAX = -8 | |||
| # Options Type | |||
| OPTION_PROCESS_NAME = 0 | |||
| OPTION_PROCESS_MODE = 1 | |||
| OPTION_PROCESS_HIGH_PRECISION = 2 | |||
| OPTION_FORCE_STEREO = 3 | |||
| OPTION_PREFER_PLUGIN_BRIDGES = 4 | |||
| OPTION_PREFER_UI_BRIDGES = 5 | |||
| OPTION_USE_DSSI_VST_CHUNKS = 6 | |||
| OPTION_MAX_PARAMETERS = 7 | |||
| OPTION_OSC_UI_TIMEOUT = 8 | |||
| OPTION_PREFERRED_BUFFER_SIZE = 9 | |||
| OPTION_PREFERRED_SAMPLE_RATE = 10 | |||
| OPTION_PATH_BRIDGE_NATIVE = 11 | |||
| OPTION_PATH_BRIDGE_POSIX32 = 12 | |||
| OPTION_PATH_BRIDGE_POSIX64 = 13 | |||
| OPTION_PATH_BRIDGE_WIN32 = 14 | |||
| OPTION_PATH_BRIDGE_WIN64 = 15 | |||
| OPTION_PATH_BRIDGE_LV2_GTK2 = 16 | |||
| OPTION_PATH_BRIDGE_LV2_GTK3 = 17 | |||
| OPTION_PATH_BRIDGE_LV2_QT4 = 18 | |||
| OPTION_PATH_BRIDGE_LV2_QT5 = 19 | |||
| OPTION_PATH_BRIDGE_LV2_COCOA = 20 | |||
| OPTION_PATH_BRIDGE_LV2_WINDOWS = 21 | |||
| OPTION_PATH_BRIDGE_LV2_X11 = 22 | |||
| OPTION_PATH_BRIDGE_VST_COCOA = 23 | |||
| OPTION_PATH_BRIDGE_VST_HWND = 24 | |||
| OPTION_PATH_BRIDGE_VST_X11 = 25 | |||
| OPTION_FORCE_STEREO = 2 | |||
| OPTION_PREFER_PLUGIN_BRIDGES = 3 | |||
| OPTION_PREFER_UI_BRIDGES = 4 | |||
| OPTION_USE_DSSI_VST_CHUNKS = 5 | |||
| OPTION_MAX_PARAMETERS = 6 | |||
| OPTION_OSC_UI_TIMEOUT = 7 | |||
| OPTION_PREFERRED_BUFFER_SIZE = 8 | |||
| OPTION_PREFERRED_SAMPLE_RATE = 9 | |||
| OPTION_PATH_BRIDGE_NATIVE = 10 | |||
| OPTION_PATH_BRIDGE_POSIX32 = 11 | |||
| OPTION_PATH_BRIDGE_POSIX64 = 12 | |||
| OPTION_PATH_BRIDGE_WIN32 = 13 | |||
| OPTION_PATH_BRIDGE_WIN64 = 14 | |||
| OPTION_PATH_BRIDGE_LV2_GTK2 = 15 | |||
| OPTION_PATH_BRIDGE_LV2_GTK3 = 16 | |||
| OPTION_PATH_BRIDGE_LV2_QT4 = 17 | |||
| OPTION_PATH_BRIDGE_LV2_QT5 = 18 | |||
| OPTION_PATH_BRIDGE_LV2_COCOA = 19 | |||
| OPTION_PATH_BRIDGE_LV2_WINDOWS = 20 | |||
| OPTION_PATH_BRIDGE_LV2_X11 = 21 | |||
| OPTION_PATH_BRIDGE_VST_COCOA = 22 | |||
| OPTION_PATH_BRIDGE_VST_HWND = 23 | |||
| OPTION_PATH_BRIDGE_VST_X11 = 24 | |||
| # Callback Type | |||
| CALLBACK_DEBUG = 0 | |||
| @@ -386,7 +398,7 @@ CarlaStateParameter = { | |||
| } | |||
| CarlaStateCustomData = { | |||
| 'type': CUSTOM_DATA_INVALID, | |||
| 'type': None, #CUSTOM_DATA_INVALID, | |||
| 'key': "", | |||
| 'value': "" | |||
| } | |||