00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MOD_PLUGIN_H
00020 #define MOD_PLUGIN_H
00021
00022
00023 #include <qpe/mediaplayerplugininterface.h>
00024
00025 #include "stdafx.h"
00026 #include "sndfile.h"
00027
00028 class ModPlugin : public MediaPlayerDecoder,
00029 public CSoundFile
00030 {
00031 public:
00032 ModPlugin();
00033 virtual ~ModPlugin();
00034
00035 virtual const char *pluginName();
00036 virtual const char *pluginComment();
00037 virtual double pluginVersion();
00038
00039 virtual bool isFileSupported( const QString &file );
00040 virtual bool open( const QString &file );
00041 virtual bool close();
00042 virtual bool isOpen();
00043 virtual const QString &fileInfo();
00044
00045 virtual int audioStreams();
00046 virtual int audioChannels( int stream );
00047 virtual int audioFrequency( int stream );
00048 virtual int audioSamples( int stream );
00049 virtual bool audioSetSample( long sample, int stream );
00050 virtual long audioGetSample( int stream );
00051 virtual bool audioReadSamples( short *output, int channels, long samples,
00052 long &samplesRead, int stream );
00053
00054 virtual int videoStreams();
00055 virtual int videoWidth( int stream );
00056 virtual int videoHeight( int stream );
00057 virtual double videoFrameRate( int stream );
00058 virtual int videoFrames( int stream );
00059 virtual bool videoSetFrame( long sample, int stream );
00060 virtual long videoGetFrame( int stream );
00061 virtual bool videoReadFrame( unsigned char **outputRows, int inX, int inY,
00062 int inW, int inH, ColorFormat colorModel, int stream );
00063 virtual bool videoReadScaledFrame( unsigned char **outputRows, int inX, int inY,
00064 int inW, int inH, int outW, int outH,
00065 ColorFormat colorModel, int stream );
00066 virtual bool videoReadYUVFrame( char *yOutput, char *uOutput, char *vOutput,
00067 int inX, int inY, int inW, int inH, int stream );
00068
00069 virtual double getTime();
00070
00071 virtual bool setSMP( int cpus );
00072 virtual bool setMMX( bool useMMX );
00073
00074 virtual bool supportsAudio();
00075 virtual bool supportsVideo();
00076 virtual bool supportsYUV();
00077 virtual bool supportsMMX();
00078 virtual bool supportsSMP();
00079 virtual bool supportsStereo();
00080 virtual bool supportsScaling();
00081
00082 private:
00083 int m_songTime;
00084 int m_maxPosition;
00085
00086 static const int s_channels = 2;
00087 static const int s_bytesPerSample = 2;
00088 static const int s_maxChannels = 128;
00089 static const int s_frequency = 44100;
00090 static const int s_audioBufferSize = 32768;
00091 };
00092
00093 #endif
00094
00095