00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef header_mpeglib
00022 #define header_mpeglib
00023
00024 #include "../core.h"
00025
00026 class MPEGfile;
00027
00028 typedef void(*CL_MPEG_DisplayCallback)(CL_Target* dst, int x, int y,
00029 unsigned int w, unsigned int h);
00030
00031 enum CL_MPEG_Status
00032 {
00033 CL_MPEG_ERROR = -1,
00034 CL_MPEG_STOPPED,
00035 CL_MPEG_PLAYING
00036 };
00037
00038 class CL_MPEG
00039 {
00040
00041 public:
00042
00043 CL_MPEG(const char *filename, bool video = true,
00044 bool audio = true);
00045
00046 ~CL_MPEG();
00047
00048 void set_audio(bool flag);
00049 void set_video(bool flag);
00050 void set_double(bool flag);
00051 void set_loop(bool flag);
00052 void set_volume(int volume);
00053 void move(int x, int y);
00054
00055 bool has_video() { return m_has_audio; }
00056 bool has_audio() { return m_has_video; }
00057
00058 unsigned int get_width() { return m_width; }
00059 unsigned int get_height() { return m_height; }
00060 unsigned int get_current_frame() { return 0;}
00061
00062 double get_current_fps() { return 0;}
00063 CL_MPEG_Status get_status();
00064
00065 void play();
00066 void pause();
00067 void stop();
00068 void rewind();
00069
00070 void set_display(CL_Target* dst, CL_Mutex* surfLock,
00071 CL_MPEG_DisplayCallback callback);
00072 void set_display(CL_Target* dst);
00073
00074 char* get_error();
00075
00076 private:
00077
00078 bool m_has_audio, m_has_video;
00079 bool m_double, m_loop;
00080 unsigned int m_width, m_height;
00081
00082 MPEGfile* obj;
00083 };
00084
00085
00086
00087
00088
00089
00090
00091 #endif