diff --git a/src/soundbase.cpp b/src/soundbase.cpp index 032659e3..6169e0d2 100755 --- a/src/soundbase.cpp +++ b/src/soundbase.cpp @@ -31,11 +31,11 @@ CSoundBase::CSoundBase ( const QString& strNewSystemDriverTechniqueName, void (*fpNewProcessCallback) ( CVector& psData, void* pParg ), void* pParg, const int iNewCtrlMIDIChannel ) : - fpProcessCallback ( fpNewProcessCallback ), - pProcessCallbackArg ( pParg ), bRun ( false ), - bIsCallbackAudioInterface ( bNewIsCallbackAudioInterface ), + fpProcessCallback ( fpNewProcessCallback ), + pProcessCallbackArg ( pParg ), bRun ( false ), + bIsCallbackAudioInterface ( bNewIsCallbackAudioInterface ), strSystemDriverTechniqueName ( strNewSystemDriverTechniqueName ), - iCtrlMIDIChannel ( iNewCtrlMIDIChannel ) + iCtrlMIDIChannel ( iNewCtrlMIDIChannel ) { // initializations for the sound card names (default) lNumDevs = 1; diff --git a/src/soundbase.h b/src/soundbase.h index 381648f7..f11d434c 100755 --- a/src/soundbase.h +++ b/src/soundbase.h @@ -97,6 +97,27 @@ protected: virtual void UnloadCurrentDriver() {} QVector 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 void (*fpProcessCallback) ( CVector& psData, void* arg ); void* pProcessCallbackArg; diff --git a/windows/sound.h b/windows/sound.h index 951acfcb..46e078e7 100755 --- a/windows/sound.h +++ b/windows/sound.h @@ -87,28 +87,6 @@ protected: bool CheckSampleTypeSupportedForCHMixing ( const ASIOSampleType SamType ); 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 iASIOBufferSizeStereo;