X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d0899514fa9495013cb73c8ead8c5a5baaf49111..7a0e4749e8bf580370bd23d9b450763d9e917909:/lib/service/servicedvb.h diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h index accdd20d..c7c36e1c 100644 --- a/lib/service/servicedvb.h +++ b/lib/service/servicedvb.h @@ -25,22 +25,89 @@ private: RESULT lookupService(ePtr &ptr, const eServiceReference &ref); }; -class eDVBServiceList: public iListableService +class eBouquet; + +class eDVBServiceList: public iListableService, public iMutableServiceList { DECLARE_REF(eDVBServiceList); -private: - eServiceReference m_parent; - friend class eServiceFactoryDVB; - eDVBServiceList(const eServiceReference &parent); public: virtual ~eDVBServiceList(); RESULT getContent(std::list &list); RESULT getNext(eServiceReference &ptr); + int compareLessEqual(const eServiceReference &a, const eServiceReference &b); + + RESULT startEdit(ePtr &); + RESULT flushChanges(); + RESULT addService(eServiceReference &ref); + RESULT removeService(eServiceReference &ref); + RESULT moveService(eServiceReference &ref, int pos); +private: + RESULT startQuery(); + eServiceReference m_parent; + friend class eServiceFactoryDVB; + eDVBServiceList(const eServiceReference &parent); + ePtr m_query; + + /* for editing purposes. WARNING: lifetime issue! */ + eBouquet *m_bouquet; }; -class eDVBServicePlay: public iPlayableService, iSeekableService, public Object, public iServiceInformation +class eDVBServicePlay: public iPlayableService, public iPauseableService, + public iSeekableService, public Object, public iServiceInformation, + public iAudioTrackSelection, public iFrontendStatusInformation, + public iSubserviceList, public iTimeshiftService { DECLARE_REF(eDVBServicePlay); +public: + virtual ~eDVBServicePlay(); + + // iPlayableService + RESULT connectEvent(const Slot2 &event, ePtr &connection); + RESULT start(); + RESULT stop(); + RESULT seek(ePtr &ptr); + RESULT pause(ePtr &ptr); + RESULT info(ePtr &ptr); + RESULT audioTracks(ePtr &ptr); + RESULT frontendStatusInfo(ePtr &ptr); + RESULT subServices(ePtr &ptr); + RESULT timeshift(ePtr &ptr); + + // iPauseableService + RESULT pause(); + RESULT unpause(); + RESULT setSlowMotion(int ratio); + RESULT setFastForward(int ratio); + + // iSeekableService + RESULT getLength(pts_t &len); + RESULT seekTo(pts_t to); + RESULT seekRelative(int direction, pts_t to); + RESULT getPlayPosition(pts_t &pos); + RESULT setTrickmode(int trick=0); + + // iServiceInformation + RESULT getName(std::string &name); + RESULT getEvent(ePtr &evt, int nownext); + int getInfo(int w); + std::string getInfoString(int w); + + // iAudioTrackSelection + int getNumberOfTracks(); + RESULT selectTrack(unsigned int i); + RESULT getTrackInfo(struct iAudioTrackInfo &, unsigned int n); + + // iFrontendStatusInformation + int getFrontendInfo(int w); + + // iSubserviceList + int getNumberOfSubservices(); + RESULT getSubservice(eServiceReference &subservice, unsigned int n); + + // iTimeshiftService + RESULT startTimeshift(); + RESULT stopTimeshift(); + private: friend class eServiceFactoryDVB; eServiceReference m_reference; @@ -49,7 +116,8 @@ private: ePtr m_decoder; - eDVBServicePMTHandler m_service_handler; + /* in timeshift mode, we essentially have two channels, and thus pmt handlers. */ + eDVBServicePMTHandler m_service_handler, m_service_handler_timeshift; eDVBServiceEITHandler m_event_handler; eDVBServicePlay(const eServiceReference &ref, eDVBService *service); @@ -57,28 +125,27 @@ private: void gotNewEvent(); void serviceEvent(int event); + void serviceEventTimeshift(int event); Signal2 m_event; - int m_is_pvr; -public: - virtual ~eDVBServicePlay(); - - // iPlayableService - RESULT connectEvent(const Slot2 &event, ePtr &connection); - RESULT start(); - RESULT stop(); - RESULT seek(ePtr &ptr); - RESULT pause(ePtr &ptr); - RESULT info(ePtr &ptr); + int m_is_pvr, m_is_paused, m_timeshift_enabled, m_timeshift_active; - // iSeekableService - RESULT getLength(pts_t &len); - RESULT seekTo(pts_t to); - RESULT getPlayPosition(pts_t &pos); + std::string m_timeshift_file; + int m_timeshift_fd; + + ePtr m_decode_demux; + + int m_current_audio_stream; + int selectAudioStream(int n); + + ePtr m_record; + std::set m_pids_active; - // iServiceInformation - RESULT getName(std::string &name); - RESULT getEvent(ePtr &evt, int nownext); + void updateTimeshiftPids(); + void switchToLive(); + void switchToTimeshift(); + + void updateDecoder(); }; #endif