diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-04-01 18:29:38 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-04-01 18:29:38 +0200 |
commit | d43463d62b8b4ee5c7f0aed5ac1893e838dae088 (patch) | |
tree | ccf3f711065ec4032bda268743765d2c4522f525 /import.h | |
parent | e2ac357ef3f1b76ea126573a69aba85409407a5e (diff) | |
download | vdr-plugin-xmltv2vdr-0.1.0.tar.gz vdr-plugin-xmltv2vdr-0.1.0.tar.bz2 |
Added EpgHandler supportv0.1.0
Diffstat (limited to 'import.h')
-rw-r--r-- | import.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/import.h b/import.h new file mode 100644 index 0000000..a2020a6 --- /dev/null +++ b/import.h @@ -0,0 +1,77 @@ +/* + * import.h: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + */ + +#ifndef _IMPORT_H +#define _IMPORT_H + +#include <vdr/epg.h> +#include <vdr/channels.h> +#include <sqlite3.h> + +#include "event.h" +#include "source.h" +#include "maps.h" + +enum +{ + IMPORT_ALL=0, + IMPORT_DESCRIPTION, + IMPORT_SHORTTEXT +}; + +class cEPGSource; +class cEPGExecutor; + +class cImport +{ +private: + struct split + { + char *pointers[256]; + int count; + }; + enum + { + IMPORT_NOERROR=0, + IMPORT_NOSCHEDULE, + IMPORT_NOCHANNEL, + IMPORT_XMLTVERR, + IMPORT_NOMAPPING, + IMPORT_NOCHANNELID, + IMPORT_EMPTYSCHEDULE + }; + cEPGMappings *maps; + cEPGSource *source; + cTEXTMappings *texts; + cCharSetConv *conv; + const char *epgfile; + char *RemoveLastCharFromDescription(char *description); + char *Add2Description(char *description, const char *Value); + char *Add2Description(char *description, const char *Name, const char *Value); + char *Add2Description(char *description, const char *Name, int Value); + char *AddEOT2Description(char *description); + struct split split(char *in, char delim); + cEvent *GetEventBefore(cSchedule* schedule, time_t start); + cEvent *SearchVDREvent(cSchedule* schedule, cXMLTVEvent *event); + bool FetchXMLTVEvent(sqlite3_stmt *stmt, cXMLTVEvent *xevent); + char *RemoveNonASCII(const char *src); + cXMLTVEvent *PrepareAndReturn(sqlite3 *db, char *sql, sqlite3_stmt *stmt); + bool WasChanged(cEvent *event); +public: + cImport(cEPGSource *Source, cEPGMappings *Maps, cTEXTMappings *Texts); + ~cImport(); + int Process(cEPGExecutor &myExecutor); + bool PutEvent(cEPGSource *source, sqlite3 *db, cSchedule* schedule, cEvent *event, + cXMLTVEvent *xevent, int Flags, int Option=IMPORT_ALL); + cXMLTVEvent *SearchXMLTVEvent(const char *EPGFile, const char *ChannelID, const cEvent *event); + void UpdateXMLTVEvent(const char *EPGFile, sqlite3 *db, const char *Source, tEventID EventID, + tEventID EITEventID, const char *EITDescription=NULL); + cXMLTVEvent *AddXMLTVEvent(const char *EPGFile, const char *ChannelID, const cEvent *Event, + const char *EITDescription); +}; + +#endif |