www.pudn.com > MPlayer0623.zip > Media.h
// Media.h: interface for the CMedia class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MEDIA_H__CE160420_26E3_11D7_B7E2_0080C82BE86B__INCLUDED_)
#define AFX_MEDIA_H__CE160420_26E3_11D7_B7E2_0080C82BE86B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define CURRENTPOS -1
#define NORMAL -1
#define FAST -2
#define SPECIALFAST -3
#define SLOW -4
#define _OPENTYPE "Music Files(*.mp3;*.wav;*.cda)|*.mp3;*.wav;*.cda|Video File(*.avi;*.asf;*.wmv)|*.avi;*.asf;*.wmv|Mpegvideo File(*.dat;*.mpg;*.mpeg)|*.dat;*.mpg;*.mpeg;*.mpe|"
class CMedia
{
public:
LONG GetTotalSec(void);
int GetFrameRate(void);
bool IsVideo(void); //video:return true , else return false
bool SetFullScreen(void);
void SetVolume(int iFactor);
//get the HWND of the media window
HWND GetHwnd(void);
//get total length,in frames,nBufLength: the length of input buffer
LONG GetLength(void);
void Pause(void);
void Stop(void);
//close the media device
void Close(void);
//parameter: FULLSCREEN and WINDOWSCREEN
//iSpeed :set the play speed, NORMAL,FAST,SPECIALFAST,SLOW, and other specify speed data (int)
void SetSpeed(int iSpeed=NORMAL);
//play from the iStartPos position,-1 means CURRENT position
void Play(int iStartPos=CURRENTPOS);
////////////////////////////////////////////////////////////
//strMedia: device file name
//szError : obtain the error message ,"OK" means no error
void Create(LPCTSTR strMedia,CString& szError);
////////////////////////////////////////////////////////////
CMedia();
virtual ~CMedia();
private:
bool m_bIsVideo;
CString m_mediaSuffix;
bool m_pause;
CString m_strMedia;
};
#endif // !defined(AFX_MEDIA_H__CE160420_26E3_11D7_B7E2_0080C82BE86B__INCLUDED_)