Click here to Skip to main content
15,886,030 members
Articles / Desktop Programming / MFC

Media Player

Rate me:
Please Sign up or sign in to vote.
1.25/5 (73 votes)
20 Sep 2003CPOL1 min read 256.7K   11.9K   52  
Its a media player which plays all media audio and video files.
#if !defined(AFX_WAVE_H__54B7993A_3F57_4AB0_9CCD_A55C2A1B2871__INCLUDED_)
#define AFX_WAVE_H__54B7993A_3F57_4AB0_9CCD_A55C2A1B2871__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <mmsystem.h>
#include <mmreg.h>
#include "WaveBuffer.h"	// Added by ClassView

class CWave : public CObject  
{
	DECLARE_SERIAL(CWave)
public:
	void SetBuffer(void* pBuffer, DWORD dwNumSamples, bool bCopy = false);
	void Load(const CString& strFile);
	void Save(const CString& strFile);
	DWORD GetBufferLength() const;
	DWORD GetNumSamples() const;
	void* GetBuffer() const;
	void Save(CFile* f);
	void Load(CFile* f);
	WAVEFORMATEX GetFormat() const;
	void BuildFormat(WORD nChannels, DWORD nFrequency, WORD nBits);
	CWave();
	CWave(const CWave& copy);
	CWave& operator=(const CWave& wave);
	virtual ~CWave();
	virtual void Serialize( CArchive& archive );
private:
	CWaveBuffer m_buffer;
	WAVEFORMATEX m_pcmWaveFormat;
};

#endif // !defined(AFX_WAVE_H__54B7993A_3F57_4AB0_9CCD_A55C2A1B2871__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions