diff --git a/windows/sound.h b/windows/sound.h index e652a03f..49292757 100755 --- a/windows/sound.h +++ b/windows/sound.h @@ -58,8 +58,8 @@ public: virtual void OpenDriverSetup() { ASIOControlPanel(); } // channel selection - virtual int GetNumInputChannels() { return static_cast ( lNumInChan ); } - virtual QString GetInputChannelName ( const int iDiD ) { return channelInfosInput[iDiD].name; } + virtual int GetNumInputChannels() { return static_cast ( lNumInChanPlusAddChan ); } + virtual QString GetInputChannelName ( const int iDiD ) { return channelInputName[iDiD]; } virtual void SetLeftInputChannel ( const int iNewChan ); virtual void SetRightInputChannel ( const int iNewChan ); virtual int GetLeftInputChannel() { return vSelectedInputChannels[0]; } @@ -80,12 +80,36 @@ protected: int GetActualBufferSize ( const int iDesiredBufferSizeMono ); QString CheckDeviceCapabilities(); bool CheckSampleTypeSupported ( const ASIOSampleType SamType ); + 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; long lNumInChan; + long lNumInChanPlusAddChan; // includes additional "added" channels long lNumOutChan; double dInOutLatencyMs; CVector vSelectedInputChannels; @@ -113,6 +137,7 @@ protected: ASIODriverInfo driverInfo; ASIOBufferInfo bufferInfos[2 * MAX_NUM_IN_OUT_CHANNELS]; // for input and output buffers -> "2 *" ASIOChannelInfo channelInfosInput[MAX_NUM_IN_OUT_CHANNELS]; + QString channelInputName[MAX_NUM_IN_OUT_CHANNELS]; ASIOChannelInfo channelInfosOutput[MAX_NUM_IN_OUT_CHANNELS]; bool bASIOPostOutput; ASIOCallbacks asioCallbacks;