⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 media.h

📁 联通手机的宝典画面.用brew 平台编辑而成.
💻 H
字号:
// Media.h: interface for the CMedia class.
//
//////////////////////////////////////////////////////////////////////
#ifndef _MEDIA_H_
#define _MEDIA_H_

#include "Object.h"
#include "aeemedia.h"
#include "aeemediautil.h"
#include "MainFrame.h"
#include "AEEImageCtl.h"      // AEE ImageCtl Services

#define STATE_OPTION 1
#define STATE_CONTENT 2
#define STATE_ERRO				0x0005

#define EVT_CREATEMEDIA       EVT_USER
#define EVT_CREATEMEDIA_QCP   EVT_USER + 1
#define PROGBAR_DX_DIV     3     // dx is dx/3 of main rectangle
#define PROGBAR_DY_DIV     2     // dy is dy/2 of main rectangle
#define PROGBAR_DX_OFFSET  4     // dx is reduced by offset
#define CLR_PROG_FILL      MAKE_RGB(0, 128, 192)

#define BUTTON_PLAY		1
#define BUTTON_PAUSE	0
#define BUTTON_STOP		4
#define BUTTON_FF		2
#define BUTTON_REWIND	3

struct CProgCtl
{
//	IStatic *         m_pTitle;
	AEERect           m_rectMain;
	AEERect           m_rectBar;
};

class CMedia : public CObject  
{
public:
	CMedia();
	virtual ~CMedia();
public:
	void RemoveWallPaper();
	boolean IsPlay();
	void SetWallPaper();
	void CleanRingerPtr();
	int CreateRinger();
	void CancelShowPicCallback();
	static void ShowPicCallback(CMedia* pMe);
	void ShowPic();
	void ReadDoc();
	static void ProgCtl_SetPos(CMedia * pme, AECHAR * psz, uint16 wPct);
	static void UpdateProgCtl(CMedia *pme,int nCmd, int nSubCmd, uint16 wResID);
	boolean ProgCtl_Init(CProgCtl * pme, AEERect * pRectMain);
	boolean IsPause();
	void ShowMedia();
	static void SendMediaNotify(CMedia * pme, int nCmd, int nSubCmd, int nStatus, void * pData, uint32 dwSize);
	static void MediaNotify(void * pUser, AEEMediaCmdNotify * pCmdNotify);
	void ReleaseMenu();
	void Display();
	virtual boolean KeyHandle(AEEEvent evt, uint16 wParam, uint32 dwParam);
	virtual void Release();
	virtual void Construct(char * szBuffer, long nBufferLength);
	virtual void Init(AECHAR * szName, long nID, XFRAMEINFO * pInfo);
	virtual void	Suspend();
	virtual void	Resume();
	void PlayFile(const char * pszFile);
//	boolean InitInstance(void);
	virtual void  Create();
private:
	boolean PlayImage(const char * pszFile);
	CProgCtl     m_ProgCtl;        // ProgCtl
	IMedia		*m_pMedia;
	AEEMediaData  m_md;
	AEECallback m_cbRedraw;
	char		*m_szFileName;
	CObject		*m_pObject;
	IStatic		*m_pIStatic;
	IMenuCtl  *	m_pMenu;
	IRingerMgr* m_pIRingerMgr;
	IMemAStream* m_pMemStream;
	IImage*		m_pImage;
	boolean		m_bImage;
	boolean		m_bPlayRec;
	boolean		m_bPlayResume;	// suspend时保存播放标记

	int8		m_nState;
	int8		m_nPic;
	int			m_nMenuSelect;
	uint32		m_dwPlayPos;
	uint32		m_dwTotalTime;
	uint16		m_wPct;
	uint16		m_wVolume;

	int			m_nButtonIndex;
	int			m_nButtonCount;

	IImage	  * m_icon[10];
	IImage	  * m_imgMusic[3];
// 	IImage	  * m_imgBack;

protected:
	void SetRinger();
	void ReleaseMedia();
	void ReleaseProgCtl();
	void ShowOption(int nType);
	boolean GetExt(char * szExt);
	void ClearScreen();
	void RemoveRinger();
	// 获取文件的名称,不包括路径和后缀名
	void GetFileName(char * szName, char * szFile);

	void ShowError(int16 nResId);	// 显示错误提示信息

	// 如果铃声已满则删除第一个铃声,准备覆盖之
	void CheckMaxRinger();
};

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -