summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2007-08-25 09:31:13 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2007-08-25 09:31:13 +0200
commitfd60644895db6e3a8ec273eab65d91b3a5a3be7f (patch)
tree411d22447c1dbed2509fd03472f14ab537d33f03 /svdrp.c
parent742f4cc378cbe860abc3697e279fa22e6c303bfe (diff)
downloadvdr-fd60644895db6e3a8ec273eab65d91b3a5a3be7f.tar.gz
vdr-fd60644895db6e3a8ec273eab65d91b3a5a3be7f.tar.bz2
The SVDRP command LSTC can now list the channels with group separators if the option ':groups' is given
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/svdrp.c b/svdrp.c
index 3694ebb8..933375f4 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 1.102 2007/06/23 13:14:59 kls Exp $
+ * $Id: svdrp.c 1.103 2007/08/25 09:28:26 kls Exp $
*/
#include "svdrp.h"
@@ -216,10 +216,12 @@ const char *HelpPages[] = {
"HITK [ <key> ]\n"
" Hit the given remote control key. Without option a list of all\n"
" valid key names is given.",
- "LSTC [ <number> | <name> ]\n"
+ "LSTC [ :groups | <number> | <name> ]\n"
" List channels. Without option, all channels are listed. Otherwise\n"
" only the given channel is listed. If a name is given, all channels\n"
- " containing the given string as part of their name are listed.",
+ " containing the given string as part of their name are listed.\n"
+ " If ':groups' is given, all channels are listed including group\n"
+ " separators. The channel number of a group separator is always 0.",
"LSTE [ <channel> ] [ now | next | at <time> ]\n"
" List EPG data. Without any parameters all data of all channels is\n"
" listed. If a channel is given (either by number or by channel ID),\n"
@@ -862,7 +864,8 @@ void cSVDRP::CmdHITK(const char *Option)
void cSVDRP::CmdLSTC(const char *Option)
{
- if (*Option) {
+ bool WithGroupSeps = strcasecmp(Option, ":groups") == 0;
+ if (*Option && !WithGroupSeps) {
if (isnumber(Option)) {
cChannel *channel = Channels.GetByNumber(strtol(Option, NULL, 10));
if (channel)
@@ -889,7 +892,9 @@ void cSVDRP::CmdLSTC(const char *Option)
}
else if (Channels.MaxNumber() >= 1) {
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
- if (!channel->GroupSep())
+ if (WithGroupSeps)
+ Reply(channel->Next() ? -250: 250, "%d %s", channel->GroupSep() ? 0 : channel->Number(), *channel->ToText());
+ else if (!channel->GroupSep())
Reply(channel->Number() < Channels.MaxNumber() ? -250 : 250, "%d %s", channel->Number(), *channel->ToText());
}
}