| @@ -581,6 +581,7 @@ void CarlaEngine::ProtectedData::close() | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| #ifndef BUILD_BRIDGE | |||||
| void CarlaEngine::ProtectedData::doPluginRemove() noexcept | void CarlaEngine::ProtectedData::doPluginRemove() noexcept | ||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(curPluginCount > 0,); | CARLA_SAFE_ASSERT_RETURN(curPluginCount > 0,); | ||||
| @@ -634,6 +635,7 @@ void CarlaEngine::ProtectedData::doPluginsSwitch() noexcept | |||||
| plugins[idB].plugin = tmp; | plugins[idB].plugin = tmp; | ||||
| #endif | #endif | ||||
| } | } | ||||
| #endif | |||||
| void CarlaEngine::ProtectedData::doNextPluginAction(const bool unlock) noexcept | void CarlaEngine::ProtectedData::doNextPluginAction(const bool unlock) noexcept | ||||
| { | { | ||||
| @@ -644,12 +646,14 @@ void CarlaEngine::ProtectedData::doNextPluginAction(const bool unlock) noexcept | |||||
| case kEnginePostActionZeroCount: | case kEnginePostActionZeroCount: | ||||
| curPluginCount = 0; | curPluginCount = 0; | ||||
| break; | break; | ||||
| #ifndef BUILD_BRIDGE | |||||
| case kEnginePostActionRemovePlugin: | case kEnginePostActionRemovePlugin: | ||||
| doPluginRemove(); | doPluginRemove(); | ||||
| break; | break; | ||||
| case kEnginePostActionSwitchPlugins: | case kEnginePostActionSwitchPlugins: | ||||
| doPluginsSwitch(); | doPluginsSwitch(); | ||||
| break; | break; | ||||
| #endif | |||||
| } | } | ||||
| nextAction.opcode = kEnginePostActionNull; | nextAction.opcode = kEnginePostActionNull; | ||||
| @@ -378,8 +378,10 @@ struct EngineInternalTime { | |||||
| enum EnginePostAction { | enum EnginePostAction { | ||||
| kEnginePostActionNull, | kEnginePostActionNull, | ||||
| kEnginePostActionZeroCount, | kEnginePostActionZeroCount, | ||||
| #ifndef BUILD_BRIDGE | |||||
| kEnginePostActionRemovePlugin, | kEnginePostActionRemovePlugin, | ||||
| kEnginePostActionSwitchPlugins | kEnginePostActionSwitchPlugins | ||||
| #endif | |||||
| }; | }; | ||||
| struct EngineNextAction { | struct EngineNextAction { | ||||
| @@ -50,31 +50,28 @@ static void initRtAudioAPIsIfNeeded() | |||||
| needsInit = false; | needsInit = false; | ||||
| RtAudio::getCompiledApi(gRtAudioApis); | |||||
| // get APIs in a local var, and pass wanted ones into gRtAudioApis | |||||
| std::vector<RtAudio::Api>::iterator it; | |||||
| std::vector<RtAudio::Api> apis; | |||||
| RtAudio::getCompiledApi(apis); | |||||
| // remove JACK if not available | |||||
| if (! jackbridge_is_ok()) | |||||
| for (std::vector<RtAudio::Api>::iterator it = apis.begin(), end = apis.end(); it != end; ++it) | |||||
| { | { | ||||
| it = std::find(gRtAudioApis.begin(), gRtAudioApis.end(), RtAudio::UNIX_JACK); | |||||
| if (it != gRtAudioApis.end()) gRtAudioApis.erase(it); | |||||
| const RtAudio::Api& api(*it); | |||||
| if (api == RtAudio::LINUX_ALSA) | |||||
| continue; | |||||
| if (api == RtAudio::MACOSX_CORE) | |||||
| continue; | |||||
| if (api == RtAudio::WINDOWS_ASIO) | |||||
| continue; | |||||
| if (api == RtAudio::WINDOWS_DS) | |||||
| continue; | |||||
| if (api == RtAudio::UNIX_JACK && ! jackbridge_is_ok()) | |||||
| continue; | |||||
| gRtAudioApis.push_back(api); | |||||
| } | } | ||||
| #ifdef HAVE_JUCE | |||||
| // prefer juce to handle some APIs | |||||
| it = std::find(gRtAudioApis.begin(), gRtAudioApis.end(), RtAudio::LINUX_ALSA); | |||||
| if (it != gRtAudioApis.end()) gRtAudioApis.erase(it); | |||||
| it = std::find(gRtAudioApis.begin(), gRtAudioApis.end(), RtAudio::MACOSX_CORE); | |||||
| if (it != gRtAudioApis.end()) gRtAudioApis.erase(it); | |||||
| it = std::find(gRtAudioApis.begin(), gRtAudioApis.end(), RtAudio::WINDOWS_ASIO); | |||||
| if (it != gRtAudioApis.end()) gRtAudioApis.erase(it); | |||||
| it = std::find(gRtAudioApis.begin(), gRtAudioApis.end(), RtAudio::WINDOWS_DS); | |||||
| if (it != gRtAudioApis.end()) gRtAudioApis.erase(it); | |||||
| #endif | |||||
| } | } | ||||
| static const char* getRtAudioApiName(const RtAudio::Api api) noexcept | static const char* getRtAudioApiName(const RtAudio::Api api) noexcept | ||||