From 4fb0ce9c0662a7b7c3bce712577743e2a56444c0 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Fri, 20 Jul 2007 16:06:51 +0000 Subject: - Added support for EPG images: Specify the directory with your EPG images via the new commandline option '-e ' or '--epgimages= like -P'live -e /video/epgimages' --- epg_events.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'epg_events.cpp') diff --git a/epg_events.cpp b/epg_events.cpp index 049e27f..89c1347 100644 --- a/epg_events.cpp +++ b/epg_events.cpp @@ -1,9 +1,11 @@ #include +#include #include "tools.h" #include "recordings.h" #include "epg_events.h" +#include "setup.h" using namespace std; @@ -275,4 +277,29 @@ namespace vdrlive { return EpgInfoPtr(new EpgString(id, caption, info)); } + + list EpgEvents::EpgImages(const std::string& epgid) + { + list images; + + size_t delimPos = epgid.find_last_of('_'); + string imageId = epgid.substr(delimPos+1); + imageId = imageId.substr(0, imageId.size()-1); // tvm2vdr seems always to use one digit less + + const string filemask(LiveSetup().GetEpgImageDir() + "/" + imageId + "*.*"); + glob_t globbuf; + globbuf.gl_offs = 0; + if (!LiveSetup().GetEpgImageDir().empty() && glob(filemask.c_str(), GLOB_DOOFFS, NULL, &globbuf) == 0) + { + for(int i=0; i<(int)globbuf.gl_pathc; i++) + { + const string imagefile(globbuf.gl_pathv[i]); + size_t delimPos = imagefile.find_last_of('/'); + images.push_back(imagefile.substr(delimPos+1)); + } + globfree(&globbuf); + } + return images; + } + }; // namespace vdrlive -- cgit v1.2.3