[Summary] In internal Waves backend API, switching sample time from 32 bits to 64 bits.

Conflicts:
	libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.cpp
This commit is contained in:
Valeriy Kamyshniy 2015-02-20 13:48:14 +02:00 committed by Paul Davis
parent 3b5da657af
commit d5e375f784
2 changed files with 66 additions and 4 deletions

View file

@ -266,6 +266,68 @@ WTErr WCMRCoreAudioDevice::UpdateDeviceInfo ()
return retVal;
}
WTErr WCMRCoreAudioDevice::UpdateDeviceId()
{
//Get device count...
UInt32 propSize = 0;
WTErr retVal = eNoErr;
OSStatus osErr = AudioHardwareGetPropertyInfo (kAudioHardwarePropertyDevices, &propSize, NULL);
ASSERT_ERROR(osErr, "AudioHardwareGetProperty 1");
if (WUIsError(osErr))
throw osErr;
size_t numDevices = propSize / sizeof (AudioDeviceID);
AudioDeviceID* deviceIDs = new AudioDeviceID[numDevices];
//retrieve the device IDs
propSize = numDevices * sizeof (AudioDeviceID);
osErr = AudioHardwareGetProperty (kAudioHardwarePropertyDevices, &propSize, deviceIDs);
ASSERT_ERROR(osErr, "Error while getting audio devices: AudioHardwareGetProperty 2");
if (WUIsError(osErr))
throw osErr;
//now add the ones that are not there...
for (size_t deviceIndex = 0; deviceIndex < numDevices; deviceIndex++)
{
DeviceInfo* pDevInfo = 0;
//Get device name and create new DeviceInfo entry
//Get property name size.
osErr = AudioDeviceGetPropertyInfo(deviceIDs[deviceIndex], 0, 0, kAudioDevicePropertyDeviceName, &propSize, NULL);
if (osErr == kAudioHardwareNoError)
{
//Get property: name.
char* deviceName = new char[propSize];
osErr = AudioDeviceGetProperty(deviceIDs[deviceIndex], 0, 0, kAudioDevicePropertyDeviceName, &propSize, deviceName);
if (osErr == kAudioHardwareNoError)
{
if ( (m_DeviceName == deviceName) &&
(m_DeviceID != deviceIDs[deviceIndex]) ) {
m_DeviceID = deviceIDs[deviceIndex];
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::DeviceDebugInfo, (void *)"Current device has changed it's id.");
}
}
else
{
retVal = eCoreAudioFailed;
DEBUG_MSG("Failed to get device name. Device ID: " << m_DeviceID);
}
delete [] deviceName;
}
else
{
retVal = eCoreAudioFailed;
DEBUG_MSG("Failed to get device name prop Info. Device ID: " << m_DeviceID);
}
}
delete [] deviceIDs;
return retVal;
}
//**********************************************************************************************
// WCMRCoreAudioDevice::UpdateDeviceName
//
@ -2232,9 +2294,9 @@ OSStatus WCMRCoreAudioDevice::AudioIOProc(AudioUnitRenderActionFlags * ioAction
//is this an input only device?
if (m_OutputChannels.empty())
AudioCallback (NULL, inNumberFrames, (uint32_t)inTimeStamp->mSampleTime, theStartTime);
AudioCallback (NULL, inNumberFrames, (uint64_t)inTimeStamp->mSampleTime, theStartTime);
else if ((!m_OutputChannels.empty()) && (ioData->mBuffers[0].mNumberChannels == m_OutputChannels.size()))
AudioCallback ((float *)ioData->mBuffers[0].mData, inNumberFrames, (uint32_t)inTimeStamp->mSampleTime, theStartTime);
AudioCallback ((float *)ioData->mBuffers[0].mData, inNumberFrames, (uint64_t)inTimeStamp->mSampleTime, theStartTime);
return retVal;
}
@ -2255,7 +2317,7 @@ OSStatus WCMRCoreAudioDevice::AudioIOProc(AudioUnitRenderActionFlags * ioAction
//! \return true
//!
//**********************************************************************************************
int WCMRCoreAudioDevice::AudioCallback (float *pOutputBuffer, unsigned long framesPerBuffer, uint32_t inSampleTime, uint64_t inCycleStartTime)
int WCMRCoreAudioDevice::AudioCallback (float *pOutputBuffer, unsigned long framesPerBuffer, uint64_t inSampleTime, uint64_t inCycleStartTime)
{
struct WCMRAudioDeviceManagerClient::AudioCallbackData audioCallbackData =
{