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.
|
|
|
|
*
|
2015-09-01 11:14:27 +02:00
|
|
|
* $Id: sourceparams.c 4.1 2015/08/02 11:56: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);
|
2014-03-09 12:11:32 +01:00
|
|
|
if (!Sources.ContainsSourceType(source))
|
|
|
|
Sources.Add(new cSource(source, Description));
|
2010-02-28 12:19:50 +01:00
|
|
|
dsyslog("registered source parameters for '%c - %s'", source, Description);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
esyslog("ERROR: invalid source '%c'", source);
|
|
|
|
}
|
|
|
|
|
|
|
|
// --- cSourceParams ---------------------------------------------------------
|
|
|
|
|
|
|
|
cSourceParams SourceParams;
|
|
|
|
|
2015-09-01 11:14:27 +02:00
|
|
|
cSourceParam *cSourceParams::Get(char Source)
|
2010-02-28 12:19:50 +01:00
|
|
|
{
|
|
|
|
for (cSourceParam *sp = First(); sp; sp = Next(sp)) {
|
|
|
|
if (sp->Source() == Source)
|
|
|
|
return sp;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|