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

Only displaying 'current/next' lines that actually contain information

This commit is contained in:
Klaus Schmidinger 2000-09-10 11:23:52 +02:00
parent a334a2df33
commit 61c87ad6c7
2 changed files with 30 additions and 10 deletions

View File

@ -163,3 +163,5 @@ Video Disk Recorder Revision History
- The "Primary DVB interface" can now be chosen via the "Setup" menu. - The "Primary DVB interface" can now be chosen via the "Setup" menu.
- Display of the "current/next" information when switching channels can now - Display of the "current/next" information when switching channels can now
be disabled via the "Setup" menu. be disabled via the "Setup" menu.
- The "current/next" display now only shows those lines that actually contain
information.

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: interface.c 1.13 2000/09/10 10:35:18 kls Exp $ * $Id: interface.c 1.14 2000/09/10 11:22:21 kls Exp $
*/ */
#include "interface.h" #include "interface.h"
@ -319,8 +319,15 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
if (Number) if (Number)
RcIo.Number(Number); RcIo.Number(Number);
if (Name && !Recording()) { if (Name && !Recording()) {
//XXX Maybe show only those lines that have actual information??? char *RunningTitle = "", *RunningSubtitle = "", *NextTitle = "", *NextSubtitle = "";
Open(MenuColumns, Number && WithInfo && EIT.IsValid() ? 5 : 1); int Lines = 0;
if (Number && WithInfo && EIT.IsValid()) {
if (*(RunningTitle = EIT.GetRunningTitle())) Lines++;
if (*(RunningSubtitle = EIT.GetRunningSubtitle())) Lines++;
if (*(NextTitle = EIT.GetNextTitle())) Lines++;
if (*(NextSubtitle = EIT.GetNextSubtitle())) Lines++;
}
Open(MenuColumns, Lines + 1);
int BufSize = MenuColumns + 1; int BufSize = MenuColumns + 1;
char buffer[BufSize]; char buffer[BufSize];
if (Number) if (Number)
@ -332,15 +339,26 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
struct tm *now = localtime(&t); struct tm *now = localtime(&t);
snprintf(buffer, BufSize, "%02d:%02d", now->tm_hour, now->tm_min); snprintf(buffer, BufSize, "%02d:%02d", now->tm_hour, now->tm_min);
Write(-5, 0, buffer); Write(-5, 0, buffer);
if (Number && WithInfo && EIT.IsValid()) { if (Lines > 0) {
const int t = 6; const int t = 6;
int w = MenuColumns - t; int w = MenuColumns - t;
Write(0, 1, EIT.GetRunningTime(), clrYellow, clrBackground); int l = 1;
snprintf(buffer, BufSize, "%.*s", w, EIT.GetRunningTitle()); Write(t, 1, buffer, clrCyan, clrBackground); if (*RunningTitle) {
snprintf(buffer, BufSize, "%.*s", w, EIT.GetRunningSubtitle()); Write(t, 2, buffer, clrCyan, clrBackground); Write(0, l, EIT.GetRunningTime(), clrYellow, clrBackground);
Write(0, 3, EIT.GetNextTime(), clrYellow, clrBackground); snprintf(buffer, BufSize, "%.*s", w, RunningTitle); Write(t, l, buffer, clrCyan, clrBackground);
snprintf(buffer, BufSize, "%.*s", w, EIT.GetNextTitle()); Write(t, 3, buffer, clrCyan, clrBackground); l++;
snprintf(buffer, BufSize, "%.*s", w, EIT.GetNextSubtitle()); Write(t, 4, buffer, clrCyan, clrBackground); }
if (*RunningSubtitle) {
snprintf(buffer, BufSize, "%.*s", w, RunningSubtitle); Write(t, l, buffer, clrCyan, clrBackground);
l++;
}
if (*NextTitle) {
Write(0, l, EIT.GetNextTime(), clrYellow, clrBackground);
snprintf(buffer, BufSize, "%.*s", w, NextTitle); Write(t, l, buffer, clrCyan, clrBackground);
l++;
}
if (*NextSubtitle)
snprintf(buffer, BufSize, "%.*s", w, NextSubtitle); Write(t, l, buffer, clrCyan, clrBackground);
} }
eKeys Key = Wait(5, true); eKeys Key = Wait(5, true);
if (Key == kOk) if (Key == kOk)