@@ -288,36 +288,44 @@ enum OptionsType { | |||
OPTION_RTAUDIO_DEVICE = 13, | |||
#endif | |||
/*! | |||
* Set path to the backend resource files.\n | |||
* Default unset. | |||
* | |||
* \note Must be set for some internal plugins to work! | |||
*/ | |||
OPTION_PATH_RESOURCES = 14, | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Set path to the native plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_NATIVE = 14, | |||
OPTION_PATH_BRIDGE_NATIVE = 15, | |||
/*! | |||
* Set path to the POSIX 32bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_POSIX32 = 15, | |||
OPTION_PATH_BRIDGE_POSIX32 = 16, | |||
/*! | |||
* Set path to the POSIX 64bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_POSIX64 = 16, | |||
OPTION_PATH_BRIDGE_POSIX64 = 17, | |||
/*! | |||
* Set path to the Windows 32bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_WIN32 = 17, | |||
OPTION_PATH_BRIDGE_WIN32 = 18, | |||
/*! | |||
* Set path to the Windows 64bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_WIN64 = 18, | |||
OPTION_PATH_BRIDGE_WIN64 = 19, | |||
#endif | |||
#ifdef WANT_LV2 | |||
@@ -325,43 +333,43 @@ enum OptionsType { | |||
* Set path to the LV2 Gtk2 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_GTK2 = 19, | |||
OPTION_PATH_BRIDGE_LV2_GTK2 = 20, | |||
/*! | |||
* Set path to the LV2 Gtk3 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_GTK3 = 20, | |||
OPTION_PATH_BRIDGE_LV2_GTK3 = 21, | |||
/*! | |||
* Set path to the LV2 Qt4 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_QT4 = 21, | |||
OPTION_PATH_BRIDGE_LV2_QT4 = 22, | |||
/*! | |||
* Set path to the LV2 Qt5 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_QT5 = 22, | |||
OPTION_PATH_BRIDGE_LV2_QT5 = 23, | |||
/*! | |||
* Set path to the LV2 Cocoa UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_COCOA = 23, | |||
OPTION_PATH_BRIDGE_LV2_COCOA = 24, | |||
/*! | |||
* Set path to the LV2 Windows UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_WINDOWS = 24, | |||
OPTION_PATH_BRIDGE_LV2_WINDOWS = 25, | |||
/*! | |||
* Set path to the LV2 X11 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_X11 = 25, | |||
OPTION_PATH_BRIDGE_LV2_X11 = 26, | |||
#endif | |||
#ifdef WANT_VST | |||
@@ -369,19 +377,19 @@ enum OptionsType { | |||
* Set path to the VST Cocoa UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_VST_COCOA = 26, | |||
OPTION_PATH_BRIDGE_VST_COCOA = 27, | |||
/*! | |||
* Set path to the VST HWND UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_VST_HWND = 27, | |||
OPTION_PATH_BRIDGE_VST_HWND = 28, | |||
/*! | |||
* Set path to the VST X11 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_VST_X11 = 28 | |||
OPTION_PATH_BRIDGE_VST_X11 = 29 | |||
#endif | |||
}; | |||
@@ -245,6 +245,8 @@ struct EngineOptions { | |||
CarlaString rtaudioDevice; | |||
#endif | |||
CarlaString resourceDir; | |||
#ifndef BUILD_BRIDGE | |||
CarlaString bridge_native; | |||
CarlaString bridge_posix32; | |||
@@ -149,6 +149,7 @@ typedef struct _TimeInfo { | |||
typedef struct _HostDescriptor { | |||
HostHandle handle; | |||
const char* resource_dir; | |||
const char* ui_name; | |||
uint32_t (*get_buffer_size)(HostHandle handle); | |||
@@ -1628,6 +1628,10 @@ void CarlaEngine::setOption(const OptionsType option, const int value, const cha | |||
break; | |||
#endif | |||
case OPTION_PATH_RESOURCES: | |||
fOptions.resourceDir = valueStr; | |||
break; | |||
#ifndef BUILD_BRIDGE | |||
case OPTION_PATH_BRIDGE_NATIVE: | |||
fOptions.bridge_native = valueStr; | |||
@@ -173,8 +173,10 @@ public: | |||
carla_zeroStruct< ::MidiEvent>(fMidiEvents, MAX_MIDI_EVENTS*2); | |||
fHost.handle = this; | |||
fHost.ui_name = nullptr; | |||
fHost.handle = this; | |||
fHost.resource_dir = carla_strdup((const char*)engine->getOptions().resourceDir); | |||
fHost.ui_name = nullptr; | |||
fHost.get_buffer_size = carla_host_get_buffer_size; | |||
fHost.get_sample_rate = carla_host_get_sample_rate; | |||
fHost.get_time_info = carla_host_get_time_info; | |||
@@ -224,6 +226,12 @@ public: | |||
fDescriptor = nullptr; | |||
} | |||
if (fHost.resource_dir != nullptr) | |||
{ | |||
delete[] fHost.resource_dir; | |||
fHost.resource_dir = nullptr; | |||
} | |||
if (fHost.ui_name != nullptr) | |||
{ | |||
delete[] fHost.ui_name; | |||
@@ -536,6 +536,7 @@ bool carla_engine_init(const char* driverName, const char* clientName) | |||
standalone.engine->setOption(CarlaBackend::OPTION_RTAUDIO_SAMPLE_RATE, static_cast<int>(standalone.options.rtaudioSampleRate), nullptr); | |||
standalone.engine->setOption(CarlaBackend::OPTION_RTAUDIO_DEVICE, 0, (const char*)standalone.options.rtaudioDevice); | |||
# endif | |||
standalone.engine->setOption(CarlaBackend::OPTION_PATH_RESOURCES, 0, (const char*)standalone.options.resourceDir); | |||
standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_NATIVE, 0, (const char*)standalone.options.bridge_native); | |||
standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX32, 0, (const char*)standalone.options.bridge_posix32); | |||
standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX64, 0, (const char*)standalone.options.bridge_posix64); | |||
@@ -729,6 +730,10 @@ void carla_set_engine_option(CarlaOptionsType option, int value, const char* val | |||
break; | |||
#endif | |||
case CarlaBackend::OPTION_PATH_RESOURCES: | |||
standalone.options.resourceDir = valueStr; | |||
break; | |||
#ifndef BUILD_BRIDGE | |||
case CarlaBackend::OPTION_PATH_BRIDGE_NATIVE: | |||
standalone.options.bridge_native = valueStr; | |||
@@ -2317,8 +2317,7 @@ if __name__ == '__main__': | |||
else: | |||
Carla.host.set_engine_option(OPTION_PROCESS_NAME, 0, "carla") | |||
# Change dir to where DLL and resources are | |||
os.chdir(libPath) | |||
Carla.host.set_engine_option(OPTION_PATH_RESOURCES, 0, libPath) | |||
# Set bridge paths | |||
if carla_bridge_native: | |||
@@ -201,21 +201,22 @@ OPTION_JACK_TIMEMASTER = 10 | |||
OPTION_RTAUDIO_BUFFER_SIZE = 11 | |||
OPTION_RTAUDIO_SAMPLE_RATE = 12 | |||
OPTION_RTAUDIO_DEVICE = 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_GTK2 = 19 | |||
OPTION_PATH_BRIDGE_LV2_GTK3 = 20 | |||
OPTION_PATH_BRIDGE_LV2_QT4 = 21 | |||
OPTION_PATH_BRIDGE_LV2_QT5 = 22 | |||
OPTION_PATH_BRIDGE_LV2_COCOA = 23 | |||
OPTION_PATH_BRIDGE_LV2_WINDOWS = 24 | |||
OPTION_PATH_BRIDGE_LV2_X11 = 25 | |||
OPTION_PATH_BRIDGE_VST_COCOA = 26 | |||
OPTION_PATH_BRIDGE_VST_HWND = 27 | |||
OPTION_PATH_BRIDGE_VST_X11 = 28 | |||
OPTION_PATH_RESOURCES = 14 | |||
OPTION_PATH_BRIDGE_NATIVE = 15 | |||
OPTION_PATH_BRIDGE_POSIX32 = 16 | |||
OPTION_PATH_BRIDGE_POSIX64 = 17 | |||
OPTION_PATH_BRIDGE_WIN32 = 18 | |||
OPTION_PATH_BRIDGE_WIN64 = 19 | |||
OPTION_PATH_BRIDGE_LV2_GTK2 = 20 | |||
OPTION_PATH_BRIDGE_LV2_GTK3 = 21 | |||
OPTION_PATH_BRIDGE_LV2_QT4 = 22 | |||
OPTION_PATH_BRIDGE_LV2_QT5 = 23 | |||
OPTION_PATH_BRIDGE_LV2_COCOA = 24 | |||
OPTION_PATH_BRIDGE_LV2_WINDOWS = 25 | |||
OPTION_PATH_BRIDGE_LV2_X11 = 26 | |||
OPTION_PATH_BRIDGE_VST_COCOA = 27 | |||
OPTION_PATH_BRIDGE_VST_HWND = 28 | |||
OPTION_PATH_BRIDGE_VST_X11 = 29 | |||
# Callback Type | |||
CALLBACK_DEBUG = 0 | |||
@@ -232,6 +232,8 @@ const char* OptionsType2Str(const OptionsType& type) | |||
case OPTION_RTAUDIO_DEVICE: | |||
return "OPTION_RTAUDIO_DEVICE"; | |||
#endif | |||
case OPTION_PATH_RESOURCES: | |||
return "OPTION_PATH_RESOURCES"; | |||
#ifndef BUILD_BRIDGE | |||
case OPTION_PATH_BRIDGE_NATIVE: | |||
return "OPTION_PATH_BRIDGE_NATIVE"; | |||