ASIO devices have a preferred buffersize.

pass this value up so it can be used by the engine dialog.
if for some reason the engine dialog still doesn't have a buffersize selected, print an error and try 512 instead of crashing.
This commit is contained in:
Ben Loftis
2015-01-16 17:14:06 -06:00
parent 9b3f3a9fea
commit 05a612b563
5 changed files with 20 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ struct DeviceInfo
std::vector<int> m_AvailableSampleRates;
unsigned int m_MaxInputChannels;
unsigned int m_MaxOutputChannels;
unsigned int m_DefaultBufferSize;
DeviceInfo():
m_DeviceId(-1), m_DeviceName("Unknown"), m_MaxInputChannels(0), m_MaxOutputChannels(0)
@@ -198,6 +199,7 @@ protected:
std::vector<std::string> m_OutputChannels; ///< List of output channel names.
std::vector<int> m_SamplingRates; ///< List of available sampling rates.
std::vector<int> m_BufferSizes; ///< List of available buffer sizes.
int m_DefaultBufferSize; ///soundcard preferred buffer size
int m_CurrentSamplingRate; ///< Currently selected sampling rate.
int m_CurrentBufferSize; ///< Currently selected buffer size.

View File

@@ -118,6 +118,7 @@ WCMRPortAudioDevice::WCMRPortAudioDevice (WCMRPortAudioDeviceManager *pManager,
m_PortAudioStream = NULL;
m_CurrentSamplingRate = DEFAULT_SR;
m_CurrentBufferSize = DEFAULT_BUFFERSIZE;
m_DefaultBufferSize = DEFAULT_BUFFERSIZE;
m_StopRequested = true;
m_pInputData = NULL;
@@ -361,6 +362,7 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
{
std::cout << "API::Device " << m_DeviceName << " Buffers: " << minSize << " " << maxSize << " " << preferredSize << std::endl;
m_DefaultBufferSize = preferredSize;
m_BufferSizes.push_back (preferredSize);
useDefaultBuffers = false;
}