summaryrefslogtreecommitdiff
path: root/skinlcars.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de>2012-07-14 15:28:00 +0200
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2012-07-15 20:49:35 +0200
commit046b506748196e9e2da7472a4ff76ff593e67b76 (patch)
treed0fa028b363317c7b49402e8beff2d0913216869 /skinlcars.c
parent5500959f4f73c21cef8910b3815b4ee3fa1327dd (diff)
downloadvdr-patches-046b506748196e9e2da7472a4ff76ff593e67b76.tar.gz
vdr-patches-046b506748196e9e2da7472a4ff76ff593e67b76.tar.bz2
Version 1.7.29
Original announce message: VDR developer version 1.7.29 is now available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.29.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.28-1.7.29.diff MD5 checksums: a3f0ae42ba456aa1865c9ed065a64d80 vdr-1.7.29.tar.bz2 39db6b495210c293726126fbcba3e631 vdr-1.7.28-1.7.29.diff WARNING: ======== This is a developer version. Even though I use it in my productive environment. I strongly recommend that you only use it under controlled conditions and for testing and debugging. The default skin "LCARS" displays the signal strengths and qualities of all devices in its main menu. For devices that have an stb0899 frontend chip (like the TT-budget S2-3200) retrieving this information from the driver is rather slow, which results in a sluggish response to user input in the main menu. To speed this up you may want to apply the patches from ftp://ftp.tvdr.de/vdr/Developer/Driver-Patches to the LinuxDVB driver source. From the HISTORY file: - Added a missing template specification to the c'tor of cSortedTimers (thanks to Udo Richter). - Fixed the background color of the Transfer Mode indicator bitmap in the LCARS skin. - The LCARS skin now only displays devices that can actually receive channels, leaving out, for instance, pure replay devices (suggested by Reinhard Nissl). - Now scaling down the Transfer Mode indicator bitmap in the LCARS skin in case it doesn't fit with the selected font size (reported by Reinhard Nissl). - Fixed making LCARS the default skin. - Adjusted the default values for OSD and font sizes to better fit HDTV. - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Fixed the call to ChannelString() in cSkinLCARSDisplayChannel::SetChannel() (thanks to Rolf Ahrenberg). - Removed DeleteEvent() from the EPG handler interface (turned out not to be useful) and replaced it with HandledExternally() (thanks to Jörg Wendel). - Added SetComponents() to the EPG handler interface (thanks to Dirk Heiser). - Updated the Italian OSD texts (thanks to Diego Pierotto). - Changed the button colors in the LCARS skin to better fit with the rest of the theme. - Removed the gap from the main menu buttons in the LCARS skin. - Fixed some copy&paste errors in PLUGINS.html (thanks to Winfried Köhler). - The LCARS skin's main menu now only displays timers that are actually activated. - Within the "Recordings" menu, pressing the '0' key now toggles sorting between "by time" and "by name". The selected sort mode is stored separately for each folder (provided you have write access to that folder). If a folder is newly created by a repeating timer, the sort mode for that folder is initially set to "by time". - Fixed several spelling errors (thanks to Ville Skyttä). - Fixed handling recording with more than two bonded devices. - Fixed the type of MBperMinute in cVideoDiskUsage::HasChanged() (thanks to Andreas Mair). - Setting the "broken link" or "TEI" flags when cutting recordings is now suppressed if the editing point merges two seamlessly fitting parts of the same stream (thanks to Torsten Lang). - Fixed displaying messages in the LCARS skin. - Fixed checking for a visible live programme in case a menu or the channel display is currently open. - Changed some of the colors in the LCARS skin (you may need to delete the file lcars-default.theme from your themes directory to see these changes). - The new setup option "Miscellaneous/Show channel names with source" can be used to turn on adding the source character to channel names whenever they are displayed (suggested by Ludi Kaleni).
Diffstat (limited to 'skinlcars.c')
-rw-r--r--skinlcars.c151
1 files changed, 98 insertions, 53 deletions
diff --git a/skinlcars.c b/skinlcars.c
index a602923..5937efe 100644
--- a/skinlcars.c
+++ b/skinlcars.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skinlcars.c 2.2 2012/06/03 10:17:00 kls Exp $
+ * $Id: skinlcars.c 2.13 2012/06/13 13:27:31 kls Exp $
*/
// "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures,
@@ -76,11 +76,11 @@ static cTheme Theme;
// Color domains:
#define CLR_BACKGROUND 0x99000000
-#define CLR_MAIN_FRAME 0xFFF1DF6F
-#define CLR_CHANNEL_FRAME 0xFFFFCC99
+#define CLR_MAIN_FRAME 0xFFFF9966
+#define CLR_CHANNEL_FRAME 0xFF8A9EC9
#define CLR_REPLAY_FRAME 0xFFCC6666
#define CLR_DATE 0xFF99CCFF
-#define CLR_MENU_ITEMS 0xFFFFBC57
+#define CLR_MENU_ITEMS 0xFF9999FF
#define CLR_TIMER 0xFF99CCFF
#define CLR_DEVICE 0xFFF1B1AF
#define CLR_CHANNEL_NAME 0xFF99CCFF
@@ -93,10 +93,10 @@ static cTheme Theme;
#define CLR_ALERT 0xFFFF0000
#define CLR_EXPOSED 0xFF990000
#define CLR_WHITE 0xFFFFFFFF
-#define CLR_RED 0xFFB20000
-#define CLR_GREEN 0xFF00B200
-#define CLR_YELLOW 0xFFB2B200
-#define CLR_BLUE 0xFF0000B2
+#define CLR_RED 0xFFCC6666
+#define CLR_GREEN 0xFFA0FF99
+#define CLR_YELLOW 0xFFF1DF60
+#define CLR_BLUE 0xFF9A99FF
#define CLR_BLACK 0xFF000000
// General colors:
@@ -122,24 +122,24 @@ THEME_CLR(Theme, clrEventDescription, CLR_TEXT);
// Buttons:
-THEME_CLR(Theme, clrButtonRedFg, CLR_WHITE);
+THEME_CLR(Theme, clrButtonRedFg, CLR_BLACK);
THEME_CLR(Theme, clrButtonRedBg, CLR_RED);
THEME_CLR(Theme, clrButtonGreenFg, CLR_BLACK);
THEME_CLR(Theme, clrButtonGreenBg, CLR_GREEN);
THEME_CLR(Theme, clrButtonYellowFg, CLR_BLACK);
THEME_CLR(Theme, clrButtonYellowBg, CLR_YELLOW);
-THEME_CLR(Theme, clrButtonBlueFg, CLR_WHITE);
+THEME_CLR(Theme, clrButtonBlueFg, CLR_BLACK);
THEME_CLR(Theme, clrButtonBlueBg, CLR_BLUE);
// Messages:
-THEME_CLR(Theme, clrMessageStatusFg, CLR_WHITE);
+THEME_CLR(Theme, clrMessageStatusFg, CLR_BLACK);
THEME_CLR(Theme, clrMessageStatusBg, CLR_BLUE);
THEME_CLR(Theme, clrMessageInfoFg, CLR_BLACK);
THEME_CLR(Theme, clrMessageInfoBg, CLR_GREEN);
THEME_CLR(Theme, clrMessageWarningFg, CLR_BLACK);
THEME_CLR(Theme, clrMessageWarningBg, CLR_YELLOW);
-THEME_CLR(Theme, clrMessageErrorFg, CLR_WHITE);
+THEME_CLR(Theme, clrMessageErrorFg, CLR_BLACK);
THEME_CLR(Theme, clrMessageErrorBg, CLR_RED);
// Volume:
@@ -166,11 +166,11 @@ THEME_CLR(Theme, clrMenuTitle, CLR_MAIN_FRAME);
THEME_CLR(Theme, clrMenuMainBracket, CLR_MENU_ITEMS);
THEME_CLR(Theme, clrMenuTimerRecording, CLR_DEVICE);
THEME_CLR(Theme, clrMenuDeviceRecording, CLR_TIMER);
-THEME_CLR(Theme, clrMenuItemCurrentFg, CLR_BLACK);
-THEME_CLR(Theme, clrMenuItemCurrentBg, CLR_MENU_ITEMS);
+THEME_CLR(Theme, clrMenuItemCurrentFg, CLR_MAIN_FRAME);
+THEME_CLR(Theme, clrMenuItemCurrentBg, RgbShade(CLR_MENU_ITEMS, -0.5));
THEME_CLR(Theme, clrMenuItemSelectable, CLR_MENU_ITEMS);
THEME_CLR(Theme, clrMenuItemNonSelectable, CLR_TEXT);
-THEME_CLR(Theme, clrMenuScrollbarTotal, CLR_MENU_ITEMS);
+THEME_CLR(Theme, clrMenuScrollbarTotal, RgbShade(CLR_MAIN_FRAME, 0.2));
THEME_CLR(Theme, clrMenuScrollbarShown, CLR_SEEN);
THEME_CLR(Theme, clrMenuScrollbarArrow, CLR_BLACK);
THEME_CLR(Theme, clrMenuText, CLR_TEXT);
@@ -515,7 +515,7 @@ void cSkinLCARSDisplayChannel::SetChannel(const cChannel *Channel, int Number)
else if (Number)
ChNumber = cString::sprintf("%d-", Number);
else
- ChName = ChannelString(NULL, NULL);
+ ChName = ChannelString(NULL, 0);
osd->DrawText(xc00, yc00, ChNumber, Theme.Color(clrChannelFrameFg), frameColor, tallFont, xc02 - xc00, yc02 - yc00, taTop | taRight | taBorder);
osd->DrawText(xc03, yc00, ChName, Theme.Color(clrChannelName), Theme.Color(clrBackground), tallFont, xi - xc03 - lineHeight, 0, taTop | taLeft);
lastSignalDisplay = 0;
@@ -548,14 +548,30 @@ void cSkinLCARSDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Fo
void cSkinLCARSDisplayChannel::SetMessage(eMessageType Type, const char *Text)
{
if (Text) {
- int y0 = yc11 - ShowSeenExtent;
- int y1 = yc11;
- osd->SaveRegion(xc06, y0, xc13 - 1, yc12 - 1);
- osd->DrawRectangle(xc06, y0, xc07, y1 - 1, Theme.Color(clrBackground)); // clears the "seen" bar
- osd->DrawText(xc06, yc11, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), cFont::GetFont(fontSml), xc13 - xc06, yc12 - yc11, taCenter);
+ int x0, x1, y0, y1, y2;
+ if (withInfo) {
+ x0 = xc06;
+ x1 = xc13;
+ y0 = yc11 - ShowSeenExtent;
+ y1 = yc11;
+ y2 = yc12;
+ }
+ else {
+ x0 = xc03;
+ x1 = xc13;
+ y0 = y1 = yc00;
+ y2 = yc02;
+ }
+ osd->SaveRegion(x0, y0, x1 - 1, y2 - 1);
+ if (withInfo)
+ osd->DrawRectangle(xc06, y0, xc07, y1 - 1, Theme.Color(clrBackground)); // clears the "seen" bar
+ osd->DrawText(x0, y1, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), cFont::GetFont(fontSml), x1 - x0, y2 - y1, taCenter);
+ message = true;
}
- else
+ else {
osd->RestoreRegion();
+ message = false;
+ }
}
void cSkinLCARSDisplayChannel::Flush(void)
@@ -566,16 +582,16 @@ void cSkinLCARSDisplayChannel::Flush(void)
DrawTrack();
DrawDevice();
DrawSignal();
+ int Current = 0;
+ int Total = 0;
+ if (present) {
+ time_t t = time(NULL);
+ if (t > present->StartTime())
+ Current = t - present->StartTime();
+ Total = present->Duration();
+ }
+ DrawSeen(Current, Total);
}
- int Current = 0;
- int Total = 0;
- if (present) {
- time_t t = time(NULL);
- if (t > present->StartTime())
- Current = t - present->StartTime();
- Total = present->Duration();
- }
- DrawSeen(Current, Total);
}
osd->Flush();
initial = false;
@@ -928,7 +944,7 @@ void cSkinLCARSDisplayMenu::DrawMainButton(const char *Text, int x0, int x1, int
{
int h = y1 - y0;
osd->DrawEllipse(x0, y0, x1 - 1, y1 - 1, ColorBg, 7);
- osd->DrawText(x1 + Gap, y0, Text, ColorFg, ColorBg, Font, x2 - x1 - Gap, h, taBottom | taRight);
+ osd->DrawText(x1, y0, Text, ColorFg, ColorBg, Font, x2 - x1, h, taBottom | taRight);
osd->DrawEllipse(x2, y0, x3 - 1, y1 - 1, ColorBg, 5);
}
@@ -1149,6 +1165,7 @@ void cSkinLCARSDisplayMenu::DrawTimers(void)
osd->DrawRectangle(xs07, ys04, xs13 - 1, ys05 - 1, Theme.Color(clrBackground));
cSortedTimers SortedTimers;
cVector<int> FreeDeviceSlots;
+ int NumDevices = 0;
int y = ys04;
// Timers and recording devices:
while (1) {
@@ -1167,6 +1184,7 @@ void cSkinLCARSDisplayMenu::DrawTimers(void)
Device = RecordControl->Device();
deviceOffset[Device->DeviceNumber()] = y;
deviceRecording[Device->DeviceNumber()] = true;
+ NumDevices++;
}
else
FreeDeviceSlots.Append(y);
@@ -1177,7 +1195,7 @@ void cSkinLCARSDisplayMenu::DrawTimers(void)
}
SortedTimers[i] = NULL;
}
- else if (!Device) {
+ else if (!Device && Timer->HasFlags(tfActive)) {
DrawTimer(Timer, y, false);
FreeDeviceSlots.Append(y);
y += lineHeight + Gap;
@@ -1192,20 +1210,29 @@ void cSkinLCARSDisplayMenu::DrawTimers(void)
int Slot = 0;
for (int i = 0; i < cDevice::NumDevices(); i++) {
if (const cDevice *Device = cDevice::GetDevice(i)) {
- if (!deviceRecording[Device->DeviceNumber()]) {
- if (Slot < FreeDeviceSlots.Size()) {
- y = FreeDeviceSlots[Slot];
- Slot++;
+ if (Device->NumProvidedSystems()) {
+ if (!deviceRecording[Device->DeviceNumber()]) {
+ if (Slot < FreeDeviceSlots.Size()) {
+ y = FreeDeviceSlots[Slot];
+ Slot++;
+ }
+ if (y + lineHeight > ys05)
+ break;
+ deviceOffset[Device->DeviceNumber()] = y;
+ y += lineHeight + Gap;
+ NumDevices++;
}
- if (y + lineHeight > ys05)
- break;
- deviceOffset[Device->DeviceNumber()] = y;
- y += lineHeight + Gap;
}
}
}
- osd->DrawText(xs02, ys00, itoa(Timers.Count()), Theme.Color(clrMenuFrameFg), frameColor, font, xs03 - xs02, ys01 - ys00, taBottom | taLeft | taBorder);
- osd->DrawText(xs08, ys00, itoa(cDevice::NumDevices()), Theme.Color(clrMenuFrameFg), frameColor, font, xs09 - xs08, ys01 - ys00, taBottom | taRight | taBorder);
+ // Total number of active timers:
+ int NumTimers = 0;
+ for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) {
+ if (Timer->HasFlags(tfActive))
+ NumTimers++;
+ }
+ osd->DrawText(xs02, ys00, itoa(NumTimers), Theme.Color(clrMenuFrameFg), frameColor, font, xs03 - xs02, ys01 - ys00, taBottom | taLeft | taBorder);
+ osd->DrawText(xs08, ys00, itoa(NumDevices), Theme.Color(clrMenuFrameFg), frameColor, font, xs09 - xs08, ys01 - ys00, taBottom | taRight | taBorder);
lastSignalDisplay = 0;
initial = true; // forces redrawing of devices
}
@@ -1231,8 +1258,10 @@ void cSkinLCARSDisplayMenu::DrawDevice(const cDevice *Device)
void cSkinLCARSDisplayMenu::DrawDevices(void)
{
for (int i = 0; i < cDevice::NumDevices(); i++) {
- if (const cDevice *Device = cDevice::GetDevice(i))
- DrawDevice(Device);
+ if (const cDevice *Device = cDevice::GetDevice(i)) {
+ if (Device->NumProvidedSystems())
+ DrawDevice(Device);
+ }
}
}
@@ -1247,10 +1276,24 @@ void cSkinLCARSDisplayMenu::DrawLiveIndicator(void)
if (lastLiveIndicatorY >= 0)
osd->DrawRectangle(xs12, lastLiveIndicatorY, xs13 - 1, lastLiveIndicatorY + lineHeight - 1, Theme.Color(clrBackground));
if (y >= 0) {
- osd->DrawRectangle(xs12, y, xs12 + lineHeight / 2 - 1, y + lineHeight - 1, frameColor);
- osd->DrawEllipse (xs12 + lineHeight / 2, y, xs13 - 1, y + lineHeight - 1, frameColor, 5);
- if (Transferring)
- osd->DrawBitmap((xs12 + xs13 - bmTransferMode.Width()) / 2, y + (lineHeight - bmTransferMode.Height()) / 2, bmTransferMode, Theme.Color(clrChannelFrameFg), Theme.Color(clrChannelFrameBg));
+ tColor ColorBg = Theme.Color(clrChannelFrameBg);
+ osd->DrawRectangle(xs12, y, xs12 + lineHeight / 2 - 1, y + lineHeight - 1, ColorBg);
+ osd->DrawEllipse (xs12 + lineHeight / 2, y, xs13 - 1, y + lineHeight - 1, ColorBg, 5);
+ if (Transferring) {
+ int w = bmTransferMode.Width();
+ int h = bmTransferMode.Height();
+ int b = w * w + h * h; // the diagonal of the bitmap (squared)
+ int c = lineHeight * lineHeight; // the diameter of the circle (squared)
+ const cBitmap *bm = &bmTransferMode;
+ if (b > c) {
+ // the bitmap doesn't fit, so scale it down:
+ double f = sqrt(double(c) / (2 * b));
+ bm = bmTransferMode.Scaled(f, f);
+ }
+ osd->DrawBitmap((xs12 + xs13 - bm->Width()) / 2, y + (lineHeight - bm->Height()) / 2, *bm, Theme.Color(clrChannelFrameFg), ColorBg);
+ if (bm != &bmTransferMode)
+ delete bm;
+ }
}
lastLiveIndicatorY = y;
lastLiveIndicatorTransferring = Transferring;
@@ -1263,8 +1306,10 @@ void cSkinLCARSDisplayMenu::DrawSignals(void)
if (initial || Now - lastSignalDisplay >= SIGNALDISPLAYDELTA) {
for (int i = 0; i < cDevice::NumDevices(); i++) {
if (const cDevice *Device = cDevice::GetDevice(i)) {
- if (int y = deviceOffset[i])
- DrawDeviceSignal(osd, Device, xs + lineHeight / 2, y, xs11, y + lineHeight, lastSignalStrength[i], lastSignalQuality[i], initial);
+ if (Device->NumProvidedSystems()) {
+ if (int y = deviceOffset[i])
+ DrawDeviceSignal(osd, Device, xs + lineHeight / 2, y, xs11, y + lineHeight, lastSignalStrength[i], lastSignalQuality[i], initial);
+ }
}
}
lastSignalDisplay = Now;
@@ -1772,7 +1817,7 @@ void cSkinLCARSDisplayReplay::SetMessage(eMessageType Type, const char *Text)
{
if (Text) {
osd->SaveRegion(xp06, yp08, xp13 - 1, yp09 - 1);
- osd->DrawText(xp06, yp08, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), cFont::GetFont(fontSml), xp13 - xp06, 0, taCenter);
+ osd->DrawText(xp06, yp08, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), cFont::GetFont(fontSml), xp13 - xp06, yp09 - yp08, taCenter);
}
else
osd->RestoreRegion();
@@ -2060,7 +2105,7 @@ void cSkinLCARSDisplayMessage::SetMessage(eMessageType Type, const char *Text)
osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, ColorBg, 7);
osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, ColorBg);
- osd->DrawText(x3, y0, Text, ColorFg, ColorBg, cFont::GetFont(fontOsd), x4 - x3, 0, taCenter);
+ osd->DrawText(x3, y0, Text, ColorFg, ColorBg, cFont::GetFont(fontSml), x4 - x3, y1 - y0, taCenter);
osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, ColorBg);
osd->DrawRectangle(x6, y0, x7 - 1, y1 - 1, clrTransparent);
osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, ColorBg, 5);