summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/channels.c b/channels.c
index 3b0b616..021b617 100644
--- a/channels.c
+++ b/channels.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: channels.c 1.24 2004/02/13 15:37:42 kls Exp $
+ * $Id: channels.c 1.25 2004/04/03 13:42:06 kls Exp $
*/
#include "channels.h"
@@ -888,3 +888,19 @@ cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, i
}
return NULL;
}
+
+const char *ChannelString(const cChannel *Channel, int Number)
+{
+ static char buffer[256];
+ if (Channel) {
+ if (Channel->GroupSep())
+ snprintf(buffer, sizeof(buffer), "%s", Channel->Name());
+ else
+ snprintf(buffer, sizeof(buffer), "%d%s %s", Channel->Number(), Number ? "-" : "", Channel->Name());
+ }
+ else if (Number)
+ snprintf(buffer, sizeof(buffer), "%d-", Number);
+ else
+ snprintf(buffer, sizeof(buffer), "%s", tr("*** Invalid Channel ***"));
+ return buffer;
+}