Skin.h
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:3k
源码类别:
VC书籍
开发平台:
Visual C++
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #ifndef _SKIN_H
- #define _SKIN_H
- #include "MediaPlayback.h"
- #include "SkinList.h"
- #include "SkinFile.h"
- #include "Playa.h"
- #include <windows.h>
- #include <stdio.h>
- #include "../build/win32/resource.h"
- /*
- * 定义宽度和长度
- */
- #define LOGO_WIDTH 265
- #define LOGO_HEIGHT 160
- /*
- * 动作的枚举类型
- *
- */
- enum {
- ACTION_NONE,
- ACTION_CLOSE,
- ACTION_MINIMIZE,
- ACTION_MENU,
- ACTION_REWIND,
- ACTION_STOP,
- ACTION_PLAY,
- ACTION_PAUSE,
- ACTION_FORWARD,
- ACTION_LOAD,
- ACTION_MOVING,
- ACTION_RESIZE,
- ACTION_VOLUME_BAR,
- ACTION_VOLUME_CURSOR,
- ACTION_PROGRESS_BAR,
- ACTION_PROGRESS_CURSOR
- };
- /*
- * Skin类装载和显示外壳
- */
- class Skin {
- private:
- HWND hwnd;
- HBITMAP skin;
- HBITMAP controls;
- HBITMAP logo;
- HBITMAP bottom;
- COLORREF skinColor;
- DWORD compactMode;
- RECT menuButton;
- RECT minimizeButton;
- RECT closeButton;
- RECT rewindButton;
- RECT stopButton;
- RECT playButton;
- RECT pauseButton;
- RECT forwardButton;
- RECT loadButton;
- RECT resizeButton;
- RECT progressBar;
- RECT progressCursor;
- RECT volumeBar;
- RECT volumeCursor;
- RECT videoRect;
- BOOL isInsideRect(int x, int y, RECT rect);
- int SetVolume(HWND hwnd, int volume);
- int SetProgress(HWND hwnd, double progress);
- public:
- /*
- * 从0到100
- */
- int volume;
- double progress;
- Skin(HINSTANCE hIstance, HWND hwnd);
- ~Skin();
- int GetDefaultWidth();
- int GetDefaultHeight();
- int GetProgress();
- int GetVolume();
- RECT *GetVideoRect();
- int LoadDefault(HINSTANCE hInst, HWND hwnd);
- int Load(char *directory, HWND hwnd);
- int Display(HWND hwnd, MediaPlayback *playback);
- int UpdateSize(HWND hwnd);
- int SetVolumeCursorX(HWND hwnd, int x);
- int SetProgressCursorX(HWND hwnd, int x);
- int SetProgressValue(HWND hwnd, double progress);
- int SetCompact(int compact);
- int SetActionStart(HWND hwnd, int action);
- int SetActionEnd(HWND hwnd, int action);
- int DisplayFps(HWND hwnd, MediaPlayback *playback);
- int DrawBufferingState(HWND hwnd, DWORD state);
- int DrawTime(HWND hwnd, MediaPlayback *playback);
- int GetAction(int x, int y);
- };
- #endif