www.pudn.com > audioTest.rar > WaveDevice.cpp


// WaveDevice.cpp: implementation of the CWaveDevice class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "WaveDevice.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CWaveDevice::CWaveDevice(UINT nDevice):m_nDevice(nDevice) 
{ 
 
} 
//////////////////////////////////////////////// 
CWaveDevice::CWaveDevice(const CWaveDevice ©) 
{ 
	m_nDevice=copy.GetDevice(); 
} 
CWaveDevice::~CWaveDevice() 
{ 
 
} 
///////////////////////////////////////////////// 
inline UINT CWaveDevice::GetDevice() const 
{ 
	return m_nDevice; 
} 
 
bool CWaveDevice::IsInputFormat(const CWave &wave) 
{ 
	return (waveInOpen( 
		NULL, 
		GetDevice(), 
		&wave.GetFormat(), 
		NULL, 
		NULL, 
		WAVE_FORMAT_QUERY)==MMSYSERR_NOERROR); 
} 
bool CWaveDevice::IsOutputFormat(const CWave& wave) 
{ 
	return (waveOutOpen( 
		NULL, 
		GetDevice(), 
		&wave.GetFormat(), 
		NULL, 
		NULL, 
		WAVE_FORMAT_QUERY)==MMSYSERR_NOERROR); 
} 
 
void CWaveDevice::setSpecializedDevice(UINT t) 
{ 
	m_nDevice=t; 
}