From: Felix Domke Date: Sat, 15 Oct 2005 20:13:05 +0000 (+0000) Subject: add filename to record prepare X-Git-Tag: 2.6.0~5456 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/70dfd18f5fc6f88b327ff5193b64ebff353c1458 add filename to record prepare --- diff --git a/lib/service/iservice.h b/lib/service/iservice.h index d0dc1e2b..abbeb1a2 100644 --- a/lib/service/iservice.h +++ b/lib/service/iservice.h @@ -233,7 +233,7 @@ TEMPLATE_TYPEDEF(ePtr, 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; }; diff --git a/lib/service/service.h b/lib/service/service.h index f98d3e51..17614c2f 100644 --- a/lib/service/service.h +++ b/lib/service/service.h @@ -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); }; diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index a29b77ce..86ed83d2 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -284,7 +284,7 @@ RESULT eServiceFactoryDVB::lookupService(ePtr &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(); diff --git a/lib/service/servicedvbrecord.cpp b/lib/service/servicedvbrecord.cpp index 773aeb39..856b8c96 100644 --- a/lib/service/servicedvbrecord.cpp +++ b/lib/service/servicedvbrecord.cpp @@ -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!"); diff --git a/lib/service/servicedvbrecord.h b/lib/service/servicedvbrecord.h index c90d0c92..17e3d166 100644 --- a/lib/service/servicedvbrecord.h +++ b/lib/service/servicedvbrecord.h @@ -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 m_pids_active; + std::string m_filename; int doPrepare(); int doRecord();