X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fservice%2Fservicedvb.cpp;h=827b7f362702ec89f734852ded841dd453c0ad4b;hb=5ff227c657e02ebe2bc719faf4bd2231a04850c8;hp=8be89a6d284f0fa79cd23658daa15c53824e5958;hpb=d250965754894689707739e6d12d7cf6a6f13d5e;p=vuplus_dvbapp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 8be89a6..827b7f3 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -13,6 +13,7 @@ #include #include #include +#include class eStaticServiceDVBInformation: public iStaticServiceInformation { @@ -305,7 +306,32 @@ RESULT eDVBServiceList::startQuery() return 0; } -RESULT eDVBServiceList::getContent(std::list &list) +RESULT eDVBServiceList::getContent(PyObject *list, bool sorted) +{ + eServiceReferenceDVB ref; + + if (!m_query || !list || !PyList_Check(list)) + return -1; + + std::list tmplist; + + while (!m_query->getNextResult(ref)) + tmplist.push_back(ref); + + if (sorted) + tmplist.sort(iListableServiceCompare(this)); + + for (std::list::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 &list, bool sorted) { eServiceReferenceDVB ref; @@ -314,6 +340,10 @@ RESULT eDVBServiceList::getContent(std::list &list) while (!m_query->getNextResult(ref)) list.push_back(ref); + + if (sorted) + list.sort(iListableServiceCompare(this)); + return 0; } @@ -379,6 +409,13 @@ RESULT eDVBServiceList::flushChanges() 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 &ptr) { ePtr service; @@ -582,6 +619,7 @@ RESULT eDVBServicePlay::start() 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; } @@ -598,6 +636,9 @@ RESULT eDVBServicePlay::connectEvent(const Slot2 &ev RESULT eDVBServicePlay::pause(ePtr &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; @@ -1003,7 +1044,7 @@ RESULT eDVBServicePlay::startTimeshift() if (m_timeshift_fd < 0) { - delete m_record; + m_record = 0; return -4; } @@ -1027,12 +1068,11 @@ RESULT eDVBServicePlay::stopTimeshift() 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; } @@ -1105,7 +1145,6 @@ void eDVBServicePlay::updateTimeshiftPids() void eDVBServicePlay::switchToLive() { - eDebug("SwitchToLive"); if (!m_timeshift_active) return; @@ -1122,7 +1161,6 @@ void eDVBServicePlay::switchToLive() void eDVBServicePlay::switchToTimeshift() { - eDebug("SwitchToTimeshift"); if (m_timeshift_active) return; @@ -1136,7 +1174,6 @@ void eDVBServicePlay::switchToTimeshift() 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 */ }