]> git.vomp.tv Git - vompserver.git/blob - servermediafile.h
15 years that line of code has been waiting to crash
[vompserver.git] / servermediafile.h
1 /*
2     Copyright 2004-2005 Chris Tallon, Andreas Vogel
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP 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.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef SERVERMEDIAFILE_H
22 #define SERVERMEDIAFILE_H
23
24 #include "mediafile.h"
25 #include "config.h"
26
27 class MediaLauncher;
28
29
30 class ServerMediaFile : public MediaFile 
31 {
32   public:
33     ServerMediaFile(Config *c,MediaPlayerRegister *distributor);
34     virtual ~ServerMediaFile();
35     virtual MediaList* getRootList();
36     virtual int openMedium(ULONG channel, const MediaURI * uri, ULLONG * size, ULONG xsize, ULONG ysize);
37     virtual int getMediaBlock(ULONG channel, ULLONG offset, ULONG len, ULONG * outlen,
38         unsigned char ** buffer);
39     virtual int closeMediaChannel(ULONG channel);
40     virtual int getMediaInfo(ULONG channel, MediaInfo * result);
41     virtual MediaList* getMediaList(const MediaURI *parent);
42
43
44
45   protected:
46     virtual ULONG getMediaType(const char *fname);
47     MediaLauncher * launchers[NUMCHANNELS];
48     MediaLauncher * dirhandler;
49
50   private:
51     Config *cfg;
52     ULONG addDataToList(unsigned char * buf, ULONG buflen,MediaList *list,bool extendedFormat) ;
53
54
55 };
56
57 #endif