Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] New VDR feature: Number of recordings displayed in recordings menu title.
Hi,
there was a small wish coming from my family today:
"We want to know how many recordings we have".
For example, this gives you a quick clue about new
recordings without having to scroll through dozens
of pages, etc.
OK, within Klaus' nicely-structured code, it took
less than 5 minutes to implement that. Here it is:
--- /home/cko/VDR099pre1/menu.c Sat Nov 24 14:20:37 2001
+++ menu.c Fri Jan 4 23:45:06 2002
@@ -1519,10 +1519,16 @@
if (Recordings.Load()) {
const char *lastReplayed = cReplayControl::LastReplayed();
cRecording *recording = Recordings.First();
+ int number_of_recordings = 0;
while (recording) {
+ number_of_recordings++;
Add(new cMenuRecordingItem(recording), lastReplayed && strcmp(lastReplayed, recording->FileName()) == 0);
recording = Recordings.Next(recording);
}
+ char *buffer = NULL;
+ asprintf(&buffer, "%d %s", number_of_recordings, tr("Recordings"));
+ SetTitle(buffer);
+ delete buffer;
}
SetHelp(tr("Play"), tr("Rewind"), tr("Delete"), tr("Summary"));
Display();
Carsten.
Home |
Main Index |
Thread Index