for ASIO and 4 channel input, support mixing channels 1&2 with 3&4

This commit is contained in:
Volker Fischer 2018-03-26 15:57:16 +00:00
parent a7454095d3
commit 5d15ca6a23

View file

@ -58,8 +58,8 @@ public:
virtual void OpenDriverSetup() { ASIOControlPanel(); }
// channel selection
virtual int GetNumInputChannels() { return static_cast<int> ( lNumInChan ); }
virtual QString GetInputChannelName ( const int iDiD ) { return channelInfosInput[iDiD].name; }
virtual int GetNumInputChannels() { return static_cast<int> ( 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<int> 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;