just show hdd info when there is one
[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 RESULT pNavigation::stopService()
50 {
51         return m_core->stopService();
52 }
53
54 void pNavigation::navEvent(eNavigation *nav, int event)
55 {
56                 /* just relay the events here. */
57         switch (event)
58         {
59         case eNavigation::evStopService:
60                 m_event(evStopService);
61                 break;
62         case eNavigation::evNewService:
63                 m_event(evNewService);
64                 break;
65         case eNavigation::evPlayFailed:
66                 m_event(evPlayFailed);
67                 break;
68         case eNavigation::evPlaylistDone:
69                 m_event(evPlaylistDone);
70                 break;
71         case eNavigation::evUpdatedEventInfo:
72                 m_event(evUpdatedEventInfo);
73                 break;
74         }
75 }