fixed the last remaining compiler warning in this file
This commit is contained in:
parent
8d15994159
commit
2607d43af5
1 changed files with 18 additions and 10 deletions
|
@ -142,17 +142,29 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector<short>& psData, void* ar
|
||||||
UInt32 iPropertySize;
|
UInt32 iPropertySize;
|
||||||
AudioObjectPropertyAddress stPropertyAddress;
|
AudioObjectPropertyAddress stPropertyAddress;
|
||||||
|
|
||||||
|
stPropertyAddress.mScope = kAudioObjectPropertyScopeGlobal;
|
||||||
|
stPropertyAddress.mElement = kAudioObjectPropertyElementMaster;
|
||||||
|
|
||||||
// first get property size of devices array and allocate memory
|
// first get property size of devices array and allocate memory
|
||||||
AudioHardwareGetPropertyInfo ( kAudioHardwarePropertyDevices,
|
stPropertyAddress.mSelector = kAudioHardwarePropertyDevices;
|
||||||
&iPropertySize,
|
|
||||||
NULL );
|
AudioObjectGetPropertyDataSize ( kAudioObjectSystemObject,
|
||||||
|
&stPropertyAddress,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
&iPropertySize );
|
||||||
|
|
||||||
AudioDeviceID* audioDevices = (AudioDeviceID*) malloc ( iPropertySize );
|
AudioDeviceID* audioDevices = (AudioDeviceID*) malloc ( iPropertySize );
|
||||||
|
|
||||||
// now actually query all devices present in the system
|
// now actually query all devices present in the system
|
||||||
AudioHardwareGetProperty ( kAudioHardwarePropertyDevices,
|
stPropertyAddress.mSelector = kAudioHardwarePropertyDevices;
|
||||||
&iPropertySize,
|
|
||||||
audioDevices );
|
AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
||||||
|
&stPropertyAddress,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
&iPropertySize,
|
||||||
|
audioDevices );
|
||||||
|
|
||||||
// calculate device count based on size of returned data array
|
// calculate device count based on size of returned data array
|
||||||
const UInt32 deviceCount = ( iPropertySize / sizeof ( AudioDeviceID ) );
|
const UInt32 deviceCount = ( iPropertySize / sizeof ( AudioDeviceID ) );
|
||||||
|
@ -163,8 +175,6 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector<short>& psData, void* ar
|
||||||
|
|
||||||
iPropertySize = sizeof ( AudioDeviceID );
|
iPropertySize = sizeof ( AudioDeviceID );
|
||||||
stPropertyAddress.mSelector = kAudioHardwarePropertyDefaultInputDevice;
|
stPropertyAddress.mSelector = kAudioHardwarePropertyDefaultInputDevice;
|
||||||
stPropertyAddress.mScope = kAudioObjectPropertyScopeGlobal;
|
|
||||||
stPropertyAddress.mElement = kAudioObjectPropertyElementMaster;
|
|
||||||
|
|
||||||
if ( AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
if ( AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
||||||
&stPropertyAddress,
|
&stPropertyAddress,
|
||||||
|
@ -179,8 +189,6 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector<short>& psData, void* ar
|
||||||
|
|
||||||
iPropertySize = sizeof ( AudioDeviceID );
|
iPropertySize = sizeof ( AudioDeviceID );
|
||||||
stPropertyAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
|
stPropertyAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
|
||||||
stPropertyAddress.mScope = kAudioObjectPropertyScopeGlobal;
|
|
||||||
stPropertyAddress.mElement = kAudioObjectPropertyElementMaster;
|
|
||||||
|
|
||||||
if ( AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
if ( AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
||||||
&stPropertyAddress,
|
&stPropertyAddress,
|
||||||
|
|
Loading…
Reference in a new issue