move dummy sound card device selection code in base class

This commit is contained in:
Volker Fischer 2010-03-20 12:11:11 +00:00
parent cc6b8a85f8
commit 1345eac823
4 changed files with 23 additions and 34 deletions

View File

@ -66,12 +66,6 @@ public:
virtual void Start();
virtual void Stop();
// not implemented yet, always return one device and default string
int GetNumDev() { return 1; }
QString GetDeviceName ( const int ) { return "wave mapper"; }
QString SetDev ( const int ) { return ""; } // dummy
int GetDev() { return 0; }
// these variables should be protected but cannot since we want
// to access them from the callback function
CVector<short> vecsTmpAudioSndCrdStereo;
@ -102,12 +96,6 @@ public:
CSoundBase ( false, fpNewProcessCallback, pParg ) {}
virtual ~CSound() {}
// not used
int GetNumDev() { return 1; }
QString GetDeviceName ( const int ) { return "wave mapper"; }
QString SetDev ( const int ) { return ""; } // dummy
int GetDev() { return 0; }
// dummy definitions
virtual int Init ( const int iNewPrefMonoBufferSize ) { return CSoundBase::Init ( iNewPrefMonoBufferSize ); }
virtual bool Read ( CVector<short>& ) { printf ( "no sound!" ); return false; }

View File

@ -45,12 +45,6 @@ public:
virtual void Start();
virtual void Stop();
// not implemented yet, always return one device and default string
int GetNumDev() { return 1; }
QString GetDeviceName ( const int ) { return "CoreAudio"; }
QString SetDev ( const int ) { return ""; } // dummy
int GetDev() { return 0; }
// these variables should be protected but cannot since we want
// to access them from the callback function
CVector<short> vecsTmpAudioSndCrdStereo;

View File

@ -46,6 +46,13 @@ public:
virtual int Init ( const int iNewPrefMonoBufferSize );
virtual void Start();
virtual void Stop();
// dummy implementation in base class
virtual int GetNumDev() { return 1; }
virtual QString GetDeviceName ( const int ) { return "Default"; }
virtual QString SetDev ( const int ) { return ""; }
virtual int GetDev() { return 0; }
bool IsRunning() const { return bRun; }
virtual void OpenDriverSetup() {}

View File

@ -64,25 +64,25 @@ public:
virtual void OpenDriverSetup() { ASIOControlPanel(); }
// device selection
int GetNumDev() { return lNumDevs; }
QString GetDeviceName ( const int iDiD ) { return cDriverNames[iDiD]; }
QString SetDev ( const int iNewDev );
int GetDev() { return lCurDev; }
virtual int GetNumDev() { return lNumDevs; }
virtual QString GetDeviceName ( const int iDiD ) { return cDriverNames[iDiD]; }
virtual QString SetDev ( const int iNewDev );
virtual int GetDev() { return lCurDev; }
// channel selection
int GetNumInputChannels() { return static_cast<int> ( lNumInChan ); }
QString GetInputChannelName ( const int iDiD ) { return channelInfosInput[iDiD].name; }
void SetLeftInputChannel ( const int iNewChan );
void SetRightInputChannel ( const int iNewChan );
int GetLeftInputChannel() { return vSelectedInputChannels[0]; }
int GetRightInputChannel() { return vSelectedInputChannels[1]; }
int GetNumInputChannels() { return static_cast<int> ( lNumInChan ); }
QString GetInputChannelName ( const int iDiD ) { return channelInfosInput[iDiD].name; }
void SetLeftInputChannel ( const int iNewChan );
void SetRightInputChannel ( const int iNewChan );
int GetLeftInputChannel() { return vSelectedInputChannels[0]; }
int GetRightInputChannel() { return vSelectedInputChannels[1]; }
int GetNumOutputChannels() { return static_cast<int> ( lNumOutChan ); }
QString GetOutputChannelName ( const int iDiD ) { return channelInfosOutput[iDiD].name; }
void SetLeftOutputChannel ( const int iNewChan );
void SetRightOutputChannel ( const int iNewChan );
int GetLeftOutputChannel() { return vSelectedOutputChannels[0]; }
int GetRightOutputChannel() { return vSelectedOutputChannels[1]; }
int GetNumOutputChannels() { return static_cast<int> ( lNumOutChan ); }
QString GetOutputChannelName ( const int iDiD ) { return channelInfosOutput[iDiD].name; }
void SetLeftOutputChannel ( const int iNewChan );
void SetRightOutputChannel ( const int iNewChan );
int GetLeftOutputChannel() { return vSelectedOutputChannels[0]; }
int GetRightOutputChannel() { return vSelectedOutputChannels[1]; }
protected:
QVector<QString> LoadAndInitializeFirstValidDriver();