2 * MP3/MPlayer plugin to VDR (C++)
4 * (C) 2001-2009 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, *def_usr_img;
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 virtual int Compare(const cListObject &ListObject) const;
63 bool Parse(char *s, const char *reldir) const;
64 bool Save(FILE *f, const char *reldir) const;
66 cSongInfo *Info(bool get=true);
67 cDecoder *Decoder(void);
68 bool Image(unsigned char * &mem, int &len);
69 inline const char *Name(void) const { return obj->Name(); }
70 inline const char *FullPath(void) const { return obj->FullPath(); }
73 // ----------------------------------------------------------------
75 class cPlayList : public cList<cSong>, public cListObject {
82 const char *AddExt(const char *Name, const char *Ext);
87 cPlayList(cFileObj *Obj);
88 cPlayList(cFileSource *Source, const char *Subdir, const char *Name);
89 cPlayList(cPlayList *List);
91 virtual bool Load(void);
92 virtual bool Save(void);
93 virtual int Compare(const cListObject &ListObject) const;
95 bool Rename(const char *newName);
97 bool Create(const char *newName);
99 bool TestName(const char *newName);
101 inline const char *Name(void) const { return obj->Name(); }
102 inline const char *BaseName(void) const { return basename; }
103 inline bool IsWinAmp(void) const { return isWinAmp; }
106 // ----------------------------------------------------------------
108 class cInstantPlayList : public cScanDir, public cPlayList {
110 virtual void DoItem(cFileSource *src, const char *subdir, const char *name);
112 cInstantPlayList(cFileObj *Obj);
113 virtual bool Load(void);
114 virtual bool Save(void) { return false; }
117 // ----------------------------------------------------------------
119 class cPlayLists : public cScanDir, public cList<cPlayList> {
121 virtual void DoItem(cFileSource *src, const char *subdir, const char *name);
123 bool Load(cFileSource *Source);
126 #endif //___DATA_MP3_H