add iSubserviceList interface to iRecordableService
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 5 May 2009 13:54:25 +0000 (15:54 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 5 May 2009 13:54:25 +0000 (15:54 +0200)
lib/service/iservice.h
lib/service/servicedvbrecord.cpp
lib/service/servicedvbrecord.h

index 7b85c8fabdf5de0baf78fedf07e9dc8e1d95b5ad..8e3cec6f4ec951382386c91f89eeb7d0d0c541dc 100644 (file)
@@ -867,7 +867,8 @@ public:
                evRecordStopped,
                evNewProgramInfo,
                evRecordFailed,
-               evRecordWriteError
+               evRecordWriteError,
+               evNewEventInfo
        };
        enum {
                NoError=0,
@@ -899,6 +900,7 @@ public:
        virtual RESULT stop()=0;
        virtual SWIG_VOID(RESULT) frontendInfo(ePtr<iFrontendInformation> &SWIG_OUTPUT)=0;
        virtual SWIG_VOID(RESULT) stream(ePtr<iStreamableService> &SWIG_OUTPUT)=0;
+       virtual SWIG_VOID(RESULT) subServices(ePtr<iSubserviceList> &SWIG_OUTPUT)=0;
 };
 SWIG_TEMPLATE_TYPEDEF(ePtr<iRecordableService>, iRecordableServicePtr);
 
index 70783301730e2ad8f3daf5bbbb23a87ff762be14..d9cdb516d29023ecf3c4b61d2cc21f9064c058e1 100644 (file)
@@ -503,6 +503,8 @@ void eDVBServiceRecord::gotNewEvent()
                eDebug("[eDVBServiceRecord] now running: %s (%d seconds)", event_now->getEventName().c_str(), event_now->getDuration());
        
        m_last_event_id = event_id;
+
+       m_event((iRecordableService*)this, evNewEventInfo);
 }
 
 void eDVBServiceRecord::saveCutlist()
@@ -548,3 +550,29 @@ void eDVBServiceRecord::saveCutlist()
        }
        
 }
+
+RESULT eDVBServiceRecord::subServices(ePtr<iSubserviceList> &ptr)
+{
+       ptr = this;
+       return 0;
+}
+
+int eDVBServiceRecord::getNumberOfSubservices()
+{
+       ePtr<eServiceEvent> evt;
+       if (!m_event_handler.getEvent(evt, 0))
+               return evt->getNumOfLinkageServices();
+       return 0;
+}
+
+RESULT eDVBServiceRecord::getSubservice(eServiceReference &sub, unsigned int n)
+{
+       ePtr<eServiceEvent> evt;
+       if (!m_event_handler.getEvent(evt, 0))
+       {
+               if (!evt->getLinkageService(sub, m_ref, n))
+                       return 0;
+       }
+       sub.type=eServiceReference::idInvalid;
+       return -1;
+}
index e70547f1ab9d21b950968baf3853cd0b645afaee..319fbb708db1ce6394c516abec36a7f13b57d9cc 100644 (file)
@@ -13,6 +13,7 @@
 class eDVBServiceRecord: public eDVBServiceBase,
        public iRecordableService, 
        public iStreamableService,
+       public iSubserviceList,
        public Object
 {
        DECLARE_REF(eDVBServiceRecord);
@@ -25,10 +26,14 @@ public:
        RESULT stream(ePtr<iStreamableService> &ptr);
        RESULT getError(int &error) { error = m_error; return 0; }
        RESULT frontendInfo(ePtr<iFrontendInformation> &ptr);
+       RESULT subServices(ePtr<iSubserviceList> &ptr);
 
                /* streamable service */
        PyObject *getStreamingData();
 
+               // iSubserviceList
+       int getNumberOfSubservices();
+       RESULT getSubservice(eServiceReference &subservice, unsigned int n);
 private:
        enum { stateIdle, statePrepared, stateRecording };
        bool m_simulate;