diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-07-20 16:06:51 +0000 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-07-20 16:06:51 +0000 |
commit | 4fb0ce9c0662a7b7c3bce712577743e2a56444c0 (patch) | |
tree | 8143d3de6e9d966fa33269ea0c9d3f112468c82f /epg_events.cpp | |
parent | b40d2c550444c61c25a1c2ec2dbd472dd11d2b62 (diff) | |
download | vdr-plugin-live-4fb0ce9c0662a7b7c3bce712577743e2a56444c0.tar.gz vdr-plugin-live-4fb0ce9c0662a7b7c3bce712577743e2a56444c0.tar.bz2 |
- Added support for EPG images: Specify the directory with your
EPG images via the new commandline option '-e <dir>' or
'--epgimages=<dir> like -P'live -e /video/epgimages'
Diffstat (limited to 'epg_events.cpp')
-rw-r--r-- | epg_events.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
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 <time.h> +#include <glob.h> #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<string> EpgEvents::EpgImages(const std::string& epgid) + { + list<string> 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 |