summaryrefslogtreecommitdiff
path: root/interface.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-09-10 11:23:52 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-09-10 11:23:52 +0200
commit61c87ad6c76431bdb774e02546e8718a9bb0f602 (patch)
tree193dabe3bdada0f2afef42f486490787930152e3 /interface.c
parenta334a2df334ccd3c2a2756b374b675a15bdb3de8 (diff)
downloadvdr-61c87ad6c76431bdb774e02546e8718a9bb0f602.tar.gz
vdr-61c87ad6c76431bdb774e02546e8718a9bb0f602.tar.bz2
Only displaying 'current/next' lines that actually contain information
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/interface.c b/interface.c
index 5aed127a..df65c826 100644
--- a/interface.c
+++ b/interface.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -319,8 +319,15 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
if (Number)
RcIo.Number(Number);
if (Name && !Recording()) {
- //XXX Maybe show only those lines that have actual information???
- Open(MenuColumns, Number && WithInfo && EIT.IsValid() ? 5 : 1);
+ char *RunningTitle = "", *RunningSubtitle = "", *NextTitle = "", *NextSubtitle = "";
+ 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;
char buffer[BufSize];
if (Number)
@@ -332,15 +339,26 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
struct tm *now = localtime(&t);
snprintf(buffer, BufSize, "%02d:%02d", now->tm_hour, now->tm_min);
Write(-5, 0, buffer);
- if (Number && WithInfo && EIT.IsValid()) {
+ if (Lines > 0) {
const int t = 6;
int w = MenuColumns - t;
- Write(0, 1, EIT.GetRunningTime(), clrYellow, clrBackground);
- snprintf(buffer, BufSize, "%.*s", w, EIT.GetRunningTitle()); Write(t, 1, buffer, clrCyan, clrBackground);
- snprintf(buffer, BufSize, "%.*s", w, EIT.GetRunningSubtitle()); Write(t, 2, buffer, clrCyan, clrBackground);
- Write(0, 3, EIT.GetNextTime(), clrYellow, clrBackground);
- snprintf(buffer, BufSize, "%.*s", w, EIT.GetNextTitle()); Write(t, 3, buffer, clrCyan, clrBackground);
- snprintf(buffer, BufSize, "%.*s", w, EIT.GetNextSubtitle()); Write(t, 4, buffer, clrCyan, clrBackground);
+ int l = 1;
+ if (*RunningTitle) {
+ Write(0, l, EIT.GetRunningTime(), clrYellow, clrBackground);
+ snprintf(buffer, BufSize, "%.*s", w, RunningTitle); Write(t, l, buffer, clrCyan, clrBackground);
+ l++;
+ }
+ 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);
if (Key == kOk)