From c854422d31461df604081019186987188b088e21 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 4 Jan 2014 10:45:57 +0000 Subject: [PATCH] General fixing --- source/backend/CarlaEngine.hpp | 6 +- source/backend/engine/CarlaEngineJack.cpp | 6 +- source/backend/standalone/CarlaStandalone.cpp | 2 + source/carla_host.py | 73 +++++++++++++++---- source/modules/juce_core/AppConfig.h | 6 +- 5 files changed, 68 insertions(+), 25 deletions(-) diff --git a/source/backend/CarlaEngine.hpp b/source/backend/CarlaEngine.hpp index 98203a673..c0af769f7 100644 --- a/source/backend/CarlaEngine.hpp +++ b/source/backend/CarlaEngine.hpp @@ -184,10 +184,8 @@ struct EngineMidiEvent { * MIDI data, without channel bit. * If size > kDataSize, dataExt is used. */ - union { - uint8_t data[kDataSize]; - const uint8_t* dataExt; - }; + uint8_t data[kDataSize]; + const uint8_t* dataExt; }; /*! diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index 7b57cd41e..e5c27310f 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -1343,7 +1343,7 @@ protected: ConnectionToId connectionToId(fLastConnectionId++, portIdA, portIdB); fUsedConnections.append(connectionToId); - callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, portIdA, portIdB, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); } else { @@ -1353,7 +1353,7 @@ protected: if (connectionToId.portOut == portIdA && connectionToId.portIn == portIdB) { - callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, 0, connectionToId.id, 0, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connectionToId.id, connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); fUsedConnections.remove(it); break; } @@ -1764,7 +1764,7 @@ private: ConnectionToId connectionToId(fLastConnectionId++, thisPortId, targetPortId); fUsedConnections.append(connectionToId); - callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, thisPortId, targetPortId, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); } jackbridge_free(connections); diff --git a/source/backend/standalone/CarlaStandalone.cpp b/source/backend/standalone/CarlaStandalone.cpp index 69da09f47..1443db3f5 100644 --- a/source/backend/standalone/CarlaStandalone.cpp +++ b/source/backend/standalone/CarlaStandalone.cpp @@ -89,6 +89,8 @@ protected: while ((! shouldExit()) && msgMgr->runDispatchLoopUntil(250)) {} } + + fInitialised = false; } private: diff --git a/source/carla_host.py b/source/carla_host.py index 30ab03735..024280105 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -357,27 +357,74 @@ class HostWindow(QMainWindow): # read settings # bool values - forceStereo = settings.value(CARLA_KEY_ENGINE_FORCE_STEREO, CARLA_DEFAULT_FORCE_STEREO, type=bool) - preferPluginBridges = settings.value(CARLA_KEY_ENGINE_PREFER_PLUGIN_BRIDGES, CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES, type=bool) - preferUiBridges = settings.value(CARLA_KEY_ENGINE_PREFER_UI_BRIDGES, CARLA_DEFAULT_PREFER_UI_BRIDGES, type=bool) - uisAlwaysOnTop = settings.value(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, CARLA_DEFAULT_UIS_ALWAYS_ON_TOP, type=bool) + try: + forceStereo = settings.value(CARLA_KEY_ENGINE_FORCE_STEREO, CARLA_DEFAULT_FORCE_STEREO, type=bool) + except: + forceStereo = CARLA_DEFAULT_FORCE_STEREO + + try: + preferPluginBridges = settings.value(CARLA_KEY_ENGINE_PREFER_PLUGIN_BRIDGES, CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES, type=bool) + except: + preferPluginBridges = CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES + + try: + preferUiBridges = settings.value(CARLA_KEY_ENGINE_PREFER_UI_BRIDGES, CARLA_DEFAULT_PREFER_UI_BRIDGES, type=bool) + except: + preferUiBridges = CARLA_DEFAULT_PREFER_UI_BRIDGES + + try: + uisAlwaysOnTop = settings.value(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, CARLA_DEFAULT_UIS_ALWAYS_ON_TOP, type=bool) + except: + uisAlwaysOnTop = CARLA_DEFAULT_UIS_ALWAYS_ON_TOP # int values - maxParameters = settings.value(CARLA_KEY_ENGINE_MAX_PARAMETERS, CARLA_DEFAULT_MAX_PARAMETERS, type=int) - uiBridgesTimeout = settings.value(CARLA_KEY_ENGINE_UI_BRIDGES_TIMEOUT, CARLA_DEFAULT_UI_BRIDGES_TIMEOUT, type=int) + try: + maxParameters = settings.value(CARLA_KEY_ENGINE_MAX_PARAMETERS, CARLA_DEFAULT_MAX_PARAMETERS, type=int) + except: + maxParameters = CARLA_DEFAULT_MAX_PARAMETERS + + try: + uiBridgesTimeout = settings.value(CARLA_KEY_ENGINE_UI_BRIDGES_TIMEOUT, CARLA_DEFAULT_UI_BRIDGES_TIMEOUT, type=int) + except: + uiBridgesTimeout = CARLA_DEFAULT_UI_BRIDGES_TIMEOUT # enums - processMode = settings.value(CARLA_KEY_ENGINE_PROCESS_MODE, CARLA_DEFAULT_PROCESS_MODE, type=int) - transportMode = settings.value(CARLA_KEY_ENGINE_TRANSPORT_MODE, CARLA_DEFAULT_TRANSPORT_MODE, type=int) + try: + processMode = settings.value(CARLA_KEY_ENGINE_PROCESS_MODE, CARLA_DEFAULT_PROCESS_MODE, type=int) + except: + processMode = CARLA_DEFAULT_PROCESS_MODE + + try: + transportMode = settings.value(CARLA_KEY_ENGINE_TRANSPORT_MODE, CARLA_DEFAULT_TRANSPORT_MODE, type=int) + except: + transportMode = CARLA_DEFAULT_TRANSPORT_MODE # driver name - audioDriver = settings.value(CARLA_KEY_ENGINE_AUDIO_DRIVER, CARLA_DEFAULT_AUDIO_DRIVER, type=str) + try: + audioDriver = settings.value(CARLA_KEY_ENGINE_AUDIO_DRIVER, CARLA_DEFAULT_AUDIO_DRIVER, type=str) + except: + audioDriver = CARLA_DEFAULT_AUDIO_DRIVER # driver options - audioDevice = settings.value("%s%s/Device" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), "", type=str) - audioNumPeriods = settings.value("%s%s/NumPeriods" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), CARLA_DEFAULT_AUDIO_NUM_PERIODS, type=int) - audioBufferSize = settings.value("%s%s/BufferSize" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), CARLA_DEFAULT_AUDIO_BUFFER_SIZE, type=int) - audioSampleRate = settings.value("%s%s/SampleRate" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), CARLA_DEFAULT_AUDIO_SAMPLE_RATE, type=int) + try: + audioDevice = settings.value("%s%s/Device" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), "", type=str) + except: + audioDevice = "" + + try: + audioNumPeriods = settings.value("%s%s/NumPeriods" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), CARLA_DEFAULT_AUDIO_NUM_PERIODS, type=int) + except: + audioNumPeriods = CARLA_DEFAULT_AUDIO_NUM_PERIODS + + try: + audioBufferSize = settings.value("%s%s/BufferSize" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), CARLA_DEFAULT_AUDIO_BUFFER_SIZE, type=int) + except: + audioBufferSize = CARLA_DEFAULT_AUDIO_BUFFER_SIZE + + try: + audioSampleRate = settings.value("%s%s/SampleRate" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, audioDriver), CARLA_DEFAULT_AUDIO_SAMPLE_RATE, type=int) + except: + audioSampleRate = CARLA_DEFAULT_AUDIO_SAMPLE_RATE # ------------------------------------------------------------- # fix things if needed diff --git a/source/modules/juce_core/AppConfig.h b/source/modules/juce_core/AppConfig.h index dc3106f8d..bb02b8e0f 100755 --- a/source/modules/juce_core/AppConfig.h +++ b/source/modules/juce_core/AppConfig.h @@ -17,11 +17,7 @@ Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, but if you define this value, you can override this to force it to be true or false. */ -#if DEBUG - #define JUCE_FORCE_DEBUG 1 -#else - #define JUCE_FORCE_DEBUG 0 -#endif +#define JUCE_FORCE_DEBUG 0 //============================================================================= /** Config: JUCE_LOG_ASSERTIONS