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.
29 #include "mediaprovider.h"
31 class MediaProviderHolder;
34 class MediaPlayer : public MediaPlayerRegister, public MediaProvider
38 virtual ~MediaPlayer();
41 * get the root media list
42 * the returned list has to be destroyed by the caller
43 * if NULL is returned currently no media is available
45 virtual MediaList* getRootList();
48 * get a medialist for a given parent
49 * the returned list has to be destroyed by the caller
50 * NULL if no entries found
52 virtual MediaList* getMediaList(const MediaURI * parent);
56 * afterwards getBlock or other functions must be possible
57 * currently only one medium is open at the same time
59 * @param channel: channel id, NUMCHANNELS must be supported
60 * @param xsize,ysize: size of the screen
61 * @param size out: the size of the medium
62 * @return != 0 in case of error
65 virtual int openMedium(ULONG channel, const MediaURI * uri, ULLONG * size, ULONG xsize, ULONG ysize);
68 * get a block for a channel
69 * @param offset - the offset
70 * @param len - the required len
71 * @param outlen out - the read len if 0 this is EOF
72 * @param buffer out the allocated buffer (must be freed with free!)
73 * @return != 0 in case of error
75 virtual int getMediaBlock(ULONG channel, ULLONG offset, ULONG len, ULONG * outlen,
76 unsigned char ** buffer);
79 * close a media channel
81 virtual int closeMediaChannel(ULONG channel);
84 * return the media info for a given channel
85 * return != 0 on error
86 * the caller has to provide a pointer to an existing media info
88 virtual int getMediaInfo(ULONG channel, struct MediaInfo * result);
91 * from MediaPlayerRegister
93 virtual void registerMediaProvider(MediaProvider *p,ULONG providerID,ULONG range);
98 static MediaPlayer * getInstance();
101 MediaProvider * providerById(ULONG id);
102 typedef vector<MediaProviderHolder *> Tplist;
106 MediaProvider *provider;
112 struct channelInfo info[NUMCHANNELS];