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.7 2004/12/13 00:26:37 jaromil Exp $" 00020 00021 */ 00022 00028 #ifndef __DECODER_H__ 00029 #define __DECODER_H__ 00030 00031 #include <pthread.h> 00032 #include <generic.h> 00033 00067 class MuseDec { 00068 00069 public: 00070 00077 MuseDec(); 00078 00085 virtual ~MuseDec(); 00086 00100 virtual int load(char *file) = 0; /* open filename */ 00101 00113 virtual bool seek(float pos) = 0; /* seek to position from 0.0 1.0 */ 00114 00126 virtual IN_DATATYPE *get_audio() = 0; /* decode audio */ 00127 00128 char name[5]; 00129 00134 int samplerate; 00135 int channels; 00136 int bitrate; 00137 int frames; 00138 int framepos; 00139 int frametot; 00140 int fps; 00141 bool seekable; 00142 bool eos; 00143 bool err; 00144 00145 00146 /* pthread stuff */ 00147 void lock() { pthread_mutex_lock(&mutex); }; 00149 void unlock() { pthread_mutex_unlock(&mutex); }; 00151 00152 private: 00153 pthread_mutex_t mutex; 00154 00155 }; 00156 00157 #endif