X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d5e22a275d2ecdf3205bfefa927be6e125ac27b8..640fa7fc2dab8135f04952e3dec9abd1d715a328:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 5bd25f67..92e26cfa 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -10,6 +10,31 @@ #include #include +#include + +class eStaticServiceDVBPVRInformation: public iStaticServiceInformation +{ + DECLARE_REF(eStaticServiceDVBPVRInformation); + eServiceReference m_ref; + eDVBMetaParser m_parser; +public: + eStaticServiceDVBPVRInformation(const eServiceReference &ref); + RESULT getName(const eServiceReference &ref, std::string &name); +}; + +DEFINE_REF(eStaticServiceDVBPVRInformation); + +eStaticServiceDVBPVRInformation::eStaticServiceDVBPVRInformation(const eServiceReference &ref) +{ + m_ref = ref; + m_parser.parseFile(ref.path); +} + +RESULT eStaticServiceDVBPVRInformation::getName(const eServiceReference &ref, std::string &name) +{ + ASSERT(ref == m_ref); + name = m_parser.m_name.size() ? m_parser.m_name : ref.path; +} DEFINE_REF(eServiceFactoryDVB) @@ -109,13 +134,21 @@ RESULT eServiceFactoryDVB::list(const eServiceReference &ref, ePtr &ptr) { - ePtr service; - int r = lookupService(service, ref); - if (r) - return r; - /* eDVBService has the iStaticServiceInformation interface, so we pass it here. */ - ptr = service; - return 0; + /* do we have a PVR service? */ + if (ref.path.size()) + { + ptr = new eStaticServiceDVBPVRInformation(ref); + return 0; + } else + { + ePtr service; + int r = lookupService(service, ref); + if (r) + return r; + /* eDVBService has the iStaticServiceInformation interface, so we pass it here. */ + ptr = service; + return 0; + } } RESULT eServiceFactoryDVB::lookupService(ePtr &service, const eServiceReference &ref)