Browse Source

Fix #105

tags/1.9.4
falkTX 10 years ago
parent
commit
5dfe6b46cd
3 changed files with 24 additions and 21 deletions
  1. +4
    -0
      source/backend/engine/CarlaEngineInternal.cpp
  2. +2
    -0
      source/backend/engine/CarlaEngineInternal.hpp
  3. +18
    -21
      source/backend/engine/CarlaEngineRtAudio.cpp

+ 4
- 0
source/backend/engine/CarlaEngineInternal.cpp View File

@@ -581,6 +581,7 @@ void CarlaEngine::ProtectedData::close()

// -----------------------------------------------------------------------

#ifndef BUILD_BRIDGE
void CarlaEngine::ProtectedData::doPluginRemove() noexcept
{
CARLA_SAFE_ASSERT_RETURN(curPluginCount > 0,);
@@ -634,6 +635,7 @@ void CarlaEngine::ProtectedData::doPluginsSwitch() noexcept
plugins[idB].plugin = tmp;
#endif
}
#endif

void CarlaEngine::ProtectedData::doNextPluginAction(const bool unlock) noexcept
{
@@ -644,12 +646,14 @@ void CarlaEngine::ProtectedData::doNextPluginAction(const bool unlock) noexcept
case kEnginePostActionZeroCount:
curPluginCount = 0;
break;
#ifndef BUILD_BRIDGE
case kEnginePostActionRemovePlugin:
doPluginRemove();
break;
case kEnginePostActionSwitchPlugins:
doPluginsSwitch();
break;
#endif
}

nextAction.opcode = kEnginePostActionNull;


+ 2
- 0
source/backend/engine/CarlaEngineInternal.hpp View File

@@ -378,8 +378,10 @@ struct EngineInternalTime {
enum EnginePostAction {
kEnginePostActionNull,
kEnginePostActionZeroCount,
#ifndef BUILD_BRIDGE
kEnginePostActionRemovePlugin,
kEnginePostActionSwitchPlugins
#endif
};

struct EngineNextAction {


+ 18
- 21
source/backend/engine/CarlaEngineRtAudio.cpp View File

@@ -50,31 +50,28 @@ static void initRtAudioAPIsIfNeeded()

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


Loading…
Cancel
Save