1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Simplified some conditional expressions in skinlcars.c and skinsttng.c

This commit is contained in:
Klaus Schmidinger 2013-11-15 15:35:21 +01:00
parent dfb9862460
commit a8cbe3a56d
4 changed files with 8 additions and 5 deletions

View File

@ -2147,6 +2147,7 @@ Marko M
for fixing missing ',' in the Italian and Polish OSD texts for fixing missing ',' in the Italian and Polish OSD texts
for pointing out that "Menu button closes" should actually be "Menu key closes" for pointing out that "Menu button closes" should actually be "Menu key closes"
for fixing a missing initialization in the c'tor of cSkinLCARSDisplayChannel for fixing a missing initialization in the c'tor of cSkinLCARSDisplayChannel
for suggesting to simplify some conditional expressions in skinlcars.c and skinsttng.c
Patrick Rother <krd-vdr@gulu.net> Patrick Rother <krd-vdr@gulu.net>
for reporting a bug in defining timers that only differ in the day of week for reporting a bug in defining timers that only differ in the day of week

View File

@ -8061,3 +8061,5 @@ Video Disk Recorder Revision History
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Fixed a missing initialization in the c'tor of cSkinLCARSDisplayChannel (thanks to - Fixed a missing initialization in the c'tor of cSkinLCARSDisplayChannel (thanks to
Marko Mäkelä). Marko Mäkelä).
- Simplified some conditional expressions in skinlcars.c and skinsttng.c (suggested
by Marko Mäkelä).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skinlcars.c 3.4 2013/11/15 15:21:00 kls Exp $ * $Id: skinlcars.c 3.5 2013/11/15 15:33:00 kls Exp $
*/ */
// "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures, // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures,
@ -492,7 +492,7 @@ void cSkinLCARSDisplayChannel::DrawTrack(void)
{ {
cDevice *Device = cDevice::PrimaryDevice(); cDevice *Device = cDevice::PrimaryDevice();
const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack()); const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { if (Track ? strcmp(lastTrackId.description, Track->description) : *lastTrackId.description) {
osd->DrawText(xc03, yc07, Track ? Track->description : "", Theme.Color(clrTrackName), Theme.Color(clrBackground), cFont::GetFont(fontOsd), xc07 - xc03); osd->DrawText(xc03, yc07, Track ? Track->description : "", Theme.Color(clrTrackName), Theme.Color(clrBackground), cFont::GetFont(fontOsd), xc07 - xc03);
strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description)); strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description));
} }
@ -1849,7 +1849,7 @@ void cSkinLCARSDisplayReplay::DrawTrack(void)
{ {
cDevice *Device = cDevice::PrimaryDevice(); cDevice *Device = cDevice::PrimaryDevice();
const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack()); const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { if (Track ? strcmp(lastTrackId.description, Track->description) : *lastTrackId.description) {
osd->DrawText(xp03, yp04, Track ? Track->description : "", Theme.Color(clrTrackName), Theme.Color(clrBackground), cFont::GetFont(fontOsd), xp07 - xp03); osd->DrawText(xp03, yp04, Track ? Track->description : "", Theme.Color(clrTrackName), Theme.Color(clrBackground), cFont::GetFont(fontOsd), xp07 - xp03);
strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description)); strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description));
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skinsttng.c 2.17 2013/03/03 15:29:28 kls Exp $ * $Id: skinsttng.c 3.1 2013/11/15 15:33:14 kls Exp $
*/ */
// "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures
@ -338,7 +338,7 @@ void cSkinSTTNGDisplayChannel::Flush(void)
} }
cDevice *Device = cDevice::PrimaryDevice(); cDevice *Device = cDevice::PrimaryDevice();
const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack()); const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { if (Track ? strcmp(lastTrackId.description, Track->description) : *lastTrackId.description) {
osd->DrawText(x3 + TextFrame, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 2 * TextFrame); osd->DrawText(x3 + TextFrame, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 2 * TextFrame);
strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description)); strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description));
} }