| @@ -30,7 +30,7 @@ CARLA_BACKEND_START_NAMESPACE | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| // Engine Helpers | |||
| ::QMainWindow* getEngineHostWindow(CarlaEngine* const engine) | |||
| QMainWindow* getEngineHostWindow(CarlaEngine* const engine) | |||
| { | |||
| return CarlaEngineProtectedData::getHostWindow(engine); | |||
| } | |||
| @@ -24,10 +24,6 @@ | |||
| #include "CarlaPlugin.hpp" | |||
| #include "RtList.hpp" | |||
| #ifndef BUILD_BRIDGE | |||
| # include <QtCore/QProcessEnvironment> | |||
| #endif | |||
| class QMainWindow; | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| @@ -72,6 +68,23 @@ const char* EnginePortType2Str(const EnginePortType type) | |||
| return nullptr; | |||
| } | |||
| static inline | |||
| const char* EngineEventType2Str(const EngineEventType type) | |||
| { | |||
| switch (type) | |||
| { | |||
| case kEngineEventTypeNull: | |||
| return "kEngineEventTypeNull"; | |||
| case kEngineEventTypeControl: | |||
| return "kEngineEventTypeControl"; | |||
| case kEngineEventTypeMidi: | |||
| return "kEngineEventTypeMidi"; | |||
| } | |||
| carla_stderr("CarlaBackend::EngineEventType2Str(%i) - invalid type", type); | |||
| return nullptr; | |||
| } | |||
| static inline | |||
| const char* EngineControlEventType2Str(const EngineControlEventType type) | |||
| { | |||
| @@ -111,12 +124,10 @@ struct EnginePluginData { | |||
| float insPeak[CarlaEngine::MAX_PEAKS]; | |||
| float outsPeak[CarlaEngine::MAX_PEAKS]; | |||
| #ifndef QTCREATOR_TEST | |||
| EnginePluginData() | |||
| : plugin(nullptr), | |||
| insPeak{0.0f}, | |||
| outsPeak{0.0f} {} | |||
| #endif | |||
| }; | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| @@ -131,15 +142,11 @@ struct CarlaEngineProtectedData { | |||
| void* callbackPtr; | |||
| CarlaString lastError; | |||
| #ifndef BUILD_BRIDGE | |||
| QProcessEnvironment procEnv; | |||
| QMainWindow* hostWindow; | |||
| #endif | |||
| bool aboutToClose; // don't re-activate thread if true | |||
| unsigned int curPluginCount; // number of plugins loaded (0...max) | |||
| unsigned int maxPluginNumber; // number of plugins allowed (0, 16, 99 or 999) | |||
| unsigned int maxPluginNumber; // number of plugins allowed (0, 16, 99 or 255) | |||
| struct NextAction { | |||
| EnginePostAction opcode; | |||
| @@ -157,6 +164,7 @@ struct CarlaEngineProtectedData { | |||
| } | |||
| } nextAction; | |||
| #ifndef BUILD_BRIDGE | |||
| struct Rack { | |||
| EngineEvent* in; | |||
| EngineEvent* out; | |||
| @@ -174,6 +182,7 @@ struct CarlaEngineProtectedData { | |||
| : playing(false), | |||
| frame(0) {} | |||
| } time; | |||
| #endif | |||
| EnginePluginData* plugins; | |||
| @@ -183,9 +192,7 @@ struct CarlaEngineProtectedData { | |||
| oscData(nullptr), | |||
| callback(nullptr), | |||
| callbackPtr(nullptr), | |||
| #ifndef BUILD_BRIDGE | |||
| hostWindow(nullptr), | |||
| #endif | |||
| aboutToClose(false), | |||
| curPluginCount(0), | |||
| maxPluginNumber(0), | |||
| @@ -195,16 +202,9 @@ struct CarlaEngineProtectedData { | |||
| CarlaEngineProtectedData(CarlaEngineProtectedData&) = delete; | |||
| CarlaEngineProtectedData(const CarlaEngineProtectedData&) = delete; | |||
| static ::QMainWindow* getHostWindow(CarlaEngine* const engine) | |||
| static QMainWindow* getHostWindow(CarlaEngine* const engine) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| return engine->kData->hostWindow; | |||
| #else | |||
| return nullptr; | |||
| // unused | |||
| (void)engine; | |||
| #endif | |||
| } | |||
| #ifndef BUILD_BRIDGE | |||
| @@ -24,6 +24,7 @@ | |||
| #include "jackbridge/jackbridge.h" | |||
| #include <cmath> | |||
| #include <QtCore/QStringList> | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| @@ -34,7 +35,7 @@ CARLA_BACKEND_START_NAMESPACE | |||
| // ------------------------------------------------------------------- | |||
| // Plugin Helpers, defined in CarlaPlugin.cpp | |||
| extern CarlaEngine* CarlaPluginGetEngine(CarlaPlugin* const plugin); | |||
| extern CarlaEngine* CarlaPluginGetEngine(CarlaPlugin* const plugin); | |||
| extern CarlaEngineAudioPort* CarlaPluginGetAudioInPort(CarlaPlugin* const plugin, uint32_t index); | |||
| extern CarlaEngineAudioPort* CarlaPluginGetAudioOutPort(CarlaPlugin* const plugin, uint32_t index); | |||
| @@ -327,8 +327,6 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons | |||
| // Plugin Bridges | |||
| if ((plugin->hints() & PLUGIN_IS_BRIDGE) > 0 && std::strlen(method) > 11 && std::strncmp(method, "bridge_", 7) == 0) | |||
| { | |||
| if (std::strcmp(method+7, "set_peaks") == 0) | |||
| return handleMsgBridgeSetPeaks(plugin, argc, argv, types); | |||
| if (std::strcmp(method+7, "audio_count") == 0) | |||
| return CarlaPluginSetOscBridgeInfo(plugin, kPluginBridgeAudioCount, argc, argv, types); | |||
| if (std::strcmp(method+7, "midi_count") == 0) | |||
| @@ -794,24 +792,6 @@ int CarlaEngineOsc::handleMsgNoteOff(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
| return 0; | |||
| } | |||
| // FIXME - remove once IPC audio is implemented | |||
| int CarlaEngineOsc::handleMsgBridgeSetPeaks(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
| { | |||
| CARLA_ENGINE_OSC_CHECK_OSC_TYPES(4, "ffff"); | |||
| const float in1 = argv[0]->f; | |||
| const float in2 = argv[1]->f; | |||
| const float out1 = argv[2]->f; | |||
| const float out2 = argv[3]->f; | |||
| float const inPeaks[CarlaEngine::MAX_PEAKS] = { in1, in2 }; | |||
| float const outPeaks[CarlaEngine::MAX_PEAKS] = { out1, out2 }; | |||
| kEngine->setPeaks(plugin->id(), inPeaks, outPeaks); | |||
| return 0; | |||
| } | |||
| #endif | |||
| CARLA_BACKEND_END_NAMESPACE | |||
| @@ -136,9 +136,6 @@ private: | |||
| int handleMsgSetMidiProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
| int handleMsgNoteOn(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
| int handleMsgNoteOff(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
| // FIXME - remove once IPC audio is implemented | |||
| int handleMsgBridgeSetPeaks(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
| #endif | |||
| #ifdef WANT_LV2 | |||
| @@ -358,6 +358,8 @@ template <typename T> | |||
| static inline | |||
| void carla_zeroStruct(T& structure, const size_t count) | |||
| { | |||
| CARLA_ASSERT(count > 1); | |||
| std::memset(&structure, 0, sizeof(T)*count); | |||
| } | |||
| @@ -365,6 +367,9 @@ template <typename T> | |||
| static inline | |||
| void carla_zeroStruct(T* const structure, const size_t count) | |||
| { | |||
| CARLA_ASSERT(structure != nullptr); | |||
| CARLA_ASSERT(count > 1); | |||
| std::memset(structure, 0, sizeof(T)*count); | |||
| } | |||