| @@ -245,7 +245,11 @@ else: | |||
| command = [] | |||
| if ARCH in ("win32", "win64"): | |||
| command.append("wine") | |||
| # FIXME win bridges don't work nicely with JACK right now | |||
| #command.append("wine") | |||
| BRIDGE = BRIDGE.replace("%s.exe" % ARCH, "native") | |||
| os.environ["CARLA_BRIDGE_PLUGIN_BINARY_TYPE"] = ARCH | |||
| command.append(BRIDGE) | |||
| command.append(FORMAT) | |||
| @@ -1070,7 +1070,6 @@ uint32_t carla_get_max_plugin_number() | |||
| bool carla_add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, int64_t uniqueId, const void* extraPtr, uint options) | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(label != nullptr /*&& label[0] != '\0'*/, false); | |||
| carla_debug("carla_add_plugin(%i:%s, %i:%s, \"%s\", \"%s\", \"%s\", " P_INT64 ", %p, %u)", btype, CB::BinaryType2Str(btype), ptype, CB::PluginType2Str(ptype), filename, name, label, uniqueId, extraPtr, options); | |||
| if (gStandalone.engine != nullptr) | |||
| @@ -370,7 +370,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, | |||
| CarlaPlugin* plugin = nullptr; | |||
| #ifndef BUILD_BRIDGE | |||
| #ifndef BRIDGE_PLUGIN | |||
| CarlaString bridgeBinary(pData->options.binaryDir); | |||
| if (bridgeBinary.isNotEmpty()) | |||
| @@ -1233,7 +1233,11 @@ void CarlaEngine::setOption(const EngineOption option, const int value, const ch | |||
| break; | |||
| case ENGINE_OPTION_PREFER_PLUGIN_BRIDGES: | |||
| #ifdef BUILD_BRIDGE | |||
| CARLA_SAFE_ASSERT_RETURN(value == 0,); | |||
| #else | |||
| CARLA_SAFE_ASSERT_RETURN(value == 0 || value == 1,); | |||
| #endif | |||
| pData->options.preferPluginBridges = (value != 0); | |||
| break; | |||
| @@ -15,7 +15,7 @@ | |||
| * For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
| */ | |||
| #ifdef BUILD_BRIDGE | |||
| #if defined(BUILD_BRIDGE) && defined(BRIDGE_PLUGIN) | |||
| # error This file should be used under bridge mode | |||
| #endif | |||
| @@ -1172,6 +1172,7 @@ public: | |||
| fShmNonRtClientControl.commitWrite(); | |||
| } | |||
| #ifndef BUILD_BRIDGE | |||
| if (yesNo) | |||
| { | |||
| pData->tryTransient(); | |||
| @@ -1180,6 +1181,7 @@ public: | |||
| { | |||
| pData->transientTryCounter = 0; | |||
| } | |||
| #endif | |||
| } | |||
| void idle() override | |||
| @@ -1462,7 +1464,9 @@ public: | |||
| // ---------------------------------------------------------------------------------------------------- | |||
| // Event Input (System) | |||
| #ifndef BUILD_BRIDGE | |||
| bool allNotesOffSent = false; | |||
| #endif | |||
| for (uint32_t i=0, numEvents=pData->event.portIn->getEventCount(); i < numEvents; ++i) | |||
| { | |||
| @@ -1483,6 +1487,7 @@ public: | |||
| break; | |||
| case kEngineControlEventTypeParameter: | |||
| #ifndef BUILD_BRIDGE | |||
| // Control backend stuff | |||
| if (event.channel == pData->ctrlChannel) | |||
| { | |||
| @@ -1532,7 +1537,7 @@ public: | |||
| break; | |||
| } | |||
| } | |||
| #endif | |||
| fShmRtClientControl.writeOpcode(kPluginBridgeRtClientControlEventParameter); | |||
| fShmRtClientControl.writeUInt(event.time); | |||
| fShmRtClientControl.writeByte(event.channel); | |||
| @@ -1576,11 +1581,13 @@ public: | |||
| case kEngineControlEventTypeAllNotesOff: | |||
| if (pData->options & PLUGIN_OPTION_SEND_ALL_SOUND_OFF) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (event.channel == pData->ctrlChannel && ! allNotesOffSent) | |||
| { | |||
| allNotesOffSent = true; | |||
| sendMidiAllNotesOffToCallback(); | |||
| } | |||
| #endif | |||
| fShmRtClientControl.writeOpcode(kPluginBridgeRtClientControlEventAllNotesOff); | |||
| fShmRtClientControl.writeUInt(event.time); | |||
| @@ -1783,6 +1790,7 @@ public: | |||
| for (uint32_t i=0; i < fInfo.aOuts; ++i) | |||
| FloatVectorOperations::copy(audioOut[i], fShmAudioPool.data + ((i + fInfo.aIns) * frames), static_cast<int>(frames)); | |||
| #ifndef BUILD_BRIDGE | |||
| // -------------------------------------------------------------------------------------------------------- | |||
| // Post-processing (dry/wet, volume and balance) | |||
| @@ -1847,6 +1855,8 @@ public: | |||
| } // End of Post-processing | |||
| #endif // BUILD_BRIDGE | |||
| // -------------------------------------------------------------------------------------------------------- | |||
| pData->singleMutex.unlock(); | |||
| @@ -309,6 +309,20 @@ int main(int argc, char* argv[]) | |||
| if (label[0] == '\0' || std::strcmp(label, "(none)") == 0) | |||
| label = nullptr; | |||
| // --------------------------------------------------------------------- | |||
| // Check binary type | |||
| CarlaBackend::BinaryType btype = CarlaBackend::BINARY_NATIVE; | |||
| if (const char* const binaryTypeStr = std::getenv("CARLA_BRIDGE_PLUGIN_BINARY_TYPE")) | |||
| btype = CarlaBackend::getBinaryTypeFromString(binaryTypeStr); | |||
| if (btype == CarlaBackend::BINARY_NONE) | |||
| { | |||
| carla_stderr("Invalid binary type '%i'", btype); | |||
| return 1; | |||
| } | |||
| // --------------------------------------------------------------------- | |||
| // Check plugin type | |||
| @@ -409,7 +423,7 @@ int main(int argc, char* argv[]) | |||
| int ret; | |||
| if (carla_add_plugin(CarlaBackend::BINARY_NATIVE, itype, filename, name, label, uniqueId, extraStuff, 0x0)) | |||
| if (carla_add_plugin(btype, itype, filename, name, label, uniqueId, extraStuff, 0x0)) | |||
| { | |||
| ret = 0; | |||
| @@ -172,6 +172,7 @@ OBJS_native = \ | |||
| $(OBJDIR)/CarlaEngineBridge.cpp.o \ | |||
| $(OBJDIR)/CarlaPlugin.cpp.o \ | |||
| $(OBJDIR)/CarlaPluginInternal.cpp.o \ | |||
| $(OBJDIR)/CarlaPluginBridge.cpp.o \ | |||
| $(OBJDIR)/CarlaPluginNative.cpp.o \ | |||
| $(OBJDIR)/CarlaPluginLADSPA.cpp.o \ | |||
| $(OBJDIR)/CarlaPluginDSSI.cpp.o \ | |||
| @@ -415,6 +415,38 @@ const char* PatchbayIcon2Str(const PatchbayIcon icon) noexcept | |||
| // ----------------------------------------------------------------------- | |||
| static inline | |||
| BinaryType getBinaryTypeFromString(const char* const ctype) noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(ctype != nullptr && ctype[0] != '\0', BINARY_NONE); | |||
| carla_debug("CarlaBackend::getBinaryTypeFromString(\"%s\")", ctype); | |||
| CarlaString stype(ctype); | |||
| if (stype.isEmpty()) | |||
| return BINARY_NONE; | |||
| stype.toLower(); | |||
| if (stype == "none") | |||
| return BINARY_NONE; | |||
| if (stype == "native") | |||
| return BINARY_NATIVE; | |||
| if (stype == "posix32" || stype == "linux32" || stype == "mac32") | |||
| return BINARY_POSIX32; | |||
| if (stype == "posix64" || stype == "linux64" || stype == "mac64") | |||
| return BINARY_POSIX64; | |||
| if (stype == "win32") | |||
| return BINARY_WIN32; | |||
| if (stype == "win64") | |||
| return BINARY_WIN64; | |||
| carla_stderr("CarlaBackend::getBinaryTypeFromString(\"%s\") - invalid string type", ctype); | |||
| return BINARY_NONE; | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| static inline | |||
| const char* getPluginTypeAsString(const PluginType type) noexcept | |||
| { | |||