fixed two warnings
This commit is contained in:
parent
e674b21c0c
commit
233c34ba45
1 changed files with 21 additions and 7 deletions
|
@ -157,22 +157,36 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector<short>& psData, void* ar
|
||||||
const UInt32 deviceCount = ( iPropertySize / sizeof ( AudioDeviceID ) );
|
const UInt32 deviceCount = ( iPropertySize / sizeof ( AudioDeviceID ) );
|
||||||
|
|
||||||
// always add system default devices for input and output as first entry
|
// always add system default devices for input and output as first entry
|
||||||
lNumDevs = 0;
|
lNumDevs = 0;
|
||||||
strDriverNames[lNumDevs] = "System Default In/Out Devices";
|
strDriverNames[lNumDevs] = "System Default In/Out Devices";
|
||||||
|
|
||||||
iPropertySize = sizeof ( AudioDeviceID );
|
iPropertySize = sizeof ( AudioDeviceID );
|
||||||
if ( AudioHardwareGetProperty ( kAudioHardwarePropertyDefaultInputDevice,
|
AudioObjectPropertyAddress ePropertyInDevAddress = { kAudioHardwarePropertyDefaultInputDevice,
|
||||||
&iPropertySize,
|
kAudioObjectPropertyScopeGlobal,
|
||||||
&audioInputDevice[lNumDevs] ) )
|
kAudioObjectPropertyElementMaster };
|
||||||
|
|
||||||
|
if ( AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
||||||
|
&ePropertyInDevAddress,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
&iPropertySize,
|
||||||
|
&audioInputDevice[lNumDevs] ) )
|
||||||
{
|
{
|
||||||
throw CGenErr ( tr ( "CoreAudio input AudioHardwareGetProperty call failed. "
|
throw CGenErr ( tr ( "CoreAudio input AudioHardwareGetProperty call failed. "
|
||||||
"It seems that no sound card is available in the system." ) );
|
"It seems that no sound card is available in the system." ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
iPropertySize = sizeof ( AudioDeviceID );
|
iPropertySize = sizeof ( AudioDeviceID );
|
||||||
if ( AudioHardwareGetProperty ( kAudioHardwarePropertyDefaultOutputDevice,
|
AudioObjectPropertyAddress ePropertyOutDevAddress = { kAudioHardwarePropertyDefaultOutputDevice,
|
||||||
&iPropertySize,
|
kAudioObjectPropertyScopeGlobal,
|
||||||
&audioOutputDevice[lNumDevs] ) )
|
kAudioObjectPropertyElementMaster };
|
||||||
|
|
||||||
|
if ( AudioObjectGetPropertyData ( kAudioObjectSystemObject,
|
||||||
|
&ePropertyOutDevAddress,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
&iPropertySize,
|
||||||
|
&audioOutputDevice[lNumDevs] ) )
|
||||||
{
|
{
|
||||||
throw CGenErr ( tr ( "CoreAudio output AudioHardwareGetProperty call failed. "
|
throw CGenErr ( tr ( "CoreAudio output AudioHardwareGetProperty call failed. "
|
||||||
"It seems that no sound card is available in the system." ) );
|
"It seems that no sound card is available in the system." ) );
|
||||||
|
|
Loading…
Reference in a new issue