some fixes -> device string enumeration seems to work now

This commit is contained in:
Volker Fischer 2012-01-22 08:00:16 +00:00
parent ae3a8b09de
commit 02c0bcb1ac

View File

@ -113,47 +113,48 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector<short>& psData, void* ar
// 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 Device"; strDriverNames[lNumDevs] = "System Default In/Out Devices";
lNumDevs++; lNumDevs++;
/* /*
// add detected devices (also check for maximum allowed sound cards!) // add detected devices (also check for maximum allowed sound cards!)
//
// we add combined entries for input and output for each device so that we
// do not need two combo boxes in the GUI for input and output (therefore
// all possible combinations are required)
for ( UInt32 i = 0; ( i < deviceCount ) && ( i < MAX_NUMBER_SOUND_CARDS - 1 ); i++ ) for ( UInt32 i = 0; ( i < deviceCount ) && ( i < MAX_NUMBER_SOUND_CARDS - 1 ); i++ )
{ {
for ( UInt32 j = 0; ( j < deviceCount ) && ( j < MAX_NUMBER_SOUND_CARDS - 1 ); j++ )
// TODO {
//for ( UInt32 j = 0; ( j < deviceCount ) && ( j < MAX_NUMBER_SOUND_CARDS - 1 ); j++ ) // get device infos for both current devices
//{ QString strDevicName_i;
// if ( i != j ) bool bIsInput_i;
// { bool bIsOutput_i;
// QString strDevicName_j;
// } bool bIsInput_j;
//} bool bIsOutput_j;
QString strDevicName;
bool bIsInput;
bool bIsOutput;
GetAudioDeviceInfos ( audioDevices[i], GetAudioDeviceInfos ( audioDevices[i],
strDevicName, strDevicName_i,
bIsInput, bIsInput_i,
bIsOutput ); bIsOutput_i );
// TEST GetAudioDeviceInfos ( audioDevices[j],
if ( bIsInput && bIsOutput ) strDevicName_j,
strDriverNames[lNumDevs] = "in/out"; bIsInput_j,
else if ( !bIsInput && !bIsOutput ) bIsOutput_j );
strDriverNames[lNumDevs] = "";
else if ( bIsInput ) // check if i device is input and j device is output
strDriverNames[lNumDevs] = "in"; if ( bIsInput_i && bIsOutput_j )
else if ( bIsOutput ) {
strDriverNames[lNumDevs] = "out"; strDriverNames[lNumDevs] = "in: " +
strDevicName_i + "/out: " +
strDevicName_j;
lNumDevs++; lNumDevs++;
} }
}
}
*/ */
OpenCoreAudio(); OpenCoreAudio();
// init device index as not initialized (invalid) // init device index as not initialized (invalid)