diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-07-29 15:33:27 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-07-29 15:33:27 +0000 |
| commit | 244459c4b2588ac9ca4b3fcbac05a2f8a7ee1641 (patch) | |
| tree | a3f9a884c61a8d8e9579613cd0d2837eb34a243a /lib/service | |
| parent | d5e22a275d2ecdf3205bfefa927be6e125ac27b8 (diff) | |
| download | enigma2-244459c4b2588ac9ca4b3fcbac05a2f8a7ee1641.tar.gz enigma2-244459c4b2588ac9ca4b3fcbac05a2f8a7ee1641.zip | |
- split out meta parser
- movie selection works now
- service information for pvr services work
Diffstat (limited to 'lib/service')
| -rw-r--r-- | lib/service/servicedvb.cpp | 47 | ||||
| -rw-r--r-- | lib/service/servicefs.cpp | 17 |
2 files changed, 50 insertions, 14 deletions
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 <lib/dvb/db.h> #include <lib/service/servicedvbrecord.h> +#include <lib/dvb/metaparser.h> + +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<iListableServ RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr<iStaticServiceInformation> &ptr) { - ePtr<eDVBService> 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<eDVBService> 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<eDVBService> &service, const eServiceReference &ref) diff --git a/lib/service/servicefs.cpp b/lib/service/servicefs.cpp index 739dd0a6..b0d53922 100644 --- a/lib/service/servicefs.cpp +++ b/lib/service/servicefs.cpp @@ -4,6 +4,7 @@ #include <errno.h> #include <lib/service/servicefs.h> #include <lib/service/service.h> +#include <lib/service/servicedvb.h> #include <lib/base/init_num.h> #include <lib/base/init.h> #include <dirent.h> @@ -121,13 +122,15 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list) list.push_back(service); } else { - eServiceReference service(eServiceFactoryFS::id, - eServiceReference::isDirectory| - eServiceReference::canDescent|eServiceReference::mustDescent| - eServiceReference::shouldSort|eServiceReference::sort1, - filename); - service.data[0] = 0; - list.push_back(service); + /* FIIIIIX ME */ + if (filename.substr(filename.size()-3) == ".ts") + { + eServiceReference service(eServiceFactoryDVB::id, + 0, + filename); + service.data[0] = 0; + list.push_back(service); + } } } return 0; |
