6c94fe2c91135ba30c1253db91a526c4ea546de9
[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 <lib/nav/playlist.h>
7 #include <connection.h>
8
9 class eNavigation: public iObject, public Object
10 {
11         DECLARE_REF(eNavigation);
12 private:
13         ePtr<iPlayableService> m_runningService;
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         
19         ePtr<ePlaylist> m_playlist;
20 public:
21         enum
22         {
23                 evStopService,  /** the "current" service was just stopped and likes to be deallocated (clear refs!) */
24                 evNewService,   /** a new "current" service was just started */
25                 evPlayFailed,   /** the next service (in playlist) or the one given in playService failed to play */
26                 evPlaylistDone, /** the last service in the playlist was just played */
27                 evUpdatedEventInfo /** the "currently running" event info was updated */
28         };
29         
30         RESULT playService(const eServiceReference &service);
31         RESULT enqueueService(const eServiceReference &service);
32         RESULT connectEvent(const Slot2<void,eNavigation*,int> &event, ePtr<eConnection> &connection);
33 /*      int connectServiceEvent(const Slot1<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); */
34         RESULT getCurrentService(ePtr<iPlayableService> &service);
35         RESULT getPlaylist(ePtr<ePlaylist> &playlist);
36         RESULT stopService(void);
37         
38         RESULT pause(int p);
39         eNavigation(iServiceHandler *serviceHandler);
40         virtual ~eNavigation();
41 };
42
43 #endif