summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brugger <brougs78@gmx.net>2005-11-19 12:00:00 +0100
committerThomas Günther <tom@toms-cafe.de>2009-06-03 01:03:47 +0200
commit662dd62488f6f842fe5d940e986f798abe1c7691 (patch)
tree0406592c45332e6ba26ed63f3bff91ab42d30b4a
parent71023584dc849dc3705c6db303878fd27e8704c7 (diff)
downloadvdr-plugin-text2skin-662dd62488f6f842fe5d940e986f798abe1c7691.tar.gz
vdr-plugin-text2skin-662dd62488f6f842fe5d940e986f798abe1c7691.tar.bz2
2005-11-19: Version 1.1-cvs_ext-0.2 (vdr-text2skin-1.1-cvs_ext-0.2.diff)
- removed the previously introduced tokens NextTimerName, NextTimerStart, NextTimerChannel, CurrentRecordingsCount and 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 (not activated yet) - additional recording-tokens: RecordingVideoAR, RecordingSize - added a reset for scrolling text (configurable) - included Text2skin.diff from the rotor-plugin
-rw-r--r--HISTORY19
-rw-r--r--display.c222
-rw-r--r--i18n.c131
-rw-r--r--menu.c6
-rw-r--r--render.c22
-rw-r--r--render.h12
-rw-r--r--setup.c9
-rw-r--r--setup.h3
-rw-r--r--status.c271
-rw-r--r--status.h26
-rw-r--r--text2skin.c12
-rw-r--r--text2skin.h1
-rw-r--r--xml/object.c6
-rw-r--r--xml/object.h1
-rw-r--r--xml/string.c9
-rw-r--r--xml/string.h36
16 files changed, 711 insertions, 75 deletions
diff --git a/HISTORY b/HISTORY
index 0c8913a..634b500 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,25 @@
VDR Plugin 'text2skin' Revision History
---------------------------------------
+2005-11-19: Version 1.1-cvs_ext-0.2 (vdr-text2skin-1.1-cvs_ext-0.2.diff)
+
+- removed the previously introduced tokens NextTimerName, NextTimerStart,
+ NextTimerChannel, CurrentRecordingsCount and 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
+ (not activated yet)
+- additional recording-tokens:
+ RecordingVideoAR, RecordingSize
+- added a reset for scrolling text (configurable)
+- included Text2skin.diff from the rotor-plugin
+
2005-10-22: Version 1.1-cvs_ext-0.1 (vdr-text2skin-1.1-cvs_ext-0.1.diff)
- added several tokens:
diff --git a/display.c b/display.c
index a8fca2c..72b42cd 100644
--- a/display.c
+++ b/display.c
@@ -243,7 +243,16 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token)
case tLanguage: {
#if VDRVERSNUM >= 10318
- // TODO !!!
+ cDevice *dev = cDevice::PrimaryDevice();
+ eTrackType trackType = dev->GetCurrentAudioTrack();
+ const tTrackId *track = dev->GetTrack(trackType);
+ if (track)
+ {
+ std::string buffer(track->language);
+ if (trackType >= ttDolby) buffer.append("DD");
+ return (cxType)buffer.c_str();
+ }
+ return (cxType)false;
#else
int cur;
const char **tracks = cDevice::PrimaryDevice()->GetAudioTracks(&cur);
@@ -584,6 +593,32 @@ cxType cText2SkinDisplayReplay::GetTokenData(const txToken &Token)
}
return false;
+ case tLanguage: {
+#if VDRVERSNUM >= 10318
+ cDevice *dev = cDevice::PrimaryDevice();
+ eTrackType trackType = dev->GetCurrentAudioTrack();
+ const tTrackId *track = dev->GetTrack(trackType);
+ if (track)
+ {
+ std::string buffer(track->language);
+ if (trackType >= ttDolby) buffer.append("DD");
+ return (cxType)buffer.c_str();
+ }
+ return (cxType)false;
+#else
+ int cur;
+ const char **tracks = cDevice::PrimaryDevice()->GetAudioTracks(&cur);
+ if (tracks) {
+ int i = 0;
+ while (tracks[i] != NULL)
+ ++i;
+ if (cur < i)
+ return tracks[cur];
+ }
+#endif
+ }
+ return false;
+
case tMessage:
return mText;
@@ -757,6 +792,9 @@ void cText2SkinDisplayMenu::SetTitle(const char *Title)
UpdateLock();
if (Title == NULL) Title = "";
if (mTitle != Title) {
+ mUpdate.timerConflict = true;
+ mUpdate.events = true;
+ mUpdate.resetMarquee = true;
mTitle = Title;
SetDirty();
}
@@ -1051,7 +1089,74 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
return mEvent != NULL
? (cxType)mEvent->Description()
: (cxType)false;
-
+
+ case tPresentLanguageCode:
+ if (mEvent)
+ {
+ const cComponents *components = mEvent->Components();
+ if (components)
+ {
+ int index = Token.Attrib.Number;
+
+ // don't return language-code for the video-stream
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) index++; // only audio-streams
+ if (i == index)
+ {
+ std::string buffer(c->language);
+ if (c->type == 1) buffer.append("MONO");
+ if (c->type == 2) buffer.append("DUAL");
+ if (c->type == 5) buffer.append("DD");
+ return (cxType)buffer.c_str();
+ }
+ }
+ }
+ }
+ return false;
+
+ case tPresentLanguageDescription:
+ if (mEvent)
+ {
+ const cComponents *components = mEvent->Components();
+ if (components)
+ {
+ int index = Token.Attrib.Number;
+
+ // don't return language-code for the video-stream
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) index++; // only audio-streams
+ if (i == index) return (cxType)c->description;
+ }
+ }
+ }
+ return false;
+
+ case tPresentVideoAR:
+ if (mEvent)
+ {
+ const cComponents *components = mEvent->Components();
+ if (components)
+ {
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream == 1)
+ {
+ switch (c->type)
+ {
+ case 1: return "4:3";
+ case 3: return "16:9";
+ }
+ }
+ }
+ }
+ }
+ return false;
+
case tHasVPS:
case tChannelHasVPS:
return mEvent != NULL && mEvent->Vps() != 0;
@@ -1096,27 +1201,112 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
? (cxType)mRecording->Info()->Description()
: (cxType)false;
- case tRecordingLanguageCode:
- if (mRecording != NULL) {
- const tComponent *c
- = mRecording->Info()->Components()->Component(Token.Attrib.Number);
- return c != NULL
- ? (cxType)c->language
- : (cxType)false;
+ case tRecordingLanguageCode:
+ if (mRecording)
+ {
+ const cComponents *components = mRecording->Info()->Components();
+ if (components)
+ {
+ int index = Token.Attrib.Number;
+
+ // don't return language-code for the video-stream
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) index++; // only audio-streams
+ if (i == index)
+ {
+ std::string buffer(c->language);
+ if (c->type == 1) buffer.append("MONO");
+ if (c->type == 2) buffer.append("DUAL");
+ if (c->type == 5) buffer.append("DD");
+ return (cxType)buffer.c_str();
+ }
+ }
+ }
}
return false;
-
+
case tRecordingLanguageDescription:
- if (mRecording != NULL) {
- const tComponent *c
- = mRecording->Info()->Components()->Component(Token.Attrib.Number);
- return c != NULL
- ? (cxType)c->description
- : (cxType)false;
+ if (mRecording)
+ {
+ const cComponents *components = mRecording->Info()->Components();
+ if (components)
+ {
+ int index = Token.Attrib.Number;
+
+ // don't return language-code for the video-stream
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) index++; // only audio-streams
+ if (i == index) return (cxType)c->description;
+ }
+ }
+ }
+ return false;
+
+ case tRecordingVideoAR:
+ if (mRecording)
+ {
+ const cComponents *components = mRecording->Info()->Components();
+ if (components)
+ {
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream == 1)
+ {
+ switch (c->type)
+ {
+ case 1: return "4:3";
+ case 3: return "16:9";
+ }
+ }
+ }
+ }
}
return false;
#endif
+ case tRecordingSize:
+ if (mRecording != NULL) {
+ bool bRet=false;
+ long long size = 0;
+ int nFiles;
+ struct stat fileinfo; // Holds file information structure
+ char *cmd = NULL;
+ cReadLine reader;
+ asprintf(&cmd, "find '%s' -follow -type f -name '*.*'|sort ", mRecording->FileName());
+
+ FILE *p = popen(cmd, "r");
+ int ret=0;
+ if (p)
+ {
+ char *s;
+
+ while ((s = reader.Read(p)) != NULL)
+ {
+ if ((ret=stat(s, &fileinfo)) != -1)
+ {
+ size += (long long)fileinfo.st_size;
+ nFiles++;
+ }
+ }
+
+ bRet=true;
+ }
+
+ pclose(p);
+ delete cmd;
+
+ return (long)(size / 1024 / 1024); // [MB]
+ }
+ else
+ {
+ return false;
+ }
+
default:
return cText2SkinRender::GetTokenData(Token);
}
diff --git a/i18n.c b/i18n.c
index c8a0fdc..ab583fc 100644
--- a/i18n.c
+++ b/i18n.c
@@ -79,15 +79,140 @@ const tI18nPhrase Phrases[] = {
"",
#endif
},
- { "Flushing image cache...",
- "Bildspeicher wird geleert...",
+ { "Flush image cache",
+ "Bildspeicher leeren",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "Tyhjennä kuvat välimuistista",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+#if VDRVERSNUM >= 10313
+ "",
+#endif
+#if VDRVERSNUM >= 10316
+ "",
+#endif
+ },
+ { "Scrolling behaviour",
+ "Scroll-Verhalten",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+#if VDRVERSNUM >= 10313
+ "",
+#endif
+#if VDRVERSNUM >= 10316
+ "",
+#endif
+ },
+ { "Reset Marquee for new item",
+ "Marquee für neues Item zurücksetzen",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+#if VDRVERSNUM >= 10313
+ "",
+#endif
+#if VDRVERSNUM >= 10316
+ "",
+#endif
+ },
+ { "Use 'timeline' to check timer-conflicts",
+ "Timerkonflikte mit 'timeline' überprüfen",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+#if VDRVERSNUM >= 10313
+ "",
+#endif
+#if VDRVERSNUM >= 10316
+ "",
+#endif
+ },
+ { "to the left",
+ "nach links",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+#if VDRVERSNUM >= 10313
+ "",
+#endif
+#if VDRVERSNUM >= 10316
+ "",
+#endif
+ },
+ { "left and right",
+ "links und rechts",
+ "",
"",
"",
"",
"",
"",
"",
- "Tyhjennetään välimuistia...",
"",
"",
"",
diff --git a/menu.c b/menu.c
index 6bc478d..8ccaf58 100644
--- a/menu.c
+++ b/menu.c
@@ -9,6 +9,9 @@
cText2SkinSetupPage::cText2SkinSetupPage(void) {
mData = Text2SkinSetup;
+ Add(new cMenuEditBoolItem(tr("Scrolling behaviour"), &mData.MarqueeLeftRight, tr("to the left"), tr("left and right")));
+ Add(new cMenuEditBoolItem(tr("Reset Marquee for new item"), &mData.MarqueeReset, tr("no"), tr("yes")));
+ Add(new cMenuEditBoolItem(tr("Use 'timeline' to check timer-conflicts"), &mData.CheckTimerConflict, tr("no"), tr("yes")));
Add(new cOsdItem(tr("Flush image cache"), osUser1));
Add(new cMenuEditIntItem(tr("Max. image cache size"), &mData.MaxCacheFill));
}
@@ -17,6 +20,9 @@ cText2SkinSetupPage::~cText2SkinSetupPage() {
}
void cText2SkinSetupPage::Store(void) {
+ SetupStore("MarqueeLeftRight", mData.MarqueeLeftRight);
+ SetupStore("MarqueeReset", mData.MarqueeReset);
+ SetupStore("CheckTimerConflict", mData.CheckTimerConflict);
SetupStore("MaxCacheFill", mData.MaxCacheFill);
Text2SkinSetup = mData;
}
diff --git a/render.c b/render.c
index 3d3b4d7..4c15f26 100644
--- a/render.c
+++ b/render.c
@@ -11,6 +11,7 @@
#include "screen.h"
#include "display.h"
#include "scroller.h"
+#include "setup.h"
#include "xml/display.h"
#include <vdr/channels.h>
#include <vdr/epg.h>
@@ -353,13 +354,30 @@ void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const
uint Delay, uint Index)
{
bool scrolling = Font->Width(Text.c_str()) > Size.w;
-
+
tState &state = mStates[Index];
if (state.text != Text) {
state = tState();
state.text = Text;
}
+ if (Text2SkinSetup.MarqueeReset && mUpdate.resetMarquee && mUpdate.currentItem.find(Text, 0) != std::string::npos)
+ {
+ state.offset = 0;
+ state.direction = 1;
+ state.nexttime = 0;
+ state.scrolling = false;
+ mUpdate.foundFirstItem = true;
+ }
+ else
+ {
+ if (mUpdate.foundFirstItem)
+ {
+ mUpdate.resetMarquee = false;
+ mUpdate.foundFirstItem = false;
+ }
+ }
+
if (state.nexttime == 0)
state.nexttime = mNow + 1500;
else if (mNow >= state.nexttime) {
@@ -376,7 +394,7 @@ void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const
++state.direction;
nextin = 1500;
} else
- --state.offset;
+ Text2SkinSetup.MarqueeLeftRight ? --state.offset : state.offset = 0;
}
state.nexttime = mNow + nextin;
}
diff --git a/render.h b/render.h
index 6797e1a..b0e50cf 100644
--- a/render.h
+++ b/render.h
@@ -134,6 +134,18 @@ public:
static bool ItemColor(const std::string &Color, tColor &Result);
static std::string ImagePath(const std::string &Filename);
static cxType GetToken(const txToken &Token);
+
+ // update infos
+ struct tUpdate
+ {
+ bool timerConflict;
+ bool events;
+ std::string currentItem;
+ bool resetMarquee;
+ bool foundFirstItem;
+
+ tUpdate(void) : timerConflict(true), events(true), currentItem(""), resetMarquee(true), foundFirstItem(false) {}
+ } mUpdate;
};
inline void cText2SkinRender::Flush(bool Force)
diff --git a/setup.c b/setup.c
index 575bda6..504c4e4 100644
--- a/setup.c
+++ b/setup.c
@@ -9,12 +9,19 @@ cText2SkinSetup Text2SkinSetup;
// --- cText2SkinSetup --------------------------------------------------------
cText2SkinSetup::cText2SkinSetup(void) {
+ MarqueeLeftRight = true;
+ MarqueeReset = false;
+ CheckTimerConflict = false;
MaxCacheFill = 25;
}
bool cText2SkinSetup::SetupParse(const char *Name, const char *Value) {
- if (strcmp(Name, "MaxCacheFill") == 0) MaxCacheFill = atoi(Value);
+ if (strcmp(Name, "MarqueeLeftRight") == 0) MarqueeLeftRight = atoi(Value);
+ else if (strcmp(Name, "MarqueeReset") == 0) MarqueeReset = atoi(Value);
+ else if (strcmp(Name, "CheckTimerConflict") == 0) CheckTimerConflict = atoi(Value);
+ else if (strcmp(Name, "MaxCacheFill") == 0) MaxCacheFill = atoi(Value);
else return false;
+
return true;
}
diff --git a/setup.h b/setup.h
index bf9e8e1..a21b15e 100644
--- a/setup.h
+++ b/setup.h
@@ -13,6 +13,9 @@ public:
bool SetupParse(const char *Name, const char *Value);
+ int MarqueeLeftRight;
+ int MarqueeReset;
+ int CheckTimerConflict;
int MaxCacheFill;
};
diff --git a/status.c b/status.c
index 16ce124..8e376b3 100644
--- a/status.c
+++ b/status.c
@@ -4,6 +4,7 @@
#include "status.h"
#include "render.h"
+#include "menu.h"
#include <vdr/timers.h>
#include <vdr/plugin.h>
@@ -52,8 +53,11 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name)
mReplayIsShuffle = Name[2] == 'S';
}
}
- else if (GetRecordingByName(Name) != NULL)
- mReplayMode = replayNormal;
+ else if (const cRecording *rec = GetRecordingByName(Name))
+ {
+ mReplay = rec;
+ mReplayMode = replayNormal;
+ }
else if (strcmp(Name, "DVD") == 0)
mReplayMode = replayDVD;
else if (strcmp(Name, "VCD") == 0)
@@ -114,72 +118,245 @@ void cText2SkinStatus::OsdClear(void)
}
}
+void cText2SkinStatus::OsdCurrentItem(const char *Text)
+{
+ if (mRender != NULL)
+ {
+ static std::string lastItem;
+
+ lastItem = mRender->mUpdate.currentItem;
+ mRender->mUpdate.currentItem = Text;
+ mRender->mUpdate.resetMarquee = true;
+ mRender->mUpdate.foundFirstItem = false;
+ }
+}
+
+void cText2SkinStatus::UpdateEvents(void)
+{
+ if (mRender->mUpdate.events)
+ {
+ mRender->mUpdate.events = false;
+
+ mEvents.clear();
+ Timers.IncBeingEdited();
+
+ for (cTimer *tim = Timers.First(); tim != NULL; tim = Timers.Next(tim))
+ {
+ if (tim->HasFlags(tfActive))
+ {
+ int i = 0;
+ cTimer dummy;
+ dummy = *tim; // copy the timer
+
+ do
+ {
+ tEvent ev;
+
+ ev.title = dummy.File();
+ ev.isRecording = dummy.Recording();
+ ev.channelName = dummy.Channel()->Name();
+ ev.channelNumber = dummy.Channel()->Number();
+ ev.startTime = dummy.StartTime();
+ ev.stopTime = dummy.StopTime();
+ ev.priority = dummy.Priority();
+
+ mEvents.push_back(ev);
+
+ if (!dummy.IsSingleEvent()) // add 4 additional rep. timer
+ {
+ do
+ {
+ dummy.Skip();
+ dummy.Matches(); // Refresh start- and end-time
+ } while (!dummy.DayMatches(dummy.Day()));
+ }
+
+ i++;
+ } while (!dummy.IsSingleEvent() && i < 5);
+ }
+ }
+
+ Timers.DecBeingEdited();
+ std::sort(mEvents.rbegin(), mEvents.rend());
+ }
+}
+
cxType cText2SkinStatus::GetTokenData(const txToken &Token)
{
+ uint event = 0;
+
switch (Token.Type) {
case tReplayMode:
return ReplayNames[mReplayMode];
-
- case tNextTimerName:
+
+ case tCurrentEventsTitle3:
+ event++;
+ case tCurrentEventsTitle2:
+ event++;
+ case tCurrentEventsTitle1:
+ UpdateEvents();
+ return mEvents.size() > event
+ ? (cxType)mEvents[event].title.c_str()
+ : (cxType)false;
+
+ case tCurrentEventsStartDateTime3:
+ event++;
+ case tCurrentEventsStartDateTime2:
+ event++;
+ case tCurrentEventsStartDateTime1:
+ UpdateEvents();
+ return mEvents.size() > event
+ ? (cxType)TimeType(mEvents[event].startTime, Token.Attrib.Text)
+ : (cxType)false;
+
+ case tCurrentEventsStopDateTime3:
+ event++;
+ case tCurrentEventsStopDateTime2:
+ event++;
+ case tCurrentEventsStopDateTime1:
+ UpdateEvents();
+ return mEvents.size() > event
+ ? (cxType)TimeType(mEvents[event].stopTime, Token.Attrib.Text)
+ : (cxType)false;
+
+ case tCurrentEventsChannelNumber3:
+ event++;
+ case tCurrentEventsChannelNumber2:
+ event++;
+ case tCurrentEventsChannelNumber1:
+ UpdateEvents();
+ return mEvents.size() > event
+ ? (cxType)mEvents[event].channelNumber
+ : (cxType)false;
+
+ case tCurrentEventsChannelName3:
+ event++;
+ case tCurrentEventsChannelName2:
+ event++;
+ case tCurrentEventsChannelName1:
+ UpdateEvents();
+ return mEvents.size() > event
+ ? (cxType)mEvents[event].channelName.c_str()
+ : (cxType)false;
+
+ case tCurrentEventsIsRecording3:
+ event++;
+ case tCurrentEventsIsRecording2:
+ event++;
+ case tCurrentEventsIsRecording1:
+ UpdateEvents();
+ return mEvents.size() > event
+ ? (cxType)mEvents[event].isRecording
+ : (cxType)false;
+
+ case tTimerConflict:
+ if (Text2SkinSetup.CheckTimerConflict)
{
- cTimer *tim = Timers.GetNextActiveTimer();
- if (tim)
- {
- const char *timText = tim->File();
- return timText;
- }
- else
+ bool conflict;
+
+ if (mRender->mUpdate.timerConflict)
{
- return false;
+ mRender->mUpdate.timerConflict = false;
+
+ if (cPluginManager::CallFirstService("CheckTimerConflict-v1.0", &conflict) )
+ {
+ mTimerConflict = conflict;
+ }
+ else
+ {
+ mTimerConflict = false;
+ }
}
+
+ return mTimerConflict;
}
-
- case tNextTimerStart:
+ else
{
- cTimer *tim = Timers.GetNextActiveTimer();
- if (tim)
- {
- char *buffer = NULL;
- asprintf(&buffer, "%02d:%02d", tim->Start() / 100, tim->Start() % 100);
- return buffer;
- }
- else
- {
- return false;
- }
+ return false;
}
- case tNextTimerChannel:
+ case tReplayName:
+ return mReplay != NULL
+ ? (cxType)mReplay->Name()
+ : (cxType)false;
+
+ case tReplayDateTime:
+ return mReplay != NULL
+ ? (cxType)TimeType(mReplay->start, Token.Attrib.Text)
+ : (cxType)false;
+
+ case tReplayShortText:
+ return mReplay != NULL
+ ? (cxType)mReplay->Info()->ShortText()
+ : (cxType)false;
+
+ case tReplayDescription:
+ return mReplay != NULL
+ ? (cxType)mReplay->Info()->Description()
+ : (cxType)false;
+
+ case tReplayLanguageCode:
+ if (mReplay)
{
- cTimer *tim = Timers.GetNextActiveTimer();
- if (tim)
- {
- const char *timChan = tim->Channel()->Name();
- return timChan;
- }
- else
+ const cComponents *components = mReplay->Info()->Components();
+ if (components)
{
- return false;
+ int index = Token.Attrib.Number;
+
+ // don't return language-code for the video-stream
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) index++; // only audio-streams
+ if (i == index) return (cxType)c->language;
+ }
}
}
-
- case tTimerConflict:
+ return false;
+
+ case tReplayLanguageDescription:
+ if (mReplay)
{
- bool conflict = false;
-
- if (cPluginManager::CallFirstService("CheckTimerConflict-v1.0", &conflict) )
+ const cComponents *components = mReplay->Info()->Components();
+ if (components)
{
- return conflict;
+ int index = Token.Attrib.Number;
+
+ // don't return language-code for the video-stream
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) index++; // only audio-streams
+ if (i == index) return (cxType)c->description;
+ }
}
- else
+ }
+ return false;
+
+ /*
+ case tReplayVideoAR:
+ if (mReplay)
+ {
+ const cComponents *components = mReplay->Info()->Components();
+ if (components)
{
- return false;
+ for (int i = 0; i < components->NumComponents(); i++)
+ {
+ const tComponent *c = components->Component(i);
+ if (c->stream == 1)
+ {
+ switch (c->type)
+ {
+ case 1: return "4:3";
+ case 3: return "16:9";
+ }
+ }
+ }
}
}
-
- case tCurrentRecordingsCount:
- return (int)mRecordings.size();
-
+ return false;
+ */
+
case tCurrentRecording:
Dprintf("token attrib type is: %d, number: %d\n", Token.Attrib.Type, Token.Attrib.Number);
if (Token.Attrib.Type == aNumber) {
@@ -189,7 +366,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/status.h b/status.h
index 0aacd70..92c06de 100644
--- a/status.h
+++ b/status.h
@@ -27,21 +27,47 @@ public:
typedef std::string tRecordingInfo;
typedef std::vector<tRecordingInfo> tRecordings;
+ struct tEvent
+ {
+ std::string title;
+ bool isRecording;
+ std::string channelName;
+ int channelNumber;
+ time_t startTime;
+ time_t stopTime;
+ int priority;
+
+ bool tEvent::operator< (const tEvent &b) const
+ {
+ int r = startTime - b.startTime;
+ r = r == 0 ? b.priority - priority : r;
+ return r > 0 ? true : false;
+ };
+ };
+
+ typedef std::vector<tEvent> tEvents;
+
private:
+ void UpdateEvents(void);
+
cText2SkinRender *mRender;
eReplayMode mReplayMode;
bool mReplayIsLoop;
bool mReplayIsShuffle;
tRecordings mRecordings;
+ tEvents mEvents;
+ const cRecording *mReplay;
cMutex mRecordingsLock;
uint mCurrentRecording;
uint mNextRecording;
int mLastLanguage;
+ bool mTimerConflict;
protected:
virtual void Replaying(const cControl *Control, const char *Name);
virtual void Recording(const cDevice *Device, const char *Name);
virtual void OsdClear(void);
+ virtual void OsdCurrentItem(const char *Text);
public:
cText2SkinStatus(void);
diff --git a/text2skin.c b/text2skin.c
index be63af4..6ca80d0 100644
--- a/text2skin.c
+++ b/text2skin.c
@@ -12,6 +12,7 @@
#include "i18n.h"
#include "loader.h"
#include "status.h"
+#include "xml/object.h"
const char *cText2SkinPlugin::VERSION = "1.1-cvs";
const char *cText2SkinPlugin::SKINVERSION = "1.0";
@@ -23,6 +24,17 @@ cText2SkinPlugin::cText2SkinPlugin(void) {
cText2SkinPlugin::~cText2SkinPlugin() {
}
+bool cText2SkinPlugin::Service(const char *Id, void *Data)
+{
+ if (strcmp(Id,"Text2Skin-TTF") == 0) {
+ if (Data == NULL)
+ return true;
+ cxObject::UseTTF = *(int*)Data;
+ return true;
+ }
+ return false;
+}
+
bool cText2SkinPlugin::Start(void) {
RegisterI18n(Phrases);
Text2SkinStatus.SetLanguage(Setup.OSDLanguage);
diff --git a/text2skin.h b/text2skin.h
index b40ea54..e67366c 100644
--- a/text2skin.h
+++ b/text2skin.h
@@ -21,6 +21,7 @@ public:
virtual ~cText2SkinPlugin();
virtual const char *Version(void) { return VERSION; }
virtual const char *Description(void) { return tr(DESCRIPTION); }
+ virtual bool Service(const char *Id, void *Data);
virtual bool Start(void);
virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *Name, const char *Value);
diff --git a/xml/object.c b/xml/object.c
index 6ea0ab6..73d8a26 100644
--- a/xml/object.c
+++ b/xml/object.c
@@ -140,10 +140,14 @@ const std::string &cxObject::TypeName(void) const
return ObjectNames[mType];
}
+int cxObject::UseTTF = true;
+
const cFont *cxObject::Font(void) const
{
const cFont *font;
+ if (UseTTF) {
+
if ((font = cText2SkinFont::Load(SkinPath() + "/fonts", mFontFace, mFontSize, mFontWidth))
!= NULL)
return font;
@@ -152,6 +156,8 @@ const cFont *cxObject::Font(void) const
mFontWidth)) != NULL)
return font;
+ }
+
return cFont::GetFont(fontOsd);
}
diff --git a/xml/object.h b/xml/object.h
index bbc37a0..96cdd14 100644
--- a/xml/object.h
+++ b/xml/object.h
@@ -45,6 +45,7 @@ class cxObject {
friend class VSkinnerItem;
public:
+ static int UseTTF;
enum eType {
image,
text,
diff --git a/xml/string.c b/xml/string.c
index 845b766..c64fbb1 100644
--- a/xml/string.c
+++ b/xml/string.c
@@ -10,8 +10,12 @@ static const char *Tokens[__COUNT_TOKEN__] = {
// Channel Display
"ChannelNumber", "ChannelName", "ChannelShortName", "ChannelBouquet", "ChannelPortal",
- "ChannelSource", "ChannelID", "NextTimerName", "NextTimerStart", "NextTimerChannel", "TimerConflict", "CurrentRecordingsCount", "PresentStartDateTime", "PresentVPSDateTime",
+ "ChannelSource", "ChannelID", "PresentStartDateTime", "PresentVPSDateTime",
+ "CurrentEventsTitle1", "CurrentEventsStartDateTime1", "CurrentEventsStopDateTime1", "CurrentEventsChannelNumber1", "CurrentEventsChannelName1", "CurrentEventsIsRecording1", "CurrentEventsTitle2", "CurrentEventsStartDateTime2", "CurrentEventsStopDateTime2", "CurrentEventsChannelNumber2", "CurrentEventsChannelName2", "CurrentEventsIsRecording2",
+ "CurrentEventsTitle3", "CurrentEventsStartDateTime3", "CurrentEventsStopDateTime3", "CurrentEventsChannelNumber3", "CurrentEventsChannelName3", "CurrentEventsIsRecording3",
+ "TimerConflict",
"PresentEndDateTime", "PresentDuration", "PresentProgress", "PresentRemaining",
+ "PresentLanguageCode", "PresentLanguageDescription", "PresentVideoAR",
"PresentTitle", "PresentShortText", "PresentDescription", "FollowingStartDateTime",
"FollowingVPSDateTime", "FollowingEndDateTime", "FollowingDuration",
"FollowingTitle", "FollowingShortText", "FollowingDescription", "Language",
@@ -30,6 +34,8 @@ static const char *Tokens[__COUNT_TOKEN__] = {
// Replay Display
"ReplayTitle", "ReplayPositionIndex", "ReplayDurationIndex", "ReplayPrompt",
+ "ReplayName", "ReplayDateTime", "ReplayShortText", "ReplayDescription",
+ "ReplayLanguageCode", "ReplayLanguageDescription", "ReplayVideoAR",
"IsPlaying", "ReplayIsPlaying", "IsFastForward", "ReplayIsFastForward", "IsFastRewind",
"ReplayIsFastRewind", "IsSlowForward", "ReplayIsSlowForward", "IsSlowRewind",
"ReplayIsSlowRewind", "IsPausing", "ReplayIsPausing",
@@ -40,6 +46,7 @@ static const char *Tokens[__COUNT_TOKEN__] = {
"MenuTitle", "MenuGroup", "IsMenuGroup", "MenuItem", "IsMenuItem", "MenuCurrent",
"IsMenuCurrent", "MenuText", "RecordingName", "RecordingDateTime", "RecordingTitle",
"RecordingShortText", "RecordingDescription", "RecordingLanguageCode",
+ "RecordingVideoAR", "RecordingSize",
"RecordingLanguageDescription", "ButtonRed", "ButtonGreen",
"ButtonYellow", "ButtonBlue", "CanScrollUp", "CanScrollDown"
};
diff --git a/xml/string.h b/xml/string.h
index 6c78373..8b3d4a4 100644
--- a/xml/string.h
+++ b/xml/string.h
@@ -24,17 +24,34 @@ enum exToken {
tChannelSource,
tTChannelID, // (name clash)
// next 9 also in Menu
- tNextTimerName,
- tNextTimerStart,
- tNextTimerChannel,
- tTimerConflict,
- tCurrentRecordingsCount,
tPresentStartDateTime,
tPresentVPSDateTime,
+ tCurrentEventsTitle1,
+ tCurrentEventsStartDateTime1,
+ tCurrentEventsStopDateTime1,
+ tCurrentEventsChannelNumber1,
+ tCurrentEventsChannelName1,
+ tCurrentEventsIsRecording1,
+ tCurrentEventsTitle2,
+ tCurrentEventsStartDateTime2,
+ tCurrentEventsStopDateTime2,
+ tCurrentEventsChannelNumber2,
+ tCurrentEventsChannelName2,
+ tCurrentEventsIsRecording2,
+ tCurrentEventsTitle3,
+ tCurrentEventsStartDateTime3,
+ tCurrentEventsStopDateTime3,
+ tCurrentEventsChannelNumber3,
+ tCurrentEventsChannelName3,
+ tCurrentEventsIsRecording3,
+ tTimerConflict,
tPresentEndDateTime,
tPresentDuration,
tPresentProgress,
tPresentRemaining,
+ tPresentLanguageCode,
+ tPresentLanguageDescription,
+ tPresentVideoAR,
tPresentTitle,
tPresentShortText,
tPresentDescription,
@@ -90,6 +107,13 @@ enum exToken {
tReplayPositionIndex,
tReplayDurationIndex,
tReplayPrompt,
+ tReplayName,
+ tReplayDateTime,
+ tReplayShortText,
+ tReplayDescription,
+ tReplayLanguageCode,
+ tReplayLanguageDescription,
+ tReplayVideoAR,
tIsPlaying,
tReplayIsPlaying, // alias
tIsFastForward,
@@ -125,6 +149,8 @@ enum exToken {
tRecordingShortText,
tRecordingDescription,
tRecordingLanguageCode,
+ tRecordingVideoAR,
+ tRecordingSize,
tRecordingLanguageDescription,
// next four also in Channel and Replay display (if supported by vdr/plugin)
tButtonRed,