Browse Source

Fix showing engine device settings

Signed-off-by: falkTX <falktx@falktx.com>
pull/1780/head
falkTX 1 year ago
parent
commit
96db6d8ef5
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 12 additions and 16 deletions
  1. +3
    -3
      source/backend/CarlaStandalone.cpp
  2. +3
    -3
      source/backend/engine/CarlaEngine.cpp
  3. +6
    -10
      source/backend/engine/CarlaEngineJuce.cpp

+ 3
- 3
source/backend/CarlaStandalone.cpp View File

@@ -169,9 +169,9 @@ const EngineDriverDeviceInfo* carla_get_engine_driver_device_info(uint index, co


if (const EngineDriverDeviceInfo* const devInfo = CarlaEngine::getDriverDeviceInfo(index, name)) if (const EngineDriverDeviceInfo* const devInfo = CarlaEngine::getDriverDeviceInfo(index, name))
{ {
retDevInfo.hints = devInfo->hints;
retDevInfo.bufferSizes = (devInfo->bufferSizes != nullptr) ? devInfo->bufferSizes : nullBufferSizes;
retDevInfo.sampleRates = (devInfo->sampleRates != nullptr) ? devInfo->sampleRates : nullSampleRates;
retDevInfo.hints = devInfo->hints;
retDevInfo.bufferSizes = devInfo->bufferSizes != nullptr ? devInfo->bufferSizes : nullBufferSizes;
retDevInfo.sampleRates = devInfo->sampleRates != nullptr ? devInfo->sampleRates : nullSampleRates;
} }
else else
{ {


+ 3
- 3
source/backend/engine/CarlaEngine.cpp View File

@@ -224,8 +224,8 @@ const EngineDriverDeviceInfo* CarlaEngine::getDriverDeviceInfo(const uint index,
devInfo.sampleRates = nullptr; devInfo.sampleRates = nullptr;
return &devInfo; return &devInfo;
} }
--index2;
} }
--index2;
#endif #endif


#ifdef USING_JUCE_AUDIO_DEVICES #ifdef USING_JUCE_AUDIO_DEVICES
@@ -260,7 +260,7 @@ const EngineDriverDeviceInfo* CarlaEngine::getDriverDeviceInfo(const uint index,
--index2; --index2;
#endif #endif


carla_stderr("CarlaEngine::getDriverDeviceInfo(%u, \"%s\") - invalid index %u", index, index2, deviceName);
carla_stderr("CarlaEngine::getDriverDeviceInfo(%u, \"%s\") - invalid index %u", index, deviceName, index2);
return nullptr; return nullptr;
} }


@@ -304,7 +304,7 @@ bool CarlaEngine::showDriverDeviceControlPanel(const uint index, const char* con
--index2; --index2;
#endif #endif


carla_stderr("CarlaEngine::showDriverDeviceControlPanel(%u, \"%s\") - invalid index %u", index, index2, deviceName);
carla_stderr("CarlaEngine::showDriverDeviceControlPanel(%u, \"%s\") - invalid index %u", index, deviceName, index2);
return false; return false;
} }




+ 6
- 10
source/backend/engine/CarlaEngineJuce.cpp View File

@@ -1007,8 +1007,7 @@ const char* getJuceApiName(const uint uindex)
{ {
initJuceDevicesIfNeeded(); initJuceDevicesIfNeeded();


const int index(static_cast<int>(uindex));

const int index = static_cast<int>(uindex);
CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr);


juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]);
@@ -1021,8 +1020,7 @@ const char* const* getJuceApiDeviceNames(const uint uindex)
{ {
initJuceDevicesIfNeeded(); initJuceDevicesIfNeeded();


const int index(static_cast<int>(uindex));

const int index = static_cast<int>(uindex);
CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr);


juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]);
@@ -1050,8 +1048,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c
{ {
initJuceDevicesIfNeeded(); initJuceDevicesIfNeeded();


const int index(static_cast<int>(uindex));

const int index = static_cast<int>(uindex);
CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr);


juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]);
@@ -1088,7 +1085,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c
devInfo.hints |= ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL; devInfo.hints |= ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL;


juce::Array<int> juceBufferSizes = device->getAvailableBufferSizes(); juce::Array<int> juceBufferSizes = device->getAvailableBufferSizes();
if (int bufferSizesCount = juceBufferSizes.size())
if (const int bufferSizesCount = juceBufferSizes.size())
{ {
uint32_t* const bufferSizes(new uint32_t[bufferSizesCount+1]); uint32_t* const bufferSizes(new uint32_t[bufferSizesCount+1]);


@@ -1104,7 +1101,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c
} }


juce::Array<double> juceSampleRates = device->getAvailableSampleRates(); juce::Array<double> juceSampleRates = device->getAvailableSampleRates();
if (int sampleRatesCount = juceSampleRates.size())
if (const int sampleRatesCount = juceSampleRates.size())
{ {
double* const sampleRates(new double[sampleRatesCount+1]); double* const sampleRates(new double[sampleRatesCount+1]);


@@ -1124,8 +1121,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c


bool showJuceDeviceControlPanel(const uint uindex, const char* const deviceName) bool showJuceDeviceControlPanel(const uint uindex, const char* const deviceName)
{ {
const int index(static_cast<int>(uindex));

const int index = static_cast<int>(uindex);
CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), false); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), false);


juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]);


Loading…
Cancel
Save