+ /* use count handling */
+ virtual void AddUse() = 0;
+ virtual void ReleaseUse() = 0;
+#endif
+};
+SWIG_TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
+
+#ifndef SWIG
+ /* signed, so we can express deltas. */
+
+typedef long long pts_t;
+
+class iFilePushScatterGather;
+class iTSMPEGDecoder;
+
+ /* note that a cue sheet describes the logical positions. thus
+ everything is specified in pts and not file positions */
+
+ /* implemented in dvb.cpp */
+class eCueSheet: public iObject, public Object
+{
+ DECLARE_REF(eCueSheet);
+public:
+ eCueSheet();
+
+ /* frontend */
+ void seekTo(int relative, const pts_t &pts);
+
+ void clear();
+ void addSourceSpan(const pts_t &begin, const pts_t &end);
+ void commitSpans();
+
+ void setSkipmode(const pts_t &ratio); /* 90000 is 1:1 */
+ void setDecodingDemux(iDVBDemux *demux, iTSMPEGDecoder *decoder);
+
+ /* frontend and backend */
+ eRdWrLock m_lock;
+
+ /* backend */
+ enum { evtSeek, evtSkipmode, evtSpanChanged };
+ RESULT connectEvent(const Slot1<void, int> &event, ePtr<eConnection> &connection);
+
+ std::list<std::pair<pts_t,pts_t> > m_spans; /* begin, end */
+ std::list<std::pair<int, pts_t> > m_seek_requests; /* relative, delta */
+ pts_t m_skipmode_ratio;
+ Signal1<void,int> m_event;
+ ePtr<iDVBDemux> m_decoding_demux;
+ ePtr<iTSMPEGDecoder> m_decoder;
+};
+
+class iDVBPVRChannel: public iDVBChannel
+{
+public:
+ enum
+ {
+ state_eof = state_release + 1 /* end-of-file reached. */
+ };
+
+ /* FIXME: there are some very ugly buffer-end and ... related problems */
+ /* so this is VERY UGLY.
+
+ ok, it's going to get better. but still...*/
+ virtual RESULT playFile(const char *file) = 0;
+ virtual void stopFile() = 0;
+
+ virtual void setCueSheet(eCueSheet *cuesheet) = 0;
+
+ virtual RESULT getLength(pts_t &pts) = 0;
+
+ /* we explicitely ask for the decoding demux here because a channel
+ can be shared between multiple decoders.
+ */
+ virtual RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode) = 0;
+ /* skipping must be done with a cue sheet */