processors/toolkit/player.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Gav Wood                                        *
00003  *   gav@cs.york.ac.uk                                                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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 

Generated on Fri Nov 10 21:58:26 2006 for Exscalibar by  doxygen 1.5.1