1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00
vdr/sourceparams.c

44 lines
1.2 KiB
C
Raw Permalink Normal View History

2010-02-28 12:19:50 +01:00
/*
* sourceparams.c: Source parameter handling
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
2010-03-06 12:01:17 +01:00
* $Id: sourceparams.c 1.2 2010/03/06 11:13:39 kls Exp $
2010-02-28 12:19:50 +01:00
*/
#include "sourceparams.h"
#include "sources.h"
// --- cSourceParam ----------------------------------------------------------
cSourceParam::cSourceParam(char Source, const char *Description)
{
source = Source;
if ('A' <= source && source <= 'Z') {
if (SourceParams.Get(source)) {
esyslog("ERROR: source parameters for '%c' already defined", source);
return;
}
SourceParams.Add(this);
2010-03-06 12:01:17 +01:00
if (!strchr("ACST", Source)) // no, it's not "ATSC" ;-)
2010-02-28 12:19:50 +01:00
Sources.Add(new cSource(Source, Description));
dsyslog("registered source parameters for '%c - %s'", source, Description);
}
else
esyslog("ERROR: invalid source '%c'", source);
}
// --- cSourceParams ---------------------------------------------------------
cSourceParams SourceParams;
cSourceParam *cSourceParams::Get(char Source) const
{
for (cSourceParam *sp = First(); sp; sp = Next(sp)) {
if (sp->Source() == Source)
return sp;
}
return NULL;
}