X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/f94f8561a13e8666dd43e803d45325d1a9347cb2..32ffb34a91efdb0a89f36dd0172fe61eddbb41cf:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index f3215d82..77fe3faf 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -66,7 +66,7 @@ RESULT eStaticServiceDVBBouquetInformation::getName(const eServiceReference &ref return err; } - const eBouquet *bouquet=0; + eBouquet *bouquet=0; if ((err = db->getBouquet(ref, bouquet)) != 0) { eDebug("eStaticServiceDVBBouquetInformation::getName failed.. getBouquet failed!"); @@ -173,11 +173,10 @@ RESULT eDVBPVRServiceOfflineOperations::getListOfFilenames(std::list q; - if (m_parent.path.size()) + if (!m_parent.path.empty()) { eDVBChannelQuery::compile(q, m_parent.path); if (!q) @@ -271,6 +270,55 @@ int eDVBServiceList::compareLessEqual(const eServiceReference &a, const eService return m_query->compareLessEqual((const eServiceReferenceDVB&)a, (const eServiceReferenceDVB&)b); } +RESULT eDVBServiceList::startEdit(ePtr &res) +{ + if (m_parent.flags & eServiceReference::flagDirectory) // bouquet + { + ePtr db; + ePtr resm; + + if (eDVBResourceManager::getInstance(resm) || resm->getChannelList(db)) + return -1; + + if (db->getBouquet(m_parent, m_bouquet) != 0) + return -1; + + res = this; + + return 0; + } + res = 0; + return -1; +} + +RESULT eDVBServiceList::addService(eServiceReference &ref) +{ + if (!m_bouquet) + return -1; + return m_bouquet->addService(ref); +} + +RESULT eDVBServiceList::removeService(eServiceReference &ref) +{ + if (!m_bouquet) + return -1; + return m_bouquet->removeService(ref); +} + +RESULT eDVBServiceList::moveService(eServiceReference &ref, int pos) +{ + if (!m_bouquet) + return -1; + return m_bouquet->moveService(ref, pos); +} + +RESULT eDVBServiceList::flushChanges() +{ + if (!m_bouquet) + return -1; + return m_bouquet->flushChanges(); +} + RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr &ptr) { ePtr service; @@ -284,8 +332,15 @@ RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr &ptr) { - ptr = new eDVBServiceRecord((eServiceReferenceDVB&)ref); - return 0; + if (ref.path.empty()) + { + ptr = new eDVBServiceRecord((eServiceReferenceDVB&)ref); + return 0; + } else + { + ptr = 0; + return -1; + } } RESULT eServiceFactoryDVB::list(const eServiceReference &ref, ePtr &ptr) @@ -309,7 +364,7 @@ RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr &ptr) +RESULT eServiceFactoryDVB::offlineOperations(const eServiceReference &ref, ePtr &ptr) { - ptr = 0; - return -1; + if (ref.path.empty()) + { + ptr = 0; + return -1; + } else + { + ptr = new eDVBPVRServiceOfflineOperations(ref); + return 0; + } } RESULT eServiceFactoryDVB::lookupService(ePtr &service, const eServiceReference &ref) @@ -578,6 +640,18 @@ RESULT eDVBServicePlay::seekTo(pts_t to) return -1; } +RESULT eDVBServicePlay::seekRelative(int direction, pts_t to) +{ + eDebug("eDVBServicePlay::seekRelative: jump %d, %lld", direction, to); + + ePtr pvr_channel; + + if (m_service_handler.getPVRChannel(pvr_channel)) + return -1; + + return pvr_channel->seekToPosition(SEEK_CUR, to); +} + RESULT eDVBServicePlay::getPlayPosition(pts_t &pos) { ePtr pvr_channel;