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++ )
{
// get device infos for both current devices
QString strDevicName_i;
bool bIsInput_i;
bool bIsOutput_i;
QString strDevicName_j;
bool bIsInput_j;
bool bIsOutput_j;
// TODO GetAudioDeviceInfos ( audioDevices[i],
//for ( UInt32 j = 0; ( j < deviceCount ) && ( j < MAX_NUMBER_SOUND_CARDS - 1 ); j++ ) strDevicName_i,
//{ bIsInput_i,
// if ( i != j ) bIsOutput_i );
// {
//
// }
//}
GetAudioDeviceInfos ( audioDevices[j],
strDevicName_j,
bIsInput_j,
bIsOutput_j );
QString strDevicName; // check if i device is input and j device is output
bool bIsInput; if ( bIsInput_i && bIsOutput_j )
bool bIsOutput; {
strDriverNames[lNumDevs] = "in: " +
strDevicName_i + "/out: " +
strDevicName_j;
GetAudioDeviceInfos ( audioDevices[i], lNumDevs++;
strDevicName, }
bIsInput, }
bIsOutput );
// TEST
if ( bIsInput && bIsOutput )
strDriverNames[lNumDevs] = "in/out";
else if ( !bIsInput && !bIsOutput )
strDriverNames[lNumDevs] = "";
else if ( bIsInput )
strDriverNames[lNumDevs] = "in";
else if ( bIsOutput )
strDriverNames[lNumDevs] = "out";
lNumDevs++;
} }
*/ */
OpenCoreAudio(); OpenCoreAudio();
// init device index as not initialized (invalid) // init device index as not initialized (invalid)