2 * MP3/MPlayer plugin to VDR (C++)
4 * (C) 2001-2005 Stefan Huelswitt <s.huelswitt@gmx.de>
6 * This code is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This code is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
22 #ifndef ___DECODER_OGG_H
23 #define ___DECODER_OGG_H
25 #define DEC_OGG DEC_ID('O','G','G',' ')
26 #define DEC_OGG_STR "OGG"
28 #ifdef HAVE_VORBISFILE
31 #include <vorbis/vorbisfile.h>
34 #include "decoder-core.h"
36 // ----------------------------------------------------------------
40 class cOggFile : public cFileInfo {
41 friend class cOggInfo;
46 void Error(const char *action, const int err);
48 cOggFile(const char *Filename);
50 bool Open(bool log=true);
52 long long Seek(long long posMs=0, bool relativ=false);
53 int Stream(short *buffer, int samples);
54 bool CanSeek(void) { return canSeek; }
55 long long IndexMs(void);
58 // ----------------------------------------------------------------
60 class cOggInfo : public cSongInfo {
65 bool Abort(bool result);
67 cOggInfo(cOggFile *File);
68 bool DoScan(bool KeepOpen=false);
71 // ----------------------------------------------------------------
73 class cOggDecoder : public cDecoder {
79 unsigned long long index;
83 bool GetInfo(bool keepOpen);
84 struct Decode *Done(eDecodeStatus status);
86 cOggDecoder(const char *Filename);
88 virtual bool Valid(void);
89 virtual cFileInfo *FileInfo(void);
90 virtual cSongInfo *SongInfo(bool get);
91 virtual cPlayInfo *PlayInfo(void);
92 virtual bool Start(void);
93 virtual bool Stop(void);
94 virtual bool Skip(int Seconds, float bsecs);
95 virtual struct Decode *Decode(void);
98 // ----------------------------------------------------------------
100 #endif //HAVE_VORBISFILE
101 #endif //___DECODER_OGG_H