f1e0cd85b2a21baf5d04375e9b4518d96d1b0189
[enigma2.git] / lib / nav / core.h
1 #ifndef __nav_core_h
2 #define __nav_core_h
3
4 #include <lib/base/object.h>
5 #include <lib/service/iservice.h>
6 #include <connection.h>
7
8 class eNavigation: public iObject, public Object
9 {
10         DECLARE_REF(eNavigation);
11 private:
12         ePtr<iPlayableService> m_runningService;
13         
14         ePtr<iServiceHandler> m_servicehandler;
15         Signal2<void,eNavigation*,int> m_event;
16         ePtr<eConnection> m_service_event_conn;
17         void serviceEvent(iPlayableService* service, int event);
18 public:
19         enum
20         {
21                 evStopService,  /** the "current" service was just stopped and likes to be deallocated (clear refs!) */
22                 evNewService,   /** a new "current" service was just started */
23                 evPlayFailed,   /** the next service (in playlist) or the one given in playService failed to play */
24                 evUpdatedEventInfo, /** the "currently running" event info was updated */
25                 evUpdatedInfo, /** the program info of this service was updated */
26                 evSeekableStatusChanged,
27         };
28         
29         RESULT playService(const eServiceReference &service);
30         RESULT connectEvent(const Slot2<void,eNavigation*,int> &event, ePtr<eConnection> &connection);
31 /*      int connectServiceEvent(const Slot1<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); */
32         RESULT getCurrentService(ePtr<iPlayableService> &service);
33         RESULT stopService(void);
34         
35         RESULT recordService(const eServiceReference &ref, ePtr<iRecordableService> &service);
36         
37         RESULT pause(int p);
38         eNavigation(iServiceHandler *serviceHandler);
39         virtual ~eNavigation();
40 };
41
42 #endif