diff --git a/mac/sound.cpp b/mac/sound.cpp index 82818d96..f4aa3167 100755 --- a/mac/sound.cpp +++ b/mac/sound.cpp @@ -180,14 +180,14 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector& psData, void* ar lNumDevs++; // next device - // add detected devices (also check for maximum allowed sound cards!) + // add detected devices // // 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++ ) + // all possible combinations are required which can be a large number) + for ( UInt32 i = 0; i < deviceCount; i++ ) { - for ( UInt32 j = 0; ( j < deviceCount ) && ( j < MAX_NUMBER_SOUND_CARDS - 1 ); j++ ) + for ( UInt32 j = 0; j < deviceCount; j++ ) { // get device infos for both current devices QString strDeviceName_i; @@ -207,8 +207,9 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector& psData, void* ar bIsInput_j, bIsOutput_j ); - // check if i device is input and j device is output - if ( bIsInput_i && bIsOutput_j ) + // check if i device is input and j device is output and that we are + // in range + if ( bIsInput_i && bIsOutput_j && ( lNumDevs < MAX_NUMBER_SOUND_CARDS ) ) { strDriverNames[lNumDevs] = "in: " + strDeviceName_i + "/out: " + diff --git a/src/global.h b/src/global.h index 99e73d34..b2785c77 100755 --- a/src/global.h +++ b/src/global.h @@ -149,7 +149,7 @@ LED bar: lbr // maximum number of recognized sound cards installed in the system, // definition for "no device" -#define MAX_NUMBER_SOUND_CARDS 30 +#define MAX_NUMBER_SOUND_CARDS 129 // e.g. 16 inputs, 8 outputs + default entry (MacOS) #define INVALID_SNC_CARD_DEVICE -1 // define the maximum number of audio channel for input/output we can store