This commit is contained in:
Volker Fischer 2011-10-26 19:58:28 +00:00
parent 6fbe03fa8d
commit 55b9554321

View file

@ -226,38 +226,38 @@ QString CSoundBase::SetDev ( const int iNewDev )
return strReturn; return strReturn;
} }
QVector<QString> CSoundBase::LoadAndInitializeFirstValidDriver() QVector<QString> CSoundBase::LoadAndInitializeFirstValidDriver()
{ {
QVector<QString> vsErrorList; QVector<QString> vsErrorList;
// load and initialize first valid ASIO driver // load and initialize first valid ASIO driver
bool bValidDriverDetected = false; bool bValidDriverDetected = false;
int iCurDriverIdx = 0; int iCurDriverIdx = 0;
// try all available drivers in the system ("lNumDevs" devices) // try all available drivers in the system ("lNumDevs" devices)
while ( !bValidDriverDetected && ( iCurDriverIdx < lNumDevs ) ) while ( !bValidDriverDetected && ( iCurDriverIdx < lNumDevs ) )
{ {
// try to load and initialize current driver, store error message // try to load and initialize current driver, store error message
const QString strCurError = const QString strCurError =
LoadAndInitializeDriver ( iCurDriverIdx ); LoadAndInitializeDriver ( iCurDriverIdx );
vsErrorList.append ( strCurError ); vsErrorList.append ( strCurError );
if ( strCurError.isEmpty() ) if ( strCurError.isEmpty() )
{ {
// initialization was successful // initialization was successful
bValidDriverDetected = true; bValidDriverDetected = true;
// store ID of selected driver // store ID of selected driver
lCurDev = iCurDriverIdx; lCurDev = iCurDriverIdx;
// empty error list shows that init was successful // empty error list shows that init was successful
vsErrorList.clear(); vsErrorList.clear();
} }
// try next driver // try next driver
iCurDriverIdx++; iCurDriverIdx++;
} }
return vsErrorList; return vsErrorList;
} }