本文整理汇总了C++中AudioDeviceManager::getOutputDeviceIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioDeviceManager::getOutputDeviceIndex方法的具体用法?C++ AudioDeviceManager::getOutputDeviceIndex怎么用?C++ AudioDeviceManager::getOutputDeviceIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioDeviceManager
的用法示例。
在下文中一共展示了AudioDeviceManager::getOutputDeviceIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applySettings
//.........这里部分代码省略.........
reverseAPIKeys.append("demodGain");
}
if ((settings.m_traceLengthMutliplier != m_settings.m_traceLengthMutliplier) || force) {
reverseAPIKeys.append("traceLengthMutliplier");
}
if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
{
reverseAPIKeys.append("rfBandwidth");
m_settingsMutex.lock();
m_interpolator.create(16, m_inputSampleRate, (settings.m_rfBandwidth) / 2.2);
m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_inputSampleRate / (Real) 48000;
//m_phaseDiscri.setFMScaling((float) settings.m_rfBandwidth / (float) settings.m_fmDeviation);
m_settingsMutex.unlock();
}
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || force)
{
reverseAPIKeys.append("fmDeviation");
m_phaseDiscri.setFMScaling(48000.0f / (2.0f*settings.m_fmDeviation));
}
if ((settings.m_squelchGate != m_settings.m_squelchGate) || force)
{
reverseAPIKeys.append("squelchGate");
m_squelchGate = 480 * settings.m_squelchGate; // gate is given in 10s of ms at 48000 Hz audio sample rate
m_squelchCount = 0; // reset squelch open counter
}
if ((settings.m_squelch != m_settings.m_squelch) || force)
{
reverseAPIKeys.append("squelch");
// input is a value in dB
m_squelchLevel = std::pow(10.0, settings.m_squelch / 10.0);
}
if ((settings.m_volume != m_settings.m_volume) || force)
{
reverseAPIKeys.append("volume");
m_dsdDecoder.setAudioGain(settings.m_volume);
}
if ((settings.m_baudRate != m_settings.m_baudRate) || force)
{
reverseAPIKeys.append("baudRate");
m_dsdDecoder.setBaudRate(settings.m_baudRate);
}
if ((settings.m_enableCosineFiltering != m_settings.m_enableCosineFiltering) || force)
{
reverseAPIKeys.append("enableCosineFiltering");
m_dsdDecoder.enableCosineFiltering(settings.m_enableCosineFiltering);
}
if ((settings.m_tdmaStereo != m_settings.m_tdmaStereo) || force)
{
reverseAPIKeys.append("tdmaStereo");
m_dsdDecoder.setTDMAStereo(settings.m_tdmaStereo);
}
if ((settings.m_pllLock != m_settings.m_pllLock) || force)
{
reverseAPIKeys.append("pllLock");
m_dsdDecoder.setSymbolPLLLock(settings.m_pllLock);
}
if ((settings.m_highPassFilter != m_settings.m_highPassFilter) || force)
{
reverseAPIKeys.append("highPassFilter");
m_dsdDecoder.useHPMbelib(settings.m_highPassFilter);
}
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
{
reverseAPIKeys.append("audioDeviceName");
AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager();
int audioDeviceIndex = audioDeviceManager->getOutputDeviceIndex(settings.m_audioDeviceName);
//qDebug("AMDemod::applySettings: audioDeviceName: %s audioDeviceIndex: %d", qPrintable(settings.m_audioDeviceName), audioDeviceIndex);
audioDeviceManager->addAudioSink(&m_audioFifo1, getInputMessageQueue(), audioDeviceIndex);
audioDeviceManager->addAudioSink(&m_audioFifo2, getInputMessageQueue(), audioDeviceIndex);
uint32_t audioSampleRate = audioDeviceManager->getOutputSampleRate(audioDeviceIndex);
if (m_audioSampleRate != audioSampleRate) {
applyAudioSampleRate(audioSampleRate);
}
}
if (settings.m_useReverseAPI)
{
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) ||
(m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex);
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
}
m_settings = settings;
}