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_SND_H
23 #define ___DECODER_SND_H
25 #define DEC_SND DEC_ID('S','N','D',' ')
26 #define DEC_SND_STR "SND"
34 #include <vdr/thread.h>
37 #include "decoder-core.h"
39 #define CDFS_MAGIC 0xCDDA // cdfs filesystem-ID
43 // ----------------------------------------------------------------
45 class cSndFile : public cFileInfo {
49 void Error(const char *action);
53 cSndFile(const char *Filename);
55 bool Open(bool log=true);
57 sf_count_t Seek(sf_count_t frames=0, bool relativ=false);
58 sf_count_t Stream(int *buffer, sf_count_t frames);
61 // ----------------------------------------------------------------
63 class cSndInfo : public cSongInfo {
69 bool Abort(bool result);
70 bool CDDBLookup(const char *filename);
72 cSndInfo(cSndFile *File);
74 bool DoScan(bool KeepOpen=false);
77 // ----------------------------------------------------------------
79 class cSndDecoder : public cDecoder, public cThread {
85 unsigned long long index;
88 cCondVar fgCond, bgCond;
90 int *framebuff, deferedN, softCount;
94 bool GetInfo(bool keepOpen);
95 struct Decode *Done(eDecodeStatus status);
97 virtual void Action(void);
99 cSndDecoder(const char *Filename);
101 virtual bool Valid(void);
102 virtual cFileInfo *FileInfo(void);
103 virtual cSongInfo *SongInfo(bool get);
104 virtual cPlayInfo *PlayInfo(void);
105 virtual bool Start(void);
106 virtual bool Stop(void);
107 virtual bool Skip(int Seconds, float bsecs);
108 virtual struct Decode *Decode(void);
111 // ----------------------------------------------------------------
113 #endif //HAVE_SNDFILE
114 #endif //___DECODER_SND_H