diff options
author | Andreas Brugger <brougs78@gmx.net> | 2005-10-22 12:00:00 +0200 |
---|---|---|
committer | Thomas Günther <tom@toms-cafe.de> | 2009-06-03 00:54:05 +0200 |
commit | 71023584dc849dc3705c6db303878fd27e8704c7 (patch) | |
tree | df6f44ec265c3e19b28c624a8d1ea737e6b80c75 /status.c | |
parent | 9ed162fa14e348bf9660f393d24b36d0a8492a67 (diff) | |
download | vdr-plugin-text2skin-71023584dc849dc3705c6db303878fd27e8704c7.tar.gz vdr-plugin-text2skin-71023584dc849dc3705c6db303878fd27e8704c7.tar.bz2 |
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)
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 66 |
1 files changed, 64 insertions, 2 deletions
@@ -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(); |