remove unneeded comment
[enigma2.git] / lib / nav / pcore.cpp
1 #include <lib/nav/pcore.h>
2 #include <lib/service/service.h>
3 #include <lib/service/event.h>
4 #include <lib/base/eerror.h>
5
6 DEFINE_REF(pNavigation);
7
8 pNavigation::pNavigation()
9 {
10         ePtr<iServiceHandler> service_center;
11         eServiceCenter::getInstance(service_center);
12
13         assert(service_center);
14         m_core = new eNavigation(service_center);
15         
16         m_core->connectEvent(slot(*this, &pNavigation::navEvent), m_nav_event_connection);
17 }
18
19 RESULT pNavigation::playService(const eServiceReference &service)
20 {
21         return m_core->playService(service);
22 }
23
24 RESULT pNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service)
25 {
26         return m_core->recordService(ref, service);
27 }
28
29 RESULT pNavigation::enqueueService(const eServiceReference &service)
30 {
31         return m_core->enqueueService(service);
32 }
33
34 RESULT pNavigation::getCurrentService(ePtr<iPlayableService> &service)
35 {
36         return m_core->getCurrentService(service);
37 }
38
39 RESULT pNavigation::getPlaylist(ePtr<ePlaylist> &playlist)
40 {
41         return m_core->getPlaylist(playlist);
42 }
43
44 RESULT pNavigation::pause(int p)
45 {
46         return m_core->pause(p);
47 }
48
49 void pNavigation::navEvent(eNavigation *nav, int event)
50 {
51                 /* just relay the events here. */
52         switch (event)
53         {
54         case eNavigation::evStopService:
55                 m_event(evStopService);
56                 break;
57         case eNavigation::evNewService:
58                 m_event(evNewService);
59                 break;
60         case eNavigation::evPlayFailed:
61                 m_event(evPlayFailed);
62                 break;
63         case eNavigation::evPlaylistDone:
64                 m_event(evPlaylistDone);
65                 break;
66         case eNavigation::evUpdatedEventInfo:
67                 m_event(evUpdatedEventInfo);
68                 break;
69         }
70 }