2 Copyright 2004-2005 Chris Tallon, Andreas Vogel
4 This file is part of VOMP.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include "mediaprovider.h"
30 class MediaProviderHolder;
33 class MediaPlayer : public MediaPlayerRegister, public MediaProvider
37 virtual ~MediaPlayer();
40 * get the root media list
41 * the returned list has to be destroyed by the caller
42 * if NULL is returned currently no media is available
44 virtual MediaList* getRootList();
47 * get a medialist for a given parent
48 * the returned list has to be destroyed by the caller
49 * NULL if no entries found
51 virtual MediaList* getMediaList(const MediaURI * parent);
55 * afterwards getBlock or other functions must be possible
56 * currently only one medium is open at the same time
58 * @param channel: channel id, NUMCHANNELS must be supported
59 * @param xsize,ysize: size of the screen
60 * @param size out: the size of the medium
61 * @return != 0 in case of error
64 virtual int openMedium(ULONG channel, const MediaURI * uri, ULLONG * size, ULONG xsize, ULONG ysize);
67 * get a block for a channel
68 * @param offset - the offset
69 * @param len - the required len
70 * @param outlen out - the read len if 0 this is EOF
71 * @param buffer out the allocated buffer (must be freed with free!)
72 * @return != 0 in case of error
74 virtual int getMediaBlock(ULONG channel, ULLONG offset, ULONG len, ULONG * outlen,
75 unsigned char ** buffer);
78 * close a media channel
80 virtual int closeMediaChannel(ULONG channel);
83 * return the media info for a given channel
84 * return != 0 on error
85 * the caller has to provide a pointer to an existing media info
87 virtual int getMediaInfo(ULONG channel, struct MediaInfo * result);
90 * from MediaPlayerRegister
92 virtual void registerMediaProvider(MediaProvider *p,ULONG providerID,ULONG range);
97 static MediaPlayer * getInstance();
100 MediaProvider * providerById(ULONG id);
101 typedef std::vector<MediaProviderHolder *> Tplist;
105 MediaProvider *provider;
111 struct channelInfo info[NUMCHANNELS];