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 From 662dd62488f6f842fe5d940e986f798abe1c7691 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 19 Nov 2005 12:00:00 +0100 Subject: 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 --- status.c | 271 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 224 insertions(+), 47 deletions(-) (limited to 'status.c') 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 #include @@ -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(); -- cgit v1.2.3 From bb39010021b5fd8a1046200839c678afc76227d5 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sun, 11 Dec 2005 12:00:00 +0100 Subject: 2005-12-11: Version 1.1-cvs_ext-0.3 (vdr-text2skin-1.1-cvs_ext-0.3.diff) - added recording-tokens: RecordingLength, RecordingCuttedLength --- status.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 8e376b3..f35f45c 100644 --- a/status.c +++ b/status.c @@ -7,6 +7,7 @@ #include "menu.h" #include #include +#include const std::string ReplayNames[__REPLAY_COUNT__] = { "", "normal", "mp3", "mplayer", "dvd", "vcd", "image" }; @@ -53,11 +54,11 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name) mReplayIsShuffle = Name[2] == 'S'; } } - else if (const cRecording *rec = GetRecordingByName(Name)) - { - mReplay = rec; - mReplayMode = replayNormal; - } + else if (const cRecording *rec = GetRecordingByFileName(cReplayControl::LastReplayed())) + { + mReplay = rec; + mReplayMode = replayNormal; + } else if (strcmp(Name, "DVD") == 0) mReplayMode = replayDVD; else if (strcmp(Name, "VCD") == 0) @@ -308,7 +309,13 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) { const tComponent *c = components->Component(i); if (c->stream != 2) index++; // only audio-streams - if (i == index) return (cxType)c->language; + { + 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(); + } } } } -- cgit v1.2.3 From eeda27b9d069161db0261f6e2f51ac9463bde910 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sun, 18 Dec 2005 12:00:00 +0100 Subject: 2005-12-18: Version 1.1-cvs_ext-0.4 (vdr-text2skin-1.1-cvs_ext-0.4.diff) - modified the way, the current replayed recording is determined (status.c: cText2SkinStatus::Replaying) There remains a problem that recordings with the same name cannot be distinguished, so information optained from mReplay are not necessarily correct (all the ones added in vdr-text2skin-1.1-cvs_ext-0.2.diff) --- status.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'status.c') diff --git a/status.c b/status.c index f35f45c..b23683a 100644 --- a/status.c +++ b/status.c @@ -53,12 +53,28 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name) mReplayIsLoop = Name[1] == 'L'; mReplayIsShuffle = Name[2] == 'S'; } - } + } + /* + I tried the following, but this is not thread-safe and it seems that + 'LastReplayed()' is not allways up to date, when cStatus::Replaying() + is called: + else if (const cRecording *rec = GetRecordingByFileName(cReplayControl::LastReplayed())) { mReplay = rec; mReplayMode = replayNormal; } + + so here is a temporary implementation which has the problem, that several + recordings with the same name cannot be seperated. This is deactivated + in Enigma (as it is more ore less useless), till there is a decent fix for + that. + */ + 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) -- cgit v1.2.3 From eb6eaf285edd82c212810f066313f93dc4a8a129 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 7 Jan 2006 12:00:00 +0100 Subject: 2006-01-07: Version 1.1-cvs_ext-0.5 (vdr-text2skin-1.1-cvs_ext-0.5.diff) - modifications to compile with vdr-versions >= 1.3.18 - added tokens: OsdWidth, OsdHeight - activating the token ReplayVideoAR --- status.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index b23683a..3df40ab 100644 --- a/status.c +++ b/status.c @@ -267,6 +267,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) : (cxType)false; case tTimerConflict: +#if VDRVERSNUM >= 10330 if (Text2SkinSetup.CheckTimerConflict) { bool conflict; @@ -291,7 +292,9 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) { return false; } - +#endif + +#if VDRVERSNUM >= 10325 case tReplayName: return mReplay != NULL ? (cxType)mReplay->Name() @@ -356,7 +359,6 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) } return false; - /* case tReplayVideoAR: if (mReplay) { @@ -378,7 +380,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) } } return false; - */ +#endif case tCurrentRecording: Dprintf("token attrib type is: %d, number: %d\n", Token.Attrib.Type, Token.Attrib.Number); -- cgit v1.2.3 From c1bf83aec2961a4e84dbc1c36042bd985f044a91 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 4 Feb 2006 11:49:02 +0100 Subject: 2006-02-04: Version 1.1-cvs_ext-0.7 (vdr-text2skin-1.1-cvs_ext-0.7.diff) - changed the routines to determine the next timers - 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) --- status.c | 92 ++++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 32 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 9155bf6..0616f7a 100644 --- a/status.c +++ b/status.c @@ -134,18 +134,56 @@ void cText2SkinStatus::OsdClear(void) mLastLanguage = Setup.OSDLanguage; cxString::Reparse(); } + + if (mRender != NULL) + { + mRender->mMenuScrollbar.total = 0; + } } void cText2SkinStatus::OsdCurrentItem(const char *Text) { if (mRender != NULL) { + // update infos + cText2SkinRender::tUpdate *u = &mRender->mUpdate; static std::string lastItem; - lastItem = mRender->mUpdate.currentItem; - mRender->mUpdate.currentItem = Text; - mRender->mUpdate.resetMarquee = true; - mRender->mUpdate.foundFirstItem = false; + lastItem = u->currentItem; + u->currentItem = Text; + u->resetMarquee = true; + u->foundFirstItem = false; + + // find current item in scrollbar + cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; + for (int i = 0; i < sb->total; i++) + { + if (sb->items[i] == Text) + { + sb->current = i; + break; + } + } + } +} + +void cText2SkinStatus::OsdItem(const char *Text, int Index) +{ + if (mRender != NULL) + { + cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; + + if ((unsigned int)Index < sb->items.size()) + { + sb->items[Index] = Text; + } + else + { + sb->items.push_back(Text); + sb->total = Index + 1; + } + + if (Index + 1 > sb->total) sb->total = Index + 1; } } @@ -155,31 +193,21 @@ void cText2SkinStatus::UpdateEvents(void) { mRender->mUpdate.events = false; - mEvents.clear(); + mEvents.Clear(); Timers.IncBeingEdited(); - for (cTimer *tim = Timers.First(); tim != NULL; tim = Timers.Next(tim)) + for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim)) { if (tim->HasFlags(tfActive)) { int i = 0; cTimer dummy; - dummy = *tim; // copy the timer + dummy = *tim; do { - tEvent ev; + mEvents.Add(new tEvent(&dummy)); - 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 @@ -195,13 +223,13 @@ void cText2SkinStatus::UpdateEvents(void) } Timers.DecBeingEdited(); - std::sort(mEvents.rbegin(), mEvents.rend()); + mEvents.Sort(); } } cxType cText2SkinStatus::GetTokenData(const txToken &Token) { - uint event = 0; + int event = 0; switch (Token.Type) { case tReplayMode: @@ -213,8 +241,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) event++; case tCurrentEventsTitle1: UpdateEvents(); - return mEvents.size() > event - ? (cxType)mEvents[event].title.c_str() + return mEvents.Count() > event + ? (cxType)mEvents.Get(event)->title.c_str() : (cxType)false; case tCurrentEventsStartDateTime3: @@ -223,8 +251,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) event++; case tCurrentEventsStartDateTime1: UpdateEvents(); - return mEvents.size() > event - ? (cxType)TimeType(mEvents[event].startTime, Token.Attrib.Text) + return mEvents.Count() > event + ? (cxType)TimeType(mEvents.Get(event)->startTime, Token.Attrib.Text) : (cxType)false; case tCurrentEventsStopDateTime3: @@ -233,8 +261,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) event++; case tCurrentEventsStopDateTime1: UpdateEvents(); - return mEvents.size() > event - ? (cxType)TimeType(mEvents[event].stopTime, Token.Attrib.Text) + return mEvents.Count() > event + ? (cxType)TimeType(mEvents.Get(event)->stopTime, Token.Attrib.Text) : (cxType)false; case tCurrentEventsChannelNumber3: @@ -243,8 +271,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) event++; case tCurrentEventsChannelNumber1: UpdateEvents(); - return mEvents.size() > event - ? (cxType)mEvents[event].channelNumber + return mEvents.Count() > event + ? (cxType)mEvents.Get(event)->channelNumber : (cxType)false; case tCurrentEventsChannelName3: @@ -253,8 +281,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) event++; case tCurrentEventsChannelName1: UpdateEvents(); - return mEvents.size() > event - ? (cxType)mEvents[event].channelName.c_str() + return mEvents.Count() > event + ? (cxType)mEvents.Get(event)->channelName.c_str() : (cxType)false; case tCurrentEventsIsRecording3: @@ -263,8 +291,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) event++; case tCurrentEventsIsRecording1: UpdateEvents(); - return mEvents.size() > event - ? (cxType)mEvents[event].isRecording + return mEvents.Count() > event + ? (cxType)mEvents.Get(event)->isRecording : (cxType)false; case tTimerConflict: -- cgit v1.2.3 From 8d32cf88bbe5b69a2710029cdaa896470a0fe20c Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 4 Feb 2006 18:25:22 +0100 Subject: 2006-02-04: Version 1.1-cvs_ext-0.8 (vdr-text2skin-1.1-cvs_ext-0.8.diff) - added a configuration option for showing the scrollbar in the menus and finished implementation --- status.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 0616f7a..95e4bec 100644 --- a/status.c +++ b/status.c @@ -155,13 +155,16 @@ void cText2SkinStatus::OsdCurrentItem(const char *Text) u->foundFirstItem = false; // find current item in scrollbar - cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; - for (int i = 0; i < sb->total; i++) + if (Text2SkinSetup.MenuScrollbar) { - if (sb->items[i] == Text) + cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; + for (uint i = 0; i < sb->total; i++) { - sb->current = i; - break; + if (sb->items[i] == Text) + { + sb->current = i; + break; + } } } } @@ -169,21 +172,22 @@ void cText2SkinStatus::OsdCurrentItem(const char *Text) void cText2SkinStatus::OsdItem(const char *Text, int Index) { - if (mRender != NULL) + if (mRender && Text2SkinSetup.MenuScrollbar) { + uint curr = (uint)Index; cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; - if ((unsigned int)Index < sb->items.size()) + if (curr < sb->items.size()) { - sb->items[Index] = Text; + sb->items[curr] = Text; } else { sb->items.push_back(Text); - sb->total = Index + 1; + sb->total = curr + 1; } - if (Index + 1 > sb->total) sb->total = Index + 1; + if (curr + 1 > sb->total) sb->total = curr + 1; } } -- cgit v1.2.3 From 74a5cc8e14900d48386e33cb576f154a6dd7e557 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sun, 19 Nov 2006 16:58:14 +0100 Subject: 2006-11-19: Version 1.1-cvs_ext-0.9 (vdr-text2skin-1.1-cvs_ext-0.9.diff) - 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 timer-conflicts are now checked with epgsearch (service-interface "Epgsearch-lastconflictinfo-v1.0", as it works more reliable and is supported by the plugin author - 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 - changed token TimerConflict to TimerConflicts - added token PresentEventID for EPG-images - added tokens for recordings: RecordingFilename, RecordingPriority, RecordingLifetime - removed Text2skin.diff from the rotor-plugin --- status.c | 64 +++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 29 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 95e4bec..35be7a5 100644 --- a/status.c +++ b/status.c @@ -143,13 +143,13 @@ void cText2SkinStatus::OsdClear(void) void cText2SkinStatus::OsdCurrentItem(const char *Text) { - if (mRender != NULL) + if (mRender && Text) { // update infos cText2SkinRender::tUpdate *u = &mRender->mUpdate; - static std::string lastItem; + //static std::string lastItem; - lastItem = u->currentItem; + //lastItem = u->currentItem; u->currentItem = Text; u->resetMarquee = true; u->foundFirstItem = false; @@ -172,7 +172,7 @@ void cText2SkinStatus::OsdCurrentItem(const char *Text) void cText2SkinStatus::OsdItem(const char *Text, int Index) { - if (mRender && Text2SkinSetup.MenuScrollbar) + if (mRender && Text2SkinSetup.MenuScrollbar && Text) { uint curr = (uint)Index; cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; @@ -214,11 +214,13 @@ void cText2SkinStatus::UpdateEvents(void) if (!dummy.IsSingleEvent()) // add 4 additional rep. timer { + int j = 0; do { + j++; // just to avoid a endless loop dummy.Skip(); dummy.Matches(); // Refresh start- and end-time - } while (!dummy.DayMatches(dummy.Day())); + } while (!dummy.DayMatches(dummy.StartTime()) && (j < 7)); } i++; @@ -238,7 +240,19 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) switch (Token.Type) { case tReplayMode: return ReplayNames[mReplayMode]; - + + case tFrontendSTR: + return GetFrontendSTR(); + + case tFrontendSNR: + return GetFrontendSNR(); + + case tFrontendHasLock: + return GetFrontendHasLock(); + + case tFrontendHasSignal: + return GetFrontendHasSignal(); + case tCurrentEventsTitle3: event++; case tCurrentEventsTitle2: @@ -299,34 +313,26 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) ? (cxType)mEvents.Get(event)->isRecording : (cxType)false; - case tTimerConflict: + case tTimerConflicts: #if VDRVERSNUM >= 10330 - if (Text2SkinSetup.CheckTimerConflict) - { - bool conflict; - - if (mRender->mUpdate.timerConflict) - { + if (Text2SkinSetup.CheckTimerConflict) { + if (mRender->mUpdate.timerConflict) { + Epgsearch_lastconflictinfo_v1_0 conflict; mRender->mUpdate.timerConflict = false; - if (cPluginManager::CallFirstService("CheckTimerConflict-v1.0", &conflict) ) - { - mTimerConflict = conflict; - } - else - { - mTimerConflict = false; + if (cPluginManager::CallFirstService("Epgsearch-lastconflictinfo-v1.0", &conflict)) { + mTimerConflicts = conflict.relevantConflicts; + } else { + mTimerConflicts = 0; } } - - return mTimerConflict; - } - else + return mTimerConflicts; + } else +#endif { - return false; + return 0; } -#endif - + #if VDRVERSNUM >= 10325 #if VDRVERSNUM >= 10338 case tReplayName: @@ -338,7 +344,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) return mReplay != NULL ? (cxType)TimeType(mReplay->start, Token.Attrib.Text) : (cxType)false; - + case tReplayShortText: return mReplay != NULL ? (cxType)mReplay->Info()->ShortText() @@ -378,7 +384,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) { std::string buffer(c->language); if (c->type == 1) buffer.append("MONO"); - if (c->type == 2) buffer.append("DUAL"); + if ((c->type == 2) || (c->type == 4)) buffer.append("DUAL"); if (c->type == 5) buffer.append("DD"); return (cxType)buffer.c_str(); } -- cgit v1.2.3