X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c50acf3391bec3f2abaf219c8f52c7d57d6149b5..17be24380f07656d14b88baf5af0d9ef3d8eddfd:/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h new file mode 100644 index 00000000..ed5d49bd --- /dev/null +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h @@ -0,0 +1,166 @@ +#ifndef __servicedvd_h +#define __servicedvd_h + +#include +#include +#include +#include + +#define cue + +class eSubtitleWidget; +class gPixmap; +class eStaticServiceDVDInfo; + +class eServiceFactoryDVD: public iServiceHandler +{ +DECLARE_REF(eServiceFactoryDVD); +public: + eServiceFactoryDVD(); + virtual ~eServiceFactoryDVD(); + enum { id = 0x1111 }; + + // iServiceHandler + RESULT play(const eServiceReference &, ePtr &ptr); + RESULT record(const eServiceReference &, ePtr &ptr); + RESULT list(const eServiceReference &, ePtr &ptr); + RESULT info(const eServiceReference &, ePtr &ptr); + RESULT offlineOperations(const eServiceReference &, ePtr &ptr); +}; + +class eServiceDVD: public iPlayableService, public iPauseableService, public iSeekableService, + public iServiceInformation, public iSubtitleOutput, public iServiceKeys, public eThread, public Object +#ifdef cue +, public iCueSheet +#endif +{ + friend class eServiceFactoryDVD; +DECLARE_REF(eServiceDVD); +public: + virtual ~eServiceDVD(); + // not implemented (yet) + RESULT audioChannel(ePtr &ptr) { ptr = 0; return -1; } + RESULT audioTracks(ePtr &ptr) { ptr = 0; return -1; } + RESULT frontendInfo(ePtr &ptr) { ptr = 0; return -1; } + RESULT subServices(ePtr &ptr) { ptr = 0; return -1; } + RESULT timeshift(ePtr &ptr) { ptr = 0; return -1; } + RESULT audioDelay(ePtr &ptr) { ptr = 0; return -1; } + RESULT rdsDecoder(ePtr &ptr) { ptr = 0; return -1; } + RESULT stream(ePtr &ptr) { ptr = 0; return -1; } +#ifdef cue + RESULT cueSheet(ePtr &ptr); +#else + RESULT cueSheet(ePtr &ptr) { ptr = 0; return -1; } +#endif + + // iPlayableService + RESULT connectEvent(const Slot2 &event, ePtr &connection); + RESULT start(); + RESULT stop(); + RESULT setTarget(int target); + RESULT info(ePtr &ptr); + RESULT pause(ePtr &ptr); + RESULT subtitle(ePtr &ptr); + RESULT seek(ePtr &ptr); + RESULT keys(ePtr &ptr); + + // iPausableService + RESULT pause(); + RESULT unpause(); + RESULT setSlowMotion(int ratio); + RESULT setFastForward(int ratio); + + // iSubtitleOutput + RESULT enableSubtitles(eWidget *parent, SWIG_PYOBJECT(ePyObject) entry); + RESULT disableSubtitles(eWidget *parent); + PyObject *getSubtitleList(); + PyObject *getCachedSubtitle(); + +#if 1 + // 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); + RESULT isCurrentlySeekable(); + RESULT seekChapter(int chapter); +#endif + + // iServiceInformation + RESULT getName(std::string &name); + int getInfo(int w); + std::string getInfoString(int w); + virtual PyObject *getInfoObject(int w); + +#ifdef cue + // iCueSheet + PyObject *getCutList(); + void setCutList(SWIG_PYOBJECT(ePyObject)); + void setCutListEnable(int enable); +#endif + // iServiceKeys + RESULT keyPressed(int key); +private: + eServiceDVD(const char *filename); + + void gotMessage(int); // message from dvdlib + void gotThreadMessage(const int &); // message from dvd thread + + // eThread + void thread(); + void thread_finished(); + + std::string m_filename; + + Signal2 m_event; + + struct ddvd *m_ddvdconfig; + ePtr m_pixmap; + eSubtitleWidget *m_subtitle_widget; + + enum + { + stIdle, stRunning, stStopped, + }; + + int m_state; + int m_current_trick; + + pts_t m_doSeekTo; + int m_seekTitle; + char m_ddvd_titlestring[96]; + + eSocketNotifier m_sn; + eFixedMessagePump m_pump; + +#ifdef cue +// ePtr m_cue; +// +// struct cueEntry +// { +// pts_t where; +// unsigned int what; +// +// bool operator < (const struct cueEntry &o) const +// { +// return where < o.where; +// } +// cueEntry(const pts_t &where, unsigned int what) : +// where(where), what(what) +// { +// } +// }; + +// std::multiset m_cue_entries; + int m_cuesheet_changed, m_cutlist_enabled; + pts_t m_cue_pts; + + void loadCuesheet(); + void saveCuesheet(); + +// void cutlistToCuesheet(); +#endif +}; + +#endif