summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY8
-rw-r--r--status.c66
-rw-r--r--xml/string.c2
-rw-r--r--xml/string.h5
4 files changed, 78 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index e861639..0c8913a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,14 @@
VDR Plugin 'text2skin' Revision History
---------------------------------------
+2005-10-22: Version 1.1-cvs_ext-0.1 (vdr-text2skin-1.1-cvs_ext-0.1.diff)
+
+- added several tokens:
+ NextTimerName, NextTimerStart, NextTimerChannel, TimerConflict,
+ CurrentRecordingsCount, using the service "CheckTimerConflict-v1.0" to
+ check timer conflicts. A patch for the timeline-plugin is included in
+ Enigma-0.4pre2 (timeline_CheckTimerConflictService-0.1.diff)
+
2005-06-xx: Version 1.1
- fixed crash due to uninitialized pointer (thanks to Frank Enderle)
diff --git a/status.c b/status.c
index 9052267..16ce124 100644
--- a/status.c
+++ b/status.c
@@ -4,6 +4,8 @@
#include "status.h"
#include "render.h"
+#include <vdr/timers.h>
+#include <vdr/plugin.h>
const std::string ReplayNames[__REPLAY_COUNT__] =
{ "", "normal", "mp3", "mplayer", "dvd", "vcd", "image" };
@@ -117,7 +119,67 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
switch (Token.Type) {
case tReplayMode:
return ReplayNames[mReplayMode];
-
+
+ case tNextTimerName:
+ {
+ cTimer *tim = Timers.GetNextActiveTimer();
+ if (tim)
+ {
+ const char *timText = tim->File();
+ return timText;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ case tNextTimerStart:
+ {
+ cTimer *tim = Timers.GetNextActiveTimer();
+ if (tim)
+ {
+ char *buffer = NULL;
+ asprintf(&buffer, "%02d:%02d", tim->Start() / 100, tim->Start() % 100);
+ return buffer;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ case tNextTimerChannel:
+ {
+ cTimer *tim = Timers.GetNextActiveTimer();
+ if (tim)
+ {
+ const char *timChan = tim->Channel()->Name();
+ return timChan;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ case tTimerConflict:
+ {
+ bool conflict = false;
+
+ if (cPluginManager::CallFirstService("CheckTimerConflict-v1.0", &conflict) )
+ {
+ return conflict;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ case tCurrentRecordingsCount:
+ return (int)mRecordings.size();
+
case tCurrentRecording:
Dprintf("token attrib type is: %d, number: %d\n", Token.Attrib.Type, Token.Attrib.Number);
if (Token.Attrib.Type == aNumber) {
@@ -127,7 +189,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
} else if (mRecordings.size() > 0) {
mRecordingsLock.Lock();
uint now = time_ms();
- if (mNextRecording == 0)
+ if (mNextRecording == 0)
mNextRecording = now + 2000;
else if (now >= mNextRecording) {
mCurrentRecording = (mCurrentRecording + 1) % mRecordings.size();
diff --git a/xml/string.c b/xml/string.c
index afc0c7a..845b766 100644
--- a/xml/string.c
+++ b/xml/string.c
@@ -10,7 +10,7 @@ static const char *Tokens[__COUNT_TOKEN__] = {
// Channel Display
"ChannelNumber", "ChannelName", "ChannelShortName", "ChannelBouquet", "ChannelPortal",
- "ChannelSource", "ChannelID", "PresentStartDateTime", "PresentVPSDateTime",
+ "ChannelSource", "ChannelID", "NextTimerName", "NextTimerStart", "NextTimerChannel", "TimerConflict", "CurrentRecordingsCount", "PresentStartDateTime", "PresentVPSDateTime",
"PresentEndDateTime", "PresentDuration", "PresentProgress", "PresentRemaining",
"PresentTitle", "PresentShortText", "PresentDescription", "FollowingStartDateTime",
"FollowingVPSDateTime", "FollowingEndDateTime", "FollowingDuration",
diff --git a/xml/string.h b/xml/string.h
index 7c3f30f..6c78373 100644
--- a/xml/string.h
+++ b/xml/string.h
@@ -24,6 +24,11 @@ enum exToken {
tChannelSource,
tTChannelID, // (name clash)
// next 9 also in Menu
+ tNextTimerName,
+ tNextTimerStart,
+ tNextTimerChannel,
+ tTimerConflict,
+ tCurrentRecordingsCount,
tPresentStartDateTime,
tPresentVPSDateTime,
tPresentEndDateTime,