summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorAndreas Brugger <brougs78@gmx.net>2009-06-06 01:29:22 +0200
committerThomas Günther <tom@toms-cafe.de>2009-06-06 01:29:22 +0200
commit60cd7db51838bb076312fd10e08bca0f4a005f82 (patch)
tree2ce8a57369abbd1ac1fed4a0d6527140808fbc3c /common.h
parent5ace1ef884772e4a15d58839074785b89412c8ee (diff)
parentac64ce03ec6b5766691ff2da3af6f51ed800792a (diff)
downloadvdr-plugin-text2skin-60cd7db51838bb076312fd10e08bca0f4a005f82.tar.gz
vdr-plugin-text2skin-60cd7db51838bb076312fd10e08bca0f4a005f82.tar.bz2
Added brougs78-extensions (thanks to Andreas Brugger / references #39)
- added tokens for the next 3 timers: CurrentEventsTitle[123], CurrentEventsStartDateTime[123], CurrentEventsStopDateTime[123], CurrentEventsChannelNumber[123], CurrentEventsChannelName[123], CurrentEventsIsRecording[123] - added audio- and video-tokens: PresentLanguageCode, PresentLanguageDescription, PresentVideoAR and implemented the missing code for the Language-token - added tokens for replay: ReplayName, ReplayDateTime, ReplayShortText, ReplayDescription, ReplayLanguageCode, ReplayLanguageDescription, ReplayVideoAR - additional recording-tokens: RecordingVideoAR, RecordingSize - added a reset for scrolling text (configurable) - added recording-tokens: RecordingLength, RecordingCuttedLength - added tokens: OsdWidth, OsdHeight - switched the search-order for the fonts to priorise the skin-folder (this avoids error-messages in the log) - added the possibility to have a scrollbar in every menu - not fully implemented yet (to position in menu-lists is not necessarily correct, if there are more items with the same osd-text) - added a configuration option for showing the scrollbar in the menus - added token TimerConflicts using the service interface of the epgsearch plugin "Epgsearch-lastconflictinfo-v1.0" - added a test-feature to search for reruns of a program and add the information to the extended epg-info (trigger DEVELOPMENT_FEATURES). This uses a service interface of the epgsearch plugin "Epgsearch-searchresults-v1.0" - the extended epg-info and the recording-info are extended by AUX-Infos (configurable) there is also an option to strip known tags - the tab-widths are scaled for taking into account that different TT-Fonts have a different width than the default font from VDR - added tokens for signal-info: FrontendSTR, FrontendSNR, FrontendHasLock, FrontendHasSignal - added token PresentEventID for EPG-images - added tokens for recordings: RecordingFilename, RecordingPriority, RecordingLifetime - set EditableWidth. This is important for plugins like 'rotor' or 'extrecmenu'
Diffstat (limited to 'common.h')
-rw-r--r--common.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/common.h b/common.h
index ce87589..f596a01 100644
--- a/common.h
+++ b/common.h
@@ -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