diff options
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 220 |
1 files changed, 98 insertions, 122 deletions
@@ -33,11 +33,8 @@ void cText2SkinStatus::SetRender(cText2SkinRender *Render) mNextRecording = 0; } -#if VDRVERSNUM >= 10338 -void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name, const char *FileName, bool On) -#else -void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name) -#endif +void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name, + const char *FileName, bool On) { Dprintf("cText2SkinStatus::Replaying(%s)\n", Name); eReplayMode oldMode = mReplayMode; @@ -45,7 +42,7 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name) if (mRender != NULL) mRender->UpdateLock(); - if (Name != NULL) { + if (On) { mReplayMode = replayMPlayer; if (strlen(Name) > 6 && Name[0]=='[' && Name[3]==']' && Name[5]=='(') { int i; @@ -60,14 +57,12 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name) } } #if VDRVERSNUM >= 10338 - else if (const cRecording *rec = GetRecordingByFileName(FileName)) - { + else if (const cRecording *rec = GetRecordingByFileName(FileName)) { mReplay = rec; mReplayMode = replayNormal; } #else - else if (const cRecording *rec = GetRecordingByName(Name)) - { + else if (const cRecording *rec = GetRecordingByName(Name)) { mReplay = rec; mReplayMode = replayNormal; } @@ -103,11 +98,8 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name) } } -#if VDRVERSNUM >= 10338 -void cText2SkinStatus::Recording(const cDevice *Device, const char *Name, const char *FileName, bool On) -#else -void cText2SkinStatus::Recording(const cDevice *Device, const char *Name) -#endif +void cText2SkinStatus::Recording(const cDevice *Device, const char *Name, + const char *FileName, bool On) { if (mRender != NULL) mRender->UpdateLock(); @@ -130,38 +122,37 @@ void cText2SkinStatus::Recording(const cDevice *Device, const char *Name) void cText2SkinStatus::OsdClear(void) { +#if VDRVERSNUM >= 10507 + if (I18nCurrentLanguage() != mLastLanguage) { + mLastLanguage = I18nCurrentLanguage(); +#else if (Setup.OSDLanguage != mLastLanguage) { mLastLanguage = Setup.OSDLanguage; +#endif cxString::Reparse(); } - + if (mRender != NULL) - { mRender->mMenuScrollbar.total = 0; - } } void cText2SkinStatus::OsdCurrentItem(const char *Text) { - if (mRender && Text) - { + if (mRender && Text) { // update infos cText2SkinRender::tUpdate *u = &mRender->mUpdate; //static std::string lastItem; - + //lastItem = u->currentItem; u->currentItem = Text; u->resetMarquee = true; u->foundFirstItem = false; - + // find current item in scrollbar - if (Text2SkinSetup.MenuScrollbar) - { + if (Text2SkinSetup.MenuScrollbar) { cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; - for (uint i = 0; i < sb->total; i++) - { - if (sb->items[i] == Text) - { + for (uint i = 0; i < sb->total; i++) { + if (sb->items[i] == Text) { sb->current = i; break; } @@ -172,62 +163,53 @@ void cText2SkinStatus::OsdCurrentItem(const char *Text) void cText2SkinStatus::OsdItem(const char *Text, int Index) { - if (mRender && Text2SkinSetup.MenuScrollbar && Text) - { + if (mRender && Text2SkinSetup.MenuScrollbar && Text) { uint curr = (uint)Index; cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar; - + if (curr < sb->items.size()) - { sb->items[curr] = Text; - } - else - { + else { sb->items.push_back(Text); sb->total = curr + 1; } - - if (curr + 1 > sb->total) sb->total = curr + 1; + + if (curr + 1 > sb->total) + sb->total = curr + 1; } } void cText2SkinStatus::UpdateEvents(void) { - if (mRender->mUpdate.events) - { + if (mRender->mUpdate.events) { mRender->mUpdate.events = false; - + mEvents.Clear(); Timers.IncBeingEdited(); - - for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim)) - { - if (tim->HasFlags(tfActive)) - { + + for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim)) { + if (tim->HasFlags(tfActive)) { int i = 0; cTimer dummy; dummy = *tim; - - do - { + + do { mEvents.Add(new tEvent(&dummy)); - - if (!dummy.IsSingleEvent()) // add 4 additional rep. timer - { + + if (!dummy.IsSingleEvent()) { // add 4 additional rep. timer int j = 0; - do - { + do { j++; // just to avoid a endless loop dummy.Skip(); dummy.Matches(); // Refresh start- and end-time } while (!dummy.DayMatches(dummy.StartTime()) && (j < 7)); } - + i++; } while (!dummy.IsSingleEvent() && i < 5); } } - + Timers.DecBeingEdited(); mEvents.Sort(); } @@ -236,23 +218,23 @@ void cText2SkinStatus::UpdateEvents(void) cxType cText2SkinStatus::GetTokenData(const txToken &Token) { int event = 0; - + 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: @@ -260,9 +242,9 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tCurrentEventsTitle1: UpdateEvents(); return mEvents.Count() > event - ? (cxType)mEvents.Get(event)->title.c_str() - : (cxType)false; - + ? (cxType)mEvents.Get(event)->title.c_str() + : (cxType)false; + case tCurrentEventsStartDateTime3: event++; case tCurrentEventsStartDateTime2: @@ -270,9 +252,9 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tCurrentEventsStartDateTime1: UpdateEvents(); return mEvents.Count() > event - ? (cxType)TimeType(mEvents.Get(event)->startTime, Token.Attrib.Text) - : (cxType)false; - + ? (cxType)TimeType(mEvents.Get(event)->startTime, Token.Attrib.Text) + : (cxType)false; + case tCurrentEventsStopDateTime3: event++; case tCurrentEventsStopDateTime2: @@ -280,8 +262,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tCurrentEventsStopDateTime1: UpdateEvents(); return mEvents.Count() > event - ? (cxType)TimeType(mEvents.Get(event)->stopTime, Token.Attrib.Text) - : (cxType)false; + ? (cxType)TimeType(mEvents.Get(event)->stopTime, Token.Attrib.Text) + : (cxType)false; case tCurrentEventsChannelNumber3: event++; @@ -290,8 +272,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tCurrentEventsChannelNumber1: UpdateEvents(); return mEvents.Count() > event - ? (cxType)mEvents.Get(event)->channelNumber - : (cxType)false; + ? (cxType)mEvents.Get(event)->channelNumber + : (cxType)false; case tCurrentEventsChannelName3: event++; @@ -300,8 +282,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tCurrentEventsChannelName1: UpdateEvents(); return mEvents.Count() > event - ? (cxType)mEvents.Get(event)->channelName.c_str() - : (cxType)false; + ? (cxType)mEvents.Get(event)->channelName.c_str() + : (cxType)false; case tCurrentEventsIsRecording3: event++; @@ -310,28 +292,25 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tCurrentEventsIsRecording1: UpdateEvents(); return mEvents.Count() > event - ? (cxType)mEvents.Get(event)->isRecording - : (cxType)false; - + ? (cxType)mEvents.Get(event)->isRecording + : (cxType)false; + case tTimerConflicts: #if VDRVERSNUM >= 10330 if (Text2SkinSetup.CheckTimerConflict) { - if (mRender->mUpdate.timerConflict) { + if (mRender->mUpdate.timerConflict) { Epgsearch_lastconflictinfo_v1_0 conflict; mRender->mUpdate.timerConflict = false; - - if (cPluginManager::CallFirstService("Epgsearch-lastconflictinfo-v1.0", &conflict)) { + + if (cPluginManager::CallFirstService("Epgsearch-lastconflictinfo-v1.0", &conflict)) mTimerConflicts = conflict.relevantConflicts; - } else { + else mTimerConflicts = 0; - } } return mTimerConflicts; } else #endif - { return 0; - } #if VDRVERSNUM >= 10325 #if VDRVERSNUM >= 10338 @@ -360,32 +339,33 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) case tReplayDateTime: return (cxType)false; - + case tReplayShortText: return (cxType)false; case tReplayDescription: return (cxType)false; #endif - + case tReplayLanguageCode: - if (mReplay) - { + if (mReplay) { const cComponents *components = mReplay->Info()->Components(); - if (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 + for (int i = 0; i < components->NumComponents(); i++) { + const tComponent *c = components->Component(i); + if (c->stream != 2) // only audio-streams + index++; { std::string buffer(c->language); - if (c->type == 1) buffer.append("MONO"); - if ((c->type == 2) || (c->type == 4)) buffer.append("DUAL"); - if (c->type == 5) buffer.append("DD"); + if (c->type == 1) + buffer.append("MONO"); + if ((c->type == 2) || (c->type == 4)) + buffer.append("DUAL"); + if (c->type == 5) + buffer.append("DD"); return (cxType)buffer.c_str(); } } @@ -393,40 +373,36 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) } return false; - case tReplayLanguageDescription: - if (mReplay) - { + case tReplayLanguageDescription: + if (mReplay) { const cComponents *components = mReplay->Info()->Components(); - if (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; + for (int i = 0; i < components->NumComponents(); i++) { + const tComponent *c = components->Component(i); + if (c->stream != 2) // only audio-streams + index++; + if (i == index) + return (cxType)c->description; } } } return false; - case tReplayVideoAR: - if (mReplay) - { + case tReplayVideoAR: + if (mReplay) { const cComponents *components = mReplay->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"; + 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"; } } } |