2 * MP3/MPlayer plugin to VDR (C++)
4 * (C) 2001-2006 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
25 #include <vdr/thread.h>
26 #include <vdr/tools.h>
29 // ----------------------------------------------------------------
35 extern const char *imagecache, *imageconv;
36 extern const char *img_suff[], *excl_pl[], *excl_br[];
38 // ----------------------------------------------------------------
40 class cSong : public cListObject {
45 bool fromDOS, decoderFailed;
54 char *Convert2Unix(const char *name) const;
56 const char *CheckImage(const char *base) const;
59 cSong(cFileSource *Source, const char *Subdir, const char *Name);
62 #if APIVERSNUM >= 10315
63 virtual int Compare(const cListObject &ListObject) const;
65 virtual bool operator<(const cListObject &ListObject);
67 bool Parse(char *s, const char *reldir) const;
68 bool Save(FILE *f, const char *reldir) const;
70 cSongInfo *Info(bool get=true);
71 cDecoder *Decoder(void);
72 bool Image(unsigned char * &mem, int &len);
73 inline const char *Name(void) const { return obj->Name(); }
74 inline const char *FullPath(void) const { return obj->FullPath(); }
77 // ----------------------------------------------------------------
79 class cPlayList : public cList<cSong>, public cListObject {
86 const char *AddExt(const char *Name, const char *Ext);
91 cPlayList(cFileObj *Obj);
92 cPlayList(cFileSource *Source, const char *Subdir, const char *Name);
93 cPlayList(cPlayList *List);
95 virtual bool Load(void);
96 virtual bool Save(void);
97 #if APIVERSNUM >= 10315
98 virtual int Compare(const cListObject &ListObject) const;
100 virtual bool operator<(const cListObject &ListObject);
103 bool Rename(const char *newName);
105 bool Create(const char *newName);
107 bool TestName(const char *newName);
109 inline const char *Name(void) const { return obj->Name(); }
110 inline const char *BaseName(void) const { return basename; }
111 inline bool IsWinAmp(void) const { return isWinAmp; }
114 // ----------------------------------------------------------------
116 class cInstantPlayList : public cScanDir, public cPlayList {
118 virtual void DoItem(cFileSource *src, const char *subdir, const char *name);
120 cInstantPlayList(cFileObj *Obj);
121 virtual bool Load(void);
122 virtual bool Save(void) { return false; }
125 // ----------------------------------------------------------------
127 class cPlayLists : public cScanDir, public cList<cPlayList> {
129 virtual void DoItem(cFileSource *src, const char *subdir, const char *name);
131 bool Load(cFileSource *Source);
134 #endif //___DATA_MP3_H