2007-09-15 17:38:38 +02:00
|
|
|
/*
|
|
|
|
* config.c: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
cIptvConfig IptvConfig;
|
|
|
|
|
|
|
|
cIptvConfig::cIptvConfig(void)
|
2009-02-26 15:04:12 +01:00
|
|
|
: tsBufferSize(2),
|
2007-09-30 23:38:31 +02:00
|
|
|
tsBufferPrefillRatio(0),
|
2007-10-20 19:26:46 +02:00
|
|
|
extProtocolBasePort(4321),
|
2007-10-09 01:51:58 +02:00
|
|
|
useBytes(1),
|
2008-02-01 22:54:24 +01:00
|
|
|
sectionFiltering(1)
|
2007-09-15 17:38:38 +02:00
|
|
|
{
|
2009-02-24 12:40:16 +01:00
|
|
|
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters); ++i)
|
2007-10-06 02:02:50 +02:00
|
|
|
disabledFilters[i] = -1;
|
2007-10-20 00:54:03 +02:00
|
|
|
memset(configDirectory, '\0', sizeof(configDirectory));
|
2007-10-06 02:02:50 +02:00
|
|
|
}
|
|
|
|
|
2008-01-05 00:36:37 +01:00
|
|
|
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
|
2007-10-06 02:02:50 +02:00
|
|
|
{
|
|
|
|
unsigned int n = 0;
|
2009-03-20 16:43:31 +01:00
|
|
|
while ((n < ARRAY_SIZE(disabledFilters) && (disabledFilters[n] != -1)))
|
2008-02-01 22:54:24 +01:00
|
|
|
n++;
|
2007-10-06 02:02:50 +02:00
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2008-01-05 00:36:37 +01:00
|
|
|
int cIptvConfig::GetDisabledFilters(unsigned int Index) const
|
2007-10-06 02:02:50 +02:00
|
|
|
{
|
2008-01-05 00:36:37 +01:00
|
|
|
return (Index < ARRAY_SIZE(disabledFilters)) ? disabledFilters[Index] : -1;
|
2007-10-06 02:02:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
|
|
|
|
{
|
2008-01-05 00:36:37 +01:00
|
|
|
if (Index < ARRAY_SIZE(disabledFilters))
|
2007-10-06 02:02:50 +02:00
|
|
|
disabledFilters[Index] = Number;
|
2007-09-15 17:38:38 +02:00
|
|
|
}
|
2007-10-20 00:54:03 +02:00
|
|
|
|
|
|
|
void cIptvConfig::SetConfigDirectory(const char *directoryP)
|
|
|
|
{
|
2012-03-30 18:01:46 +02:00
|
|
|
debug("cIptvConfig::SetConfigDirectory(%s)\n", directoryP);
|
2010-12-03 15:00:40 +01:00
|
|
|
ERROR_IF(!realpath(directoryP, configDirectory), "Cannot canonicalize configuration directory");
|
2007-10-20 00:54:03 +02:00
|
|
|
}
|