From 71023584dc849dc3705c6db303878fd27e8704c7 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 22 Oct 2005 12:00:00 +0200 Subject: 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) --- status.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) (limited to 'status.c') 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 +#include 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(); -- cgit v1.2.3