add filename to record prepare
authorFelix Domke <tmbinc@elitedvb.net>
Sat, 15 Oct 2005 20:13:05 +0000 (20:13 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sat, 15 Oct 2005 20:13:05 +0000 (20:13 +0000)
lib/service/iservice.h
lib/service/service.h
lib/service/servicedvb.cpp
lib/service/servicedvbrecord.cpp
lib/service/servicedvbrecord.h

index d0dc1e2b2cb93bdb9bbfb8f1b85422fdcaf0cd8c..abbeb1a251782df06d7a7f9e55d527bcd06cccf2 100644 (file)
@@ -233,7 +233,7 @@ TEMPLATE_TYPEDEF(ePtr<iPlayableService>, iPlayableServicePtr);
 class iRecordableService: public iObject
 {
 public:
-       virtual RESULT prepare()=0;
+       virtual RESULT prepare(const char *filename)=0;
        virtual RESULT start()=0;
        virtual RESULT stop()=0;
 };
index f98d3e511a728845d4882c73bcc1487970ed69d3..17614c2f87273bc7f20a84f9f066c1637bd64622 100644 (file)
@@ -28,7 +28,7 @@ public:
        
                // eServiceCenter
        static RESULT getPrivInstance(eServiceCenterPtr &ptr) { ptr = instance; return 0; }
-       static RESULT getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
+       static SWIG_VOID(RESULT) getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
        RESULT addServiceFactory(int id, iServiceHandler *hnd);
        RESULT removeServiceFactory(int id);
 };
index a29b77ce74d160dbb93e82c559a78e5ef8524e46..86ed83d22040fd7b3224bbdeb3d956986383d2b7 100644 (file)
@@ -284,7 +284,7 @@ RESULT eServiceFactoryDVB::lookupService(ePtr<eDVBService> &service, const eServ
 }
 
 eDVBServicePlay::eDVBServicePlay(const eServiceReference &ref, eDVBService *service): 
-       m_reference(ref), m_dvb_service(service)
+       m_reference(ref), m_dvb_service(service), m_service_handler(0)
 {
        m_is_pvr = !ref.path.empty();
        
index 773aeb39ed9f6d0602539809502272a431725023..856b8c96e97dcb1c855dc72d5e31cae77437c852 100644 (file)
@@ -5,7 +5,7 @@
 
 DEFINE_REF(eDVBServiceRecord);
 
-eDVBServiceRecord::eDVBServiceRecord(const eServiceReferenceDVB &ref): m_ref(ref)
+eDVBServiceRecord::eDVBServiceRecord(const eServiceReferenceDVB &ref): m_ref(ref), m_service_handler(1)
 {
        CONNECT(m_service_handler.serviceEvent, eDVBServiceRecord::serviceEvent);
        m_state = stateIdle;
@@ -34,8 +34,9 @@ void eDVBServiceRecord::serviceEvent(int event)
 }
 
 
-RESULT eDVBServiceRecord::prepare()
+RESULT eDVBServiceRecord::prepare(const char *filename)
 {
+       m_filename = filename;
        if (m_state == stateIdle)
                return m_service_handler.tune(m_ref);
        else
@@ -73,8 +74,9 @@ int eDVBServiceRecord::doPrepare()
                /* allocate a ts recorder if we don't already have one. */
        if (m_state == stateIdle)
        {
-               ::remove("recordings.ts");
-               int fd = ::open("recording.ts", O_WRONLY|O_CREAT, 0644);
+               eDebug("Recording to %s...", m_filename.c_str());
+               ::remove(m_filename.c_str());
+               int fd = ::open(m_filename.c_str(), O_WRONLY|O_CREAT, 0644);
                if (fd == -1)
                {
                        eDebug("eDVBServiceRecord - can't open hardcoded recording file!");
index c90d0c9290bdebae3e0045eccbb0bb041c9ab455..17e3d16639cd94d64956d31a93a054f006d1d95f 100644 (file)
@@ -14,7 +14,7 @@ class eDVBServiceRecord: public iRecordableService, public Object
 {
 DECLARE_REF(eDVBServiceRecord);
 public:
-       RESULT prepare();
+       RESULT prepare(const char *filename);
        RESULT start();
        RESULT stop();
 private:
@@ -31,6 +31,7 @@ private:
        
        int m_recording;
        std::set<int> m_pids_active;
+       std::string m_filename;
        
        int doPrepare();
        int doRecord();