diff options
author | Denis Loh <denis.loh@gmail.com> | 2010-01-25 12:10:01 +0100 |
---|---|---|
committer | Denis Loh <denis.loh@gmail.com> | 2010-01-25 12:10:01 +0100 |
commit | 724cb5e3783311f6b8c808852dbe2de59f2399b0 (patch) | |
tree | be1f2d617b4a3e2e156b7a2d6ba9ee335cde63cf /inc/recplayer.h | |
parent | 0152f33daffe3fe943d6a134409d02df7ecaa982 (diff) | |
download | vdr-plugin-upnp-724cb5e3783311f6b8c808852dbe2de59f2399b0.tar.gz vdr-plugin-upnp-724cb5e3783311f6b8c808852dbe2de59f2399b0.tar.bz2 |
Fixed small bug which leads to an empty TV folder
Diffstat (limited to 'inc/recplayer.h')
-rw-r--r-- | inc/recplayer.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/inc/recplayer.h b/inc/recplayer.h new file mode 100644 index 0000000..376ca3c --- /dev/null +++ b/inc/recplayer.h @@ -0,0 +1,53 @@ +/* + * File: recplayer.h + * Author: savop + * + * Created on 8. Juni 2009, 11:57 + */ + +#ifndef _RECPLAYER_H +#define _RECPLAYER_H + +#include "../common.h" +#include "filehandle.h" +#include <vdr/recording.h> + +/** + * The recording player + * + * This class provides the ability to play VDR records. The difference between + * usual files and VDR recording files is, that recordings are possibly splitted + * into multiple files. The class will scan those files and tries to dynamically + * navigate in them like it would do, if it is a single file. + * + */ +class cRecordingPlayer : public cFileHandle { +public: + /** + * Get a new instance of a recording player + * + * This returns a new instance of a recording player which plays the + * specified VDR recording. + * + * @param Recording the recording to play + * @return the new instance of the recording player + */ + static cRecordingPlayer *newInstance(cRecording *Recording); + virtual ~cRecordingPlayer(); + virtual void open(UpnpOpenFileMode mode); + virtual int read(char* buf, size_t buflen); + virtual int write(char* buf, size_t buflen); + virtual int seek(off_t offset, int origin); + virtual void close(); +private: + void scanLastOffsets(); + cRecordingPlayer(cRecording *Recording); + off_t* mLastOffsets; + int mLastFileNumber; + cRecording *mRecording; + cFileName *mRecordingFile; + cUnbufferedFile *mCurrentFile; +}; + +#endif /* _RECPLAYER_H */ + |