1 #ifndef __lib_hbbtv_hbbtv_h_
2 #define __lib_hbbtv_hbbtv_h_
4 #include "oipfapplication.h"
6 #include <lib/base/esignal.h>
7 #include <lib/service/iservice.h>
8 #include <lib/service/event.h>
10 #define HBBTV_USER_AGENT "Mozilla/5.0 (Linux mips; U;HbbTV/1.1.1 (+RTSP;Dream Property GmbH;Dreambox;0.1a;1.0;) CE-HTML/1.0; en) AppleWebKit/535.19 no/Volksbox QtWebkit/2.2";
12 class eDVBServiceAITHandler;
14 class eHbbtv : public sigc::trackable
16 static eHbbtv *instance;
17 bool m_aitSignalsEnabled;
19 ePtr<eConnection> m_serviceEventConnection;
20 std::list<eServiceReference> m_serviceList;
21 eServiceReference m_currentBouquet;
22 eServiceReference m_currentService;
23 ePtr<iPlayableService> m_playableService;
24 ePtr<eConnection> m_serviceEventConn;
25 eDVBServiceAITHandler *m_aitHandler;
26 std::map< std::string, std::map<std::string, eOipfApplication> >m_applications;
28 void aitChanged(int pid);
29 std::vector<std::string> split(const std::string &s, char delim, int limit = 0);
30 void checkApp(const eOipfApplication *app);
31 bool addApplication(const eOipfApplication &app, std::map<std::string, eOipfApplication> *currentServiceApps);
44 static const int VERSION_MAJOR = 1;
45 static const int VERSION_MINOR = 1;
46 static const int VERSION_MICRO = 1;
54 BROADCAST_STATE_UNREALIZED = 0,
55 BROADCAST_STATE_CONNECTING,
56 BROADCAST_STATE_PRESENTING,
60 CHANNEL_ERROR_NOT_SUPPORTED = 0,
61 CHANNEL_ERROR_TUNE_FAILED,
62 CHANNEL_ERROR_TUNER_FOREIGN_LOCK,
63 CHANNEL_ERROR_PARENTAL_LOCK,
64 CHANNEL_ERROR_CANNOT_DECRYPT,
65 CHANNEL_ERROR_UNKNOWN,
66 CHANNEL_ERROR_SWITCH_INTERRUPTED,
67 CHANNEL_ERROR_LOCKED_BY_RECORD,
68 CHANNEL_ERROR_RESOLVE_FAILED,
69 CHANNEL_ERROR_BANDWITH_INSUFFICIENT,
70 CHANNEL_ERROR_CANNOT_ZAP,
73 enum StreamPlayStates {
74 STREAM_STATE_STOPPED = 0,
77 STREAM_STATE_CONNECTING,
78 STREAM_STATE_BUFFERING,
79 STREAM_STATE_FINISHED,
84 STREAM_ERROR_NONE = 0,
85 STREAM_ERROR_UNSUPPORTED,
86 STREAM_ERROR_CONNECTING,
91 static eHbbtv *getInstance();
92 void setAitSignalsEnabled(bool enabled){ m_aitSignalsEnabled = enabled; };
93 void setServiceList(std::string sref);
94 void setStreamState(int state);
95 const eOipfApplication getApplication(const std::string &id);
96 const std::string resolveApplicationLocator(const std::string &dvbUrl);
97 std::list<std::pair<std::string, std::string> > getApplicationIdsAndName();
98 void pageLoadFinished();
102 const std::string getCurrentServiceTriplet();
103 const eServiceReference &getCurrentService();
104 void setCurrentService(eServiceReference service, ePtr<iPlayableService> &playableService);
105 void playService(const std::string &sref);
106 void playStream(const std::string &uri);
108 bool seekStream(pts_t to);
112 void onCurrentServiceStop();
113 void onCurrentServiceEvent(iPlayableService *playableService, int what);
114 ePtr<iPlayableService> getPlayableService();
116 long getPlayPosition();
117 void setVolume(int volume);
118 const std::list<eServiceReference> getServiceList();
119 ePtr<eServiceEvent> getEvent(int nownext);
120 void setVideoWindow(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
121 void unsetVideoWindow();
124 void createApplication(const std::string &uri);
126 Signal0<void> currentServiceChanged;
127 Signal1<void, int> serviceChangeError;
128 Signal1<void, int> streamPlayStateChanged;
129 Signal0<void> serviceListChanged;
130 Signal0<void> loadFinished;
133 /* void playServiceRequest(std::string); */
134 eSignal1<void, const char *> playServiceRequest;
135 /* void playStreamRequest(std::string); */
136 eSignal1<void, const char *> playStreamRequest;
137 /* void pauseStreamRequest(); */
138 eSignal0<void> pauseStreamRequest;
139 /* void seekStreamRequest(pts_t); */
140 eSignal1<void, pts_t> seekStreamRequest;
141 /* void stopStreamRequest(); */
142 eSignal0<void> stopStreamRequest;
143 /* void nextServiceRequest(); */
144 eSignal0<void> nextServiceRequest;
145 /* void prevServiceRequest(); */
146 eSignal0<void> prevServiceRequest;
147 /* void setVolumeRequest(int); */
148 eSignal1<void, int> setVolumeRequest;
149 /* void setVideoWindowRequest(unsigned int, unsigned int, unsigned int, unsigned int); */
150 eSignal4<void, unsigned int, unsigned int, unsigned int, unsigned int> setVideoWindowRequest;
151 /* void unsetVideoWindowRequest(); */
152 eSignal0<void> unsetVideoWindowRequest;
153 /* void aitInvalidated() */
154 eSignal0<void> aitInvalidated;
155 /* void redButtonAppplicationReady(std::string); */
156 eSignal1<void, const char*> redButtonAppplicationReady;
157 /* void textApplicationReady(std::string); */
158 eSignal1<void, const char*> textApplicationReady;
159 /* void createApplicationRequest(std::string); */
160 eSignal1<void, const char*> createApplicationRequest
167 #endif /* __lib_hbbtv_hbbtv_h_ */