a6ed35f66480b99808ecb0afb697ce6dae672137
[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         m_core->connectRecordEvent(slot(*this, &pNavigation::navRecordEvent), m_nav_record_event_connection);
18 }
19
20 RESULT pNavigation::playService(const eServiceReference &service)
21 {
22         return m_core->playService(service);
23 }
24
25 RESULT pNavigation::getCurrentService(ePtr<iPlayableService> &service)
26 {
27         return m_core->getCurrentService(service);
28 }
29
30 RESULT pNavigation::pause(int p)
31 {
32         return m_core->pause(p);
33 }
34
35 RESULT pNavigation::stopService()
36 {
37         return m_core->stopService();
38 }
39
40 RESULT pNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service)
41 {
42         return m_core->recordService(ref, service);
43 }
44
45 RESULT pNavigation::stopRecordService(ePtr<iRecordableService> &service)
46 {
47         return m_core->stopRecordService(service);
48 }
49
50 PyObject *pNavigation::getRecordings(void)
51 {
52         return m_core->getRecordings();
53 }
54
55 void pNavigation::navEvent(int event)
56 {
57                 /* just relay the events here. */
58         m_event(event);
59 }
60
61 void pNavigation::navRecordEvent(ePtr<iRecordableService> service, int event)
62 {
63                 /* just relay the events here. */
64         m_record_event(service, event);
65 }