00001 /* MuSE - Multiple Streaming Engine 00002 * Copyright (C) 2000-2004 Denis Rojo aka jaromil <jaromil@dyne.org> 00003 * 00004 * This source code is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Public License as published 00006 * by the Free Software Foundation; either version 2 of the License, 00007 * or (at your option) any later version. 00008 * 00009 * This source code is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 * Please refer to the GNU Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Public License along with 00015 * this source code; if not, write to: 00016 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 * 00018 00019 $Id: decoder.h,v 1.6 2004/04/04 23:07:24 pallotron Exp $" 00020 00021 */ 00022 00028 #ifndef __DECODER_H__ 00029 #define __DECODER_H__ 00030 00031 #include <pthread.h> 00032 #include <generic.h> 00033 00066 class MuseDec { 00067 00068 public: 00069 00076 MuseDec(); 00077 00084 virtual ~MuseDec(); 00085 00099 virtual int load(char *file) = 0; /* open filename */ 00100 00112 virtual bool seek(float pos) = 0; /* seek to position from 0.0 1.0 */ 00113 00125 virtual IN_DATATYPE *get_audio() = 0; /* decode audio */ 00126 00127 char name[5]; 00128 00133 int samplerate; 00134 int channels; 00135 int bitrate; 00136 int frames; 00137 int framepos; 00138 int frametot; 00139 int fps; 00140 bool seekable; 00141 bool eos; 00142 bool err; 00143 00144 00145 /* pthread stuff */ 00146 void lock() { pthread_mutex_lock(&mutex); }; 00148 void unlock() { pthread_mutex_unlock(&mutex); }; 00150 00151 private: 00152 pthread_mutex_t mutex; 00153 00154 }; 00155 00156 #endif