openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
servicedvd.h
Go to the documentation of this file.
1 #ifndef __servicedvd_h
2 #define __servicedvd_h
3 
4 #include <lib/base/message.h>
5 #include <lib/base/ebase.h>
6 #include <lib/base/thread.h>
7 #include <lib/service/iservice.h>
8 
9 class eSubtitleWidget;
10 class gPixmap;
12 
14 {
15  DECLARE_REF(eServiceFactoryDVD);
16 public:
18  virtual ~eServiceFactoryDVD();
20 
21  // iServiceHandler
27 private:
28  ePtr<eStaticServiceDVDInfo> m_service_info;
29 };
30 
32 {
33  DECLARE_REF(eStaticServiceDVDInfo);
34  friend class eServiceFactoryDVD;
36 public:
37  RESULT getName(const eServiceReference &ref, std::string &name);
38  int getLength(const eServiceReference &ref) { return -1; }
39  int getInfo(const eServiceReference &ref, int w);
40  int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate) { return 1; }
41  long long getFileSize(const eServiceReference &ref);
43 };
44 
46 {
47  DECLARE_REF(eServiceDVDInfoContainer);
48 
49  std::vector<int> integerValues;
50  std::vector<std::string> stringValues;
51 
52 public:
53  int getInteger(unsigned int index) const;
54  std::string getString(unsigned int index) const;
55 
56  void addInteger(int value);
57  void addString(const char *value);
58 };
59 
61  public iServiceInformation, public iSubtitleOutput, public iServiceKeys, public iCueSheet, public eThread, public sigc::trackable
62 {
63  friend class eServiceFactoryDVD;
64  DECLARE_REF(eServiceDVD);
65 public:
66  virtual ~eServiceDVD();
67  // not implemented (yet)
68  RESULT setTarget(int target, bool noaudio = false) { return -1; }
72  RESULT subServices(ePtr<iSubserviceList> &ptr) { ptr = nullptr; return -1; }
73  RESULT timeshift(ePtr<iTimeshiftService> &ptr) { ptr = nullptr; return -1; }
74  RESULT tap(ePtr<iTapService> &ptr) { ptr = nullptr; return -1; };
75  RESULT audioDelay(ePtr<iAudioDelay> &ptr) { ptr = nullptr; return -1; }
76  RESULT rdsDecoder(ePtr<iRdsDecoder> &ptr) { ptr = nullptr; return -1; }
77  RESULT stream(ePtr<iStreamableService> &ptr) { ptr = nullptr; return -1; }
78  RESULT streamed(ePtr<iStreamedService> &ptr) { ptr = nullptr; return -1; }
80  void setQpipMode(bool value, bool audio) { }
81 
82  // iPlayableService
83  RESULT connectEvent(const sigc::slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
84  RESULT start();
85  RESULT stop();
91 
92  // iPausableService
93  RESULT pause();
94  RESULT unpause();
95  RESULT setSlowMotion(int ratio);
96  RESULT setFastForward(int ratio);
97 
98  // iSubtitleOutput
99  RESULT enableSubtitles(iSubtitleUser *user, SubtitleTrack &track);
101  RESULT getSubtitleList(std::vector<SubtitleTrack> &sublist);
102  RESULT getCachedSubtitle(SubtitleTrack &track);
103 
104  // iSeekableService
105  RESULT getLength(pts_t &len);
106  RESULT seekTo(pts_t to);
107  RESULT seekRelative(int direction, pts_t to);
109  RESULT setTrickmode(int trick=0);
111  RESULT seekChapter(int chapter);
112  RESULT seekTitle(int title);
113 
114  // iServiceInformation
115  RESULT getName(std::string &name);
116  int getInfo(int w);
117  std::string getInfoString(int w);
119 
120  // iCueSheet
121  PyObject *getCutList();
123  void setCutListEnable(int enable);
124 
125  // iAudioTrackSelection
126  int getNumberOfTracks();
127  RESULT selectTrack(unsigned int i);
128  RESULT getTrackInfo(struct iAudioTrackInfo &, unsigned int n);
129  int getCurrentTrack();
130 
131  // iServiceKeys
132  RESULT keyPressed(int key);
133 
134 private:
136 
137  void gotMessage(int); // message from dvdlib
138  void gotThreadMessage(const int &); // message from dvd thread
139 
140  // eThread
141  void thread();
142  void thread_finished();
143 
144  eServiceReference m_ref;
145 
146  sigc::signal2<void,iPlayableService*,int> m_event;
147 
148  struct ddvd *m_ddvdconfig;
149  ePtr<gPixmap> m_pixmap;
150  iSubtitleUser *m_subtitle_widget;
151 
152  enum
153  {
154  stIdle, stRunning, stMenu, stStopped
155  };
156 
157  int m_state;
158  int m_current_trick;
159 
160  char m_ddvd_titlestring[96];
161 
163  eFixedMessagePump<int> m_pump;
164 
165  pts_t m_cue_pts;
166  struct ddvd_resume m_resume_info;
167 
168  void loadCuesheet();
169  void saveCuesheet();
170 
171  int m_width, m_height, m_aspect, m_framerate, m_progressive;
172  bool m_resume, m_dvd_menu_closed;
173 };
174 
175 #endif
static int ptr
Definition: bcm.cpp:17
long long pts_t
Definition: cfile.h:7
Definition: python.h:31
Definition: servicedvd.h:62
RESULT frontendInfo(ePtr< iFrontendInformation > &ptr)
Definition: servicedvd.h:71
RESULT pause()
Definition: servicedvd.cpp:578
RESULT info(ePtr< iServiceInformation > &ptr)
Definition: servicedvd.cpp:605
RESULT timeshift(ePtr< iTimeshiftService > &ptr)
Definition: servicedvd.h:73
RESULT keys(ePtr< iServiceKeys > &ptr)
Definition: servicedvd.cpp:551
RESULT rdsDecoder(ePtr< iRdsDecoder > &ptr)
Definition: servicedvd.h:76
RESULT streamed(ePtr< iStreamedService > &ptr)
Definition: servicedvd.h:78
RESULT getName(std::string &name)
Definition: servicedvd.cpp:612
RESULT seekChapter(int chapter)
Definition: servicedvd.cpp:904
RESULT seekTitle(int title)
Definition: servicedvd.cpp:897
RESULT getLength(pts_t &len)
Definition: servicedvd.cpp:847
RESULT seekTo(pts_t to)
Definition: servicedvd.cpp:859
RESULT seek(ePtr< iSeekableService > &ptr)
Definition: servicedvd.cpp:477
int getNumberOfTracks()
Definition: servicedvd.cpp:498
RESULT setSlowMotion(int ratio)
Definition: servicedvd.cpp:559
virtual ~eServiceDVD()
Definition: servicedvd.cpp:432
RESULT subServices(ePtr< iSubserviceList > &ptr)
Definition: servicedvd.h:72
void setCutList(SWIG_PYOBJECT(ePyObject))
Definition: servicedvd.cpp:999
RESULT getSubtitleList(std::vector< SubtitleTrack > &sublist)
Definition: servicedvd.cpp:815
RESULT audioChannel(ePtr< iAudioChannelSelection > &ptr)
Definition: servicedvd.h:69
RESULT audioTracks(ePtr< iAudioTrackSelection > &ptr)
Definition: servicedvd.cpp:491
RESULT keyPressed(int key)
Definition: servicedvd.cpp:922
RESULT setFastForward(int ratio)
Definition: servicedvd.cpp:570
int getInfo(int w)
Definition: servicedvd.cpp:625
PyObject * getCutList()
Definition: servicedvd.cpp:989
RESULT stream(ePtr< iStreamableService > &ptr)
Definition: servicedvd.h:77
RESULT getPlayPosition(pts_t &pos)
Definition: servicedvd.cpp:882
RESULT enableSubtitles(iSubtitleUser *user, SubtitleTrack &track)
Definition: servicedvd.cpp:773
RESULT isCurrentlySeekable()
Definition: servicedvd.cpp:917
RESULT getTrackInfo(struct iAudioTrackInfo &, unsigned int n)
Definition: servicedvd.cpp:522
RESULT subtitle(ePtr< iSubtitleOutput > &ptr)
Definition: servicedvd.cpp:484
RESULT stop()
Definition: servicedvd.cpp:458
std::string getInfoString(int w)
Definition: servicedvd.cpp:694
RESULT unpause()
Definition: servicedvd.cpp:585
RESULT getCachedSubtitle(SubtitleTrack &track)
Definition: servicedvd.cpp:841
RESULT audioDelay(ePtr< iAudioDelay > &ptr)
Definition: servicedvd.h:75
RESULT connectEvent(const sigc::slot2< void, iPlayableService *, int > &event, ePtr< eConnection > &connection)
Definition: servicedvd.cpp:441
RESULT cueSheet(ePtr< iCueSheet > &ptr)
Definition: servicedvd.cpp:978
RESULT seekRelative(int direction, pts_t to)
Definition: servicedvd.cpp:873
RESULT start()
Definition: servicedvd.cpp:447
RESULT tap(ePtr< iTapService > &ptr)
Definition: servicedvd.h:74
RESULT setTrickmode(int trick=0)
Definition: servicedvd.cpp:912
RESULT setTarget(int target, bool noaudio=false)
Definition: servicedvd.h:68
RESULT selectTrack(unsigned int i)
Definition: servicedvd.cpp:515
RESULT disableSubtitles()
Definition: servicedvd.cpp:807
void setQpipMode(bool value, bool audio)
Definition: servicedvd.h:80
ePtr< iServiceInfoContainer > getInfoObject(int w)
Definition: servicedvd.cpp:707
void setCutListEnable(int enable)
Definition: servicedvd.cpp:1003
int getCurrentTrack()
Definition: servicedvd.cpp:506
Definition: servicedvd.h:46
std::string getString(unsigned int index) const
Definition: servicedvd.cpp:147
void addInteger(int value)
Definition: servicedvd.cpp:154
int getInteger(unsigned int index) const
Definition: servicedvd.cpp:140
void addString(const char *value)
Definition: servicedvd.cpp:159
Definition: servicedvd.h:14
RESULT play(const eServiceReference &, ePtr< iPlayableService > &ptr)
Definition: servicedvd.cpp:54
RESULT offlineOperations(const eServiceReference &, ePtr< iServiceOfflineOperations > &ptr)
Definition: servicedvd.cpp:80
RESULT list(const eServiceReference &, ePtr< iListableService > &ptr)
Definition: servicedvd.cpp:67
eServiceFactoryDVD()
Definition: servicedvd.cpp:26
RESULT record(const eServiceReference &, ePtr< iRecordableService > &ptr)
Definition: servicedvd.cpp:61
RESULT info(const eServiceReference &, ePtr< iStaticServiceInformation > &ptr)
Definition: servicedvd.cpp:74
virtual ~eServiceFactoryDVD()
Definition: servicedvd.cpp:42
Definition: iservice.h:15
@ idServiceDVD
Definition: iservice.h:30
Definition: servicedvd.h:32
int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate)
Definition: servicedvd.h:40
int getLength(const eServiceReference &ref)
Definition: servicedvd.h:38
RESULT getEvent(const eServiceReference &ref, ePtr< eServiceEvent > &ptr, time_t start_time)
Definition: servicedvd.h:42
long long getFileSize(const eServiceReference &ref)
Definition: servicedvd.cpp:130
RESULT getName(const eServiceReference &ref, std::string &name)
Definition: servicedvd.cpp:92
int getInfo(const eServiceReference &ref, int w)
Definition: servicedvd.cpp:108
Definition: esubtitle.h:44
Definition: thread.h:27
Definition: gpixmap.h:188
Definition: iservice.h:562
virtual unsigned int n
Definition: iservice.h:570
Definition: iservice.h:700
Definition: iservice.h:499
Definition: iservice.h:978
Definition: iservice.h:528
Definition: iservice.h:1095
Definition: iservice.h:260
Definition: iservice.h:433
Definition: iservice.h:909
Definition: iservice.h:269
virtual ePtr< eServiceEvent > time_t start_time
Definition: iservice.h:279
Definition: iservice.h:736
Definition: iservice.h:725
enable
Definition: Extensions/MiniTV/plugin.py:8
name
Definition: newplugin.py:9
target
Definition: newplugin.py:59
value
Definition: Profile.py:29
list ref
Definition: create_picon_e1_to_e2.py:17
pos
Definition: enigma_py_patcher.py:16
index
Definition: main.py:28
int RESULT
Definition: object.h:12
Definition: iservice.h:548
#define SWIG_PYOBJECT(x)
Definition: swig.h:23