moved GetSelCHAndAddCH in the base class

This commit is contained in:
Volker Fischer 2020-05-01 14:21:08 +02:00
parent 166c6fca0e
commit 1c3c2e7315
3 changed files with 25 additions and 26 deletions

View file

@ -97,6 +97,27 @@ protected:
virtual void UnloadCurrentDriver() {} virtual void UnloadCurrentDriver() {}
QVector<QString> LoadAndInitializeFirstValidDriver ( const bool bOpenDriverSetup = false ); QVector<QString> LoadAndInitializeFirstValidDriver ( const bool bOpenDriverSetup = false );
static void GetSelCHAndAddCH ( const int iSelCH, const int iNumInChan,
int& iSelCHOut, int& iSelAddCHOut )
{
// we have a mixed channel setup, definitions:
// - mixed channel setup only for 4 physical inputs:
// SelCH == 4: Ch 0 + Ch 2
// SelCh == 5: Ch 0 + Ch 3
// SelCh == 6: Ch 1 + Ch 2
// SelCh == 7: Ch 1 + Ch 3
if ( iSelCH >= iNumInChan )
{
iSelAddCHOut = ( ( iSelCH - iNumInChan ) % 2 ) + 2;
iSelCHOut = ( iSelCH - iNumInChan ) / 2;
}
else
{
iSelAddCHOut = -1; // set it to an invalid number
iSelCHOut = iSelCH;
}
}
// function pointer to callback function // function pointer to callback function
void (*fpProcessCallback) ( CVector<int16_t>& psData, void* arg ); void (*fpProcessCallback) ( CVector<int16_t>& psData, void* arg );
void* pProcessCallbackArg; void* pProcessCallbackArg;

View file

@ -87,28 +87,6 @@ protected:
bool CheckSampleTypeSupportedForCHMixing ( const ASIOSampleType SamType ); bool CheckSampleTypeSupportedForCHMixing ( const ASIOSampleType SamType );
void ResetChannelMapping(); void ResetChannelMapping();
static void GetSelCHAndAddCH ( const int iSelCH, const int iNumInChan,
int& iSelCHOut, int& iSelAddCHOut )
{
// we have a mixed channel setup
// definitions:
// - mixed channel setup only for 4 physical inputs:
// SelCH == 4: Ch 0 + Ch 2
// SelCh == 5: Ch 0 + Ch 3
// SelCh == 6: Ch 1 + Ch 2
// SelCh == 7: Ch 1 + Ch 3
if ( iSelCH >= iNumInChan )
{
iSelAddCHOut = ( ( iSelCH - iNumInChan ) % 2 ) + 2;
iSelCHOut = ( iSelCH - iNumInChan ) / 2;
}
else
{
iSelAddCHOut = -1;
iSelCHOut = iSelCH;
}
}
int iASIOBufferSizeMono; int iASIOBufferSizeMono;
int iASIOBufferSizeStereo; int iASIOBufferSizeStereo;