- add record
authorFelix Domke <tmbinc@elitedvb.net>
Sat, 30 Apr 2005 18:01:16 +0000 (18:01 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sat, 30 Apr 2005 18:01:16 +0000 (18:01 +0000)
lib/nav/core.cpp
lib/nav/core.h
lib/nav/pcore.cpp
lib/nav/pcore.h

index 99dcf2e..2dfe630 100644 (file)
@@ -115,6 +115,31 @@ RESULT eNavigation::stopService(void)
        return 0;
 }
 
+RESULT eNavigation::recordService(const eServiceReference &service)
+{
+       if (m_recordingService)
+               endRecording();
+       
+       assert(m_servicehandler);
+       RESULT res = m_servicehandler->record(service, m_recordingService);
+       if (m_recordingService)
+       {
+               res = m_recordingService->start();
+       }
+       if (res)
+               m_recordingService = 0;
+       return res;
+}
+
+RESULT eNavigation::endRecording()
+{
+       if (!m_recordingService)
+               return -1;
+       m_recordingService->stop();
+       m_recordingService = 0;
+       return 0;
+}
+
 RESULT eNavigation::pause(int dop)
 {
        if (!m_runningService)
index 6c94fe2..c4306e3 100644 (file)
@@ -11,6 +11,9 @@ class eNavigation: public iObject, public Object
        DECLARE_REF(eNavigation);
 private:
        ePtr<iPlayableService> m_runningService;
+       
+       ePtr<iRecordableService> m_recordingService;
+       
        ePtr<iServiceHandler> m_servicehandler;
        Signal2<void,eNavigation*,int> m_event;
        ePtr<eConnection> m_service_event_conn;
@@ -35,6 +38,9 @@ public:
        RESULT getPlaylist(ePtr<ePlaylist> &playlist);
        RESULT stopService(void);
        
+       RESULT recordService(const eServiceReference &service);
+       RESULT endRecording();
+       
        RESULT pause(int p);
        eNavigation(iServiceHandler *serviceHandler);
        virtual ~eNavigation();
index 2d036a1..23df003 100644 (file)
@@ -21,6 +21,16 @@ RESULT pNavigation::playService(const eServiceReference &service)
        return m_core->playService(service);
 }
 
+RESULT pNavigation::recordService(const eServiceReference &service)
+{
+       return m_core->recordService(service);
+}
+
+RESULT pNavigation::endRecording()
+{
+       return m_core->endRecording();
+}
+
 RESULT pNavigation::enqueueService(const eServiceReference &service)
 {
        return m_core->enqueueService(service);
index 1a910b8..018209b 100644 (file)
@@ -24,6 +24,9 @@ public:
        pNavigation();
        
        RESULT playService(const eServiceReference &service);
+       RESULT recordService(const eServiceReference &service);
+       RESULT endRecording();
+       
        RESULT enqueueService(const eServiceReference &service);
        RESULT getCurrentService(ePtr<iPlayableService> &service);
        RESULT getPlaylist(ePtr<ePlaylist> &playlist);