Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

mpeg.h

Go to the documentation of this file.
00001 /*
00002     clanMPEG - ClanLib MPEG Player Library
00003     Copyright (C) 1999  Loki Entertainment Software
00004     Copyright (C) 1999  Daniel Vogel
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public
00017     License along with this library; if not, write to the Free
00018     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 extern void SMPEG_renderFrame( SMPEG* mpeg, int framenum, CL_Target* dst,
00087                                int x, int y );
00088 
00089 extern void SMPEG_renderFinal( SMPEG* mpeg, CL_Target* dst, int x, int y );
00090 */
00091 #endif /* header_mpeglib */

Generated at Wed Apr 4 19:54:02 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001