- improve record support
[enigma2.git] / lib / nav / pcore.cpp
index 7b61ce5c4d67a0f85305692408141acac4875df1..6a849f89c2dda66cdfd6c56d0ac32291eae95bca 100644 (file)
@@ -1,5 +1,7 @@
 #include <lib/nav/pcore.h>
 #include <lib/service/service.h>
+#include <lib/service/event.h>
+#include <lib/base/eerror.h>
 
 DEFINE_REF(pNavigation);
 
@@ -10,6 +12,8 @@ pNavigation::pNavigation()
 
        assert(service_center);
        m_core = new eNavigation(service_center);
+       
+       m_core->connectEvent(slot(*this, &pNavigation::navEvent), m_nav_event_connection);
 }
 
 RESULT pNavigation::playService(const eServiceReference &service)
@@ -17,6 +21,11 @@ RESULT pNavigation::playService(const eServiceReference &service)
        return m_core->playService(service);
 }
 
+RESULT pNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service)
+{
+       return m_core->recordService(ref, service);
+}
+
 RESULT pNavigation::enqueueService(const eServiceReference &service)
 {
        return m_core->enqueueService(service);
@@ -36,3 +45,26 @@ RESULT pNavigation::pause(int p)
 {
        return m_core->pause(p);
 }
+
+void pNavigation::navEvent(eNavigation *nav, int event)
+{
+               /* just relay the events here. */
+       switch (event)
+       {
+       case eNavigation::evStopService:
+               m_event(evStopService);
+               break;
+       case eNavigation::evNewService:
+               m_event(evNewService);
+               break;
+       case eNavigation::evPlayFailed:
+               m_event(evPlayFailed);
+               break;
+       case eNavigation::evPlaylistDone:
+               m_event(evPlaylistDone);
+               break;
+       case eNavigation::evUpdatedEventInfo:
+               m_event(evUpdatedEventInfo);
+               break;
+       }
+}