1 #include <lib/nav/pcore.h>
2 #include <lib/service/service.h>
3 #include <lib/service/event.h>
4 #include <lib/base/eerror.h>
6 DEFINE_REF(pNavigation);
8 pNavigation::pNavigation()
10 ePtr<iServiceHandler> service_center;
11 eServiceCenter::getInstance(service_center);
13 assert(service_center);
14 m_core = new eNavigation(service_center);
16 m_core->connectEvent(slot(*this, &pNavigation::navEvent), m_nav_event_connection);
19 RESULT pNavigation::playService(const eServiceReference &service)
21 return m_core->playService(service);
24 RESULT pNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service)
26 return m_core->recordService(ref, service);
29 RESULT pNavigation::enqueueService(const eServiceReference &service)
31 return m_core->enqueueService(service);
34 RESULT pNavigation::getCurrentService(ePtr<iPlayableService> &service)
36 return m_core->getCurrentService(service);
39 RESULT pNavigation::getPlaylist(ePtr<ePlaylist> &playlist)
41 return m_core->getPlaylist(playlist);
44 RESULT pNavigation::pause(int p)
46 return m_core->pause(p);
49 void pNavigation::navEvent(eNavigation *nav, int event)
51 /* just relay the events here. */
54 case eNavigation::evStopService:
55 m_event(evStopService);
57 case eNavigation::evNewService:
58 m_event(evNewService);
60 case eNavigation::evPlayFailed:
61 m_event(evPlayFailed);
63 case eNavigation::evPlaylistDone:
64 m_event(evPlaylistDone);
66 case eNavigation::evUpdatedEventInfo:
67 m_event(evUpdatedEventInfo);