#include <lib/service/servicedvbrecord.h>
#include <lib/dvb/metaparser.h>
#include <lib/dvb/tstools.h>
+#include <lib/python/python.h>
class eStaticServiceDVBInformation: public iStaticServiceInformation
{
return 0;
}
-RESULT eDVBServiceList::getContent(std::list<eServiceReference> &list)
+RESULT eDVBServiceList::getContent(PyObject *list, bool sorted)
+{
+ eServiceReferenceDVB ref;
+
+ if (!m_query || !list || !PyList_Check(list))
+ return -1;
+
+ std::list<eServiceReferenceDVB> tmplist;
+
+ while (!m_query->getNextResult(ref))
+ tmplist.push_back(ref);
+
+ if (sorted)
+ tmplist.sort(iListableServiceCompare(this));
+
+ for (std::list<eServiceReferenceDVB>::iterator it(tmplist.begin());
+ it != tmplist.end(); ++it)
+ {
+ PyObject *refobj = New_eServiceReference(*it);
+ PyList_Append(list, refobj);
+ Py_DECREF(refobj);
+ }
+ return 0;
+}
+
+RESULT eDVBServiceList::getContent(std::list<eServiceReference> &list, bool sorted)
{
eServiceReferenceDVB ref;
while (!m_query->getNextResult(ref))
list.push_back(ref);
+
+ if (sorted)
+ list.sort(iListableServiceCompare(this));
+
return 0;
}
return m_bouquet->flushChanges();
}
+RESULT eDVBServiceList::setListName(const std::string &name)
+{
+ if (!m_bouquet)
+ return -1;
+ return m_bouquet->setListName(name);
+}
+
RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
{
ePtr<eDVBService> service;
to start recording from the data demux. */
r = m_service_handler.tune((eServiceReferenceDVB&)m_reference, m_is_pvr);
m_event(this, evStart);
+ m_event((iPlayableService*)this, evSeekableStatusChanged);
return 0;
}
RESULT eDVBServicePlay::pause(ePtr<iPauseableService> &ptr)
{
+ /* note: we check for timeshift to be enabled,
+ not neccessary active. if you pause when timeshift
+ is not active, you should activate it when unpausing */
if ((!m_is_pvr) && (!m_timeshift_enabled))
{
ptr = 0;
RESULT eDVBServicePlay::getName(std::string &name)
{
+ if (m_is_pvr)
+ {
+ ePtr<iStaticServiceInformation> i = new eStaticServiceDVBPVRInformation(m_reference);
+ return i->getName(m_reference, name);
+ }
if (m_dvb_service)
{
m_dvb_service->getName(m_reference, name);
case sAudioPID: if (program.audioStreams.empty()) return -1; return program.audioStreams[m_current_audio_stream].pid;
case sPCRPID: return program.pcrPid;
case sPMTPID: return program.pmtPid;
- case sTXTPID: return -1;
+ case sTXTPID: return program.textPid;
case sSID: return ((const eServiceReferenceDVB&)m_reference).getServiceID().get();
case sONID: return ((const eServiceReferenceDVB&)m_reference).getOriginalNetworkID().get();
case sTSID: return ((const eServiceReferenceDVB&)m_reference).getTransportStreamID().get();
if (m_timeshift_fd < 0)
{
- delete m_record;
+ m_record = 0;
return -4;
}
m_timeshift_enabled = 0;
m_record->stop();
- delete m_record;
+ m_record = 0;
close(m_timeshift_fd);
remove(m_timeshift_file.c_str());
- eDebug("timeshift disabled");
return 0;
}
void eDVBServicePlay::switchToLive()
{
- eDebug("SwitchToLive");
if (!m_timeshift_active)
return;
void eDVBServicePlay::switchToTimeshift()
{
- eDebug("SwitchToTimeshift");
if (m_timeshift_active)
return;
eServiceReferenceDVB r = (eServiceReferenceDVB&)m_reference;
r.path = m_timeshift_file;
- eDebug("ok, re-tuning to %s", r.toString().c_str());
m_service_handler_timeshift.tune(r, 1); /* use the decoder demux for everything */
}