#ifndef _COMMON_WAVEFORMATEX_HPP_
#define _COMMON_WAVEFORMATEX_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_MMSYSTEM_HPP_
#include <common/mmsystem.hpp>
#endif

class WaveFormatEx :  private tWAVEFORMATEX
{
public:
	WaveFormatEx(void);
	WaveFormatEx(const WaveFormatEx &someWaveFormatEx);
	~WaveFormatEx();
	WaveFormatEx &operator=(const WaveFormatEx &someWaveFormatEx);
	WORD operator==(const WaveFormatEx &someWaveFormatEx)const;
	WORD formatTag(void)const;
	void formatTag(WORD formatTag);
	WORD channels(void)const;
	void channels(WORD channels);
	DWORD samplesPerSecond(void)const;
	void samplesPerSecond(WORD samplesPerSecond);
	DWORD averageBytesPerSecond(void)const;
	void averageBytesPerSecond(WORD averageBytesPerSecond);
	WORD blockAlign(void)const;
	void blockAlign(WORD blockAlign);
	WORD bitsPerSample(void)const;
	void bitsPerSample(WORD bitsPerSample);
	WORD size(void)const;
	void size(WORD size);
private:
};

inline
WaveFormatEx::WaveFormatEx(void)
{
	tWAVEFORMATEX::wFormatTag=0;
	tWAVEFORMATEX::nChannels=0;
	tWAVEFORMATEX::nSamplesPerSec=0;
	tWAVEFORMATEX::nAvgBytesPerSec=0;
	tWAVEFORMATEX::nBlockAlign=0;
	tWAVEFORMATEX::wBitsPerSample=0;
	tWAVEFORMATEX::cbSize=0;
}

inline
WaveFormatEx::WaveFormatEx(const WaveFormatEx &someWaveFormatEx)
{
	*this=someWaveFormatEx;
}

inline
WaveFormatEx::~WaveFormatEx()
{
}

inline
WaveFormatEx &WaveFormatEx::operator=(const WaveFormatEx &someWaveFormatEx)
{
	formatTag(someWaveFormatEx.formatTag());
	channels(someWaveFormatEx.channels());
	samplesPerSecond(someWaveFormatEx.samplesPerSecond());
	averageBytesPerSecond(someWaveFormatEx.averageBytesPerSecond());
	blockAlign(someWaveFormatEx.blockAlign());
	bitsPerSample(someWaveFormatEx.bitsPerSample());
	size(someWaveFormatEx.size());
	return *this;
}

inline
WORD WaveFormatEx::operator==(const WaveFormatEx &someWaveFormatEx)const
{
	return (formatTag()==someWaveFormatEx.formatTag()&&
					channels()==someWaveFormatEx.channels()&&
					samplesPerSecond()==someWaveFormatEx.samplesPerSecond()&&
					averageBytesPerSecond()==someWaveFormatEx.averageBytesPerSecond()&&
					blockAlign()==someWaveFormatEx.blockAlign()&&
					bitsPerSample()==someWaveFormatEx.bitsPerSample()&&
	        size()==someWaveFormatEx.size());
}

inline
WORD WaveFormatEx::formatTag(void)const
{
  return tWAVEFORMATEX::wFormatTag;
}

inline
void WaveFormatEx::formatTag(WORD formatTag)
{
	tWAVEFORMATEX::wFormatTag=formatTag;
}

inline
WORD WaveFormatEx::channels(void)const
{
	return tWAVEFORMATEX::nChannels;
}

inline
void WaveFormatEx::channels(WORD channels)
{
	tWAVEFORMATEX::nChannels=channels;
}

inline
DWORD WaveFormatEx::samplesPerSecond(void)const
{
	return tWAVEFORMATEX::nSamplesPerSec;
}

inline
void WaveFormatEx::samplesPerSecond(WORD samplesPerSecond)
{
	tWAVEFORMATEX::nSamplesPerSec=samplesPerSecond;
}

inline
DWORD WaveFormatEx::averageBytesPerSecond(void)const
{
	return tWAVEFORMATEX::nAvgBytesPerSec;
}

inline
void WaveFormatEx::averageBytesPerSecond(WORD averageBytesPerSecond)
{
	tWAVEFORMATEX::nAvgBytesPerSec=averageBytesPerSecond;
}

inline
WORD WaveFormatEx::blockAlign(void)const
{
	return tWAVEFORMATEX::nBlockAlign;
}

inline
void WaveFormatEx::blockAlign(WORD blockAlign)
{
  tWAVEFORMATEX::nBlockAlign=blockAlign;
}

inline
WORD WaveFormatEx::bitsPerSample(void)const
{
  return tWAVEFORMATEX::wBitsPerSample;
}

inline
void WaveFormatEx::bitsPerSample(WORD bitsPerSample)
{
  tWAVEFORMATEX::wBitsPerSample=bitsPerSample;
}

inline
WORD WaveFormatEx::size(void)const
{
  return tWAVEFORMATEX::cbSize;
}

inline
void WaveFormatEx::size(WORD size)
{
  tWAVEFORMATEX::cbSize=size;
}
#endif
