diff options
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -9,6 +9,7 @@ #include <string> #include <vdr/osd.h> #include <vdr/config.h> +#include <vdr/epg.h> // from recording.h (VDR <= 1.7.2) #define FRAMESPERSEC 25 @@ -27,6 +28,9 @@ # define Ddiff(t,x) #endif +#define DStartBench(x) uint64_t bench_##x = time_ms() +#define DShowBench(t,x) fprintf(stderr, "%s took %llu ms\n", t, time_ms() - bench_##x) + #if VDRVERSNUM >= 10318 # define time_ms() cTimeMs::Now() # define Apid1() Apid(0) @@ -50,10 +54,20 @@ const std::string &SkinPath(void); const char *ChannelNumber(const cChannel *Channel, int Number); const char *ChannelName(const cChannel *Channel, int Number); const char *ChannelShortName(const cChannel *Channel, int Number); +const char *EventType(uint Number); //const char *ChannelBouquet(const cChannel *Channel, int Number); bool StoppedTimer(const char *Name); const cRecording *GetRecordingByName(const char *Name); +const cRecording *GetRecordingByFileName(const char *FileName); +int GetFrontendSTR(void); // Signal strength [%] +int GetFrontendSNR(void); // Signal to Noise ratio [%] +bool GetFrontendHasLock(void); +bool GetFrontendHasSignal(void); +std::string AddExtInfoToDescription(const char *Title, const char *ShortText, const char *Description, const char *Aux = NULL, bool StripAux = false); +int GetRecordingSize(const char *FileName); // [MB] +int GetRecordingLength(const char *FileName); // [min] +int GetRecordingCuttedLength(const char *FileName); // [min] cxType TimeType(time_t Time, const std::string &Format); cxType DurationType(uint Index, const std::string &Format); @@ -62,5 +76,37 @@ bool ParseVar(const char *Text, const char *Name, std::string &Value); bool ParseVar(const char *Text, const char *Name, tColor *Value); void SkipQuotes(std::string &Value); +std::string FitToWidth(std::string &Line, uint Width); +std::string FitToWidth(std::stringstream &Line, uint Width); +std::string StripXmlTag(std::string &Line, const char *Tag); + +// Data structure for service "Epgsearch-searchresults-v1.0" +struct Epgsearch_searchresults_v1_0 { +// in + char* query; // search term + int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression) + int channelNr; // channel number to search in (0=any) + bool useTitle; // search in title + bool useSubTitle; // search in subtitle + bool useDescription; // search in description +// out + + class cServiceSearchResult : public cListObject { + public: + const cEvent* event; + cServiceSearchResult(const cEvent* Event) : event(Event) {} + }; + + cList<cServiceSearchResult>* pResultList; // pointer to the results +}; + +// Data structure for service "Epgsearch-lastconflictinfo-v1.0" +struct Epgsearch_lastconflictinfo_v1_0 { +// in +// out + time_t nextConflict; // next conflict date, 0 if none + int relevantConflicts; // number of relevant conflicts + int totalConflicts; // total number of conflicts +}; #endif // VDR_TEXT2SKIN_COMMON_H |