- add record
[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         
15         ePtr<iRecordableService> m_recordingService;
16         
17         ePtr<iServiceHandler> m_servicehandler;
18         Signal2<void,eNavigation*,int> m_event;
19         ePtr<eConnection> m_service_event_conn;
20         void serviceEvent(iPlayableService* service, int event);
21         
22         ePtr<ePlaylist> m_playlist;
23 public:
24         enum
25         {
26                 evStopService,  /** the "current" service was just stopped and likes to be deallocated (clear refs!) */
27                 evNewService,   /** a new "current" service was just started */
28                 evPlayFailed,   /** the next service (in playlist) or the one given in playService failed to play */
29                 evPlaylistDone, /** the last service in the playlist was just played */
30                 evUpdatedEventInfo /** the "currently running" event info was updated */
31         };
32         
33         RESULT playService(const eServiceReference &service);
34         RESULT enqueueService(const eServiceReference &service);
35         RESULT connectEvent(const Slot2<void,eNavigation*,int> &event, ePtr<eConnection> &connection);
36 /*      int connectServiceEvent(const Slot1<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); */
37         RESULT getCurrentService(ePtr<iPlayableService> &service);
38         RESULT getPlaylist(ePtr<ePlaylist> &playlist);
39         RESULT stopService(void);
40         
41         RESULT recordService(const eServiceReference &service);
42         RESULT endRecording();
43         
44         RESULT pause(int p);
45         eNavigation(iServiceHandler *serviceHandler);
46         virtual ~eNavigation();
47 };
48
49 #endif