From ae8fe25312b6b0ec18fd0c6c2a275f334ada02db Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 26 Aug 2001 18:00:00 +0200 Subject: Version 0.93 - The menus and the channel display now show the current date and time. - The new Setup parameter MaxVideoFileSize can be used to customize the maximum size of the recorded video files. - Fixed a bug in handling repeating timers that record over midnight (the calculation of matching timers has been completely rewritten). - Timers that are currently recording are now marked with '#' in the "Timers" menu. - Timers are now sorted in the "Timers" menu, showing the sequence in which they will be recording. This can be disabled in the "Setup" menu. Note that the "Mark" button doesn't work if timers are displayed sorted. --- tools.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'tools.c') diff --git a/tools.c b/tools.c index 30b675b..f51bc85 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 1.40 2001/08/17 12:45:42 kls Exp $ + * $Id: tools.c 1.43 2001/08/26 15:45:41 kls Exp $ */ #define _GNU_SOURCE @@ -17,7 +17,9 @@ #endif #include #include +#include #include +#include "i18n.h" #define MaxBuffer 1000 @@ -395,6 +397,20 @@ bool SpinUpDisk(const char *FileName) return false; } +const char *DayDateTime(time_t t) +{ + static char buffer[32]; + if (t == 0) + time(&t); + tm *tm = localtime(&t); + int weekday = tm->tm_wday == 0 ? 6 : tm->tm_wday - 1; // we start with monday==0! + const char *day = tr("MonTueWedThuFriSatSun"); + day += weekday * 3; + strncpy(buffer, day, 3); + snprintf(buffer + 3, sizeof(buffer) - 3, " %2d.%02d %02d:%02d", tm->tm_mday, tm->tm_mon + 1, tm->tm_hour, tm->tm_min); + return buffer; +} + // --- cFile ----------------------------------------------------------------- bool cFile::files[FD_SETSIZE] = { false }; @@ -677,3 +693,19 @@ int cListBase::Count(void) const return n; } +void cListBase::Sort(void) +{ + bool swapped; + do { + swapped = false; + cListObject *object = objects; + while (object) { + if (object->Next() && *object->Next() < *object) { + Move(object->Next(), object); + swapped = true; + } + object = object->Next(); + } + } while (swapped); +} + -- cgit v1.2.3