00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __PLAYER_H
00022 #define __PLAYER_H
00023
00024 #ifdef HAVE_VORBISFILE
00025 #include <cstdio>
00026 #include <cstdlib>
00027 #include <cmath>
00028 #include "vorbis/codec.h"
00029 #include "vorbis/vorbisfile.h"
00030 #endif
00031
00032 #ifdef HAVE_SNDFILE
00033 #include <sndfile.h>
00034 #endif
00035
00036 #ifdef HAVE_MAD
00037 #include <mad.h>
00038 typedef struct bstdfile bstdfile_t;
00039 #endif
00040
00041 #include <qfile.h>
00042 #include <qdatetime.h>
00043 #include <qmutex.h>
00044
00045 #ifdef __GEDDEI_BUILD
00046 #include "qfastwaitcondition.h"
00047 #include "processor.h"
00048 #else
00049 #include <qtextra/qfastwaitcondition.h>
00050 #include <geddei/processor.h>
00051 #endif
00052
00068 class Player: public Processor
00069 {
00070 QString thePath;
00071 enum { NoMode, ModeSF, ModeVF, ModeMAD } theMode;
00072
00073 #ifdef HAVE_SNDFILE
00074 SNDFILE *theSndFile;
00075 #endif
00076 #ifdef HAVE_VORBISFILE
00077 OggVorbis_File theVorbisFile;
00078 #endif
00079 #ifdef HAVE_MAD
00080 FILE *theMadFile;
00081 struct mad_stream Stream;
00082 struct mad_frame Frame;
00083 struct mad_synth Synth;
00084 mad_timer_t Timer;
00085 bstdfile_t *BstdFile;
00086 #endif
00087 uint theChannels, theRate, theLength, thePosition, theReadFrames;
00088
00089 virtual void processor();
00090 virtual void processorStopped();
00091 virtual const bool verifyAndSpecifyTypes(const SignalTypeRefs &inTypes, SignalTypeRefs &outTypes);
00092 virtual PropertiesInfo specifyProperties() const;
00093 virtual void initFromProperties(const Properties &p);
00094 virtual void specifyOutputSpace(QValueVector<uint> &samples);
00095
00096 public:
00100 Player();
00101 };
00102
00103 #endif
00104