From 5ff227c657e02ebe2bc719faf4bd2231a04850c8 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 24 Jan 2006 00:29:54 +0000 Subject: add ability to copy providers or all services from satellites to favourites (this creates a new bouquet) add ability to remove a complete bouquet both are just working with enabled multi bouquet mode --- lib/service/servicedvb.cpp | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'lib/service/servicedvb.cpp') diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 61221ecb..827b7f36 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; -- cgit v1.2.3