1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00
vdr-plugin-iptv/config.c

48 lines
1.2 KiB
C
Raw Normal View History

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),
tsBufferPrefillRatio(0),
extProtocolBasePort(4321),
useBytes(1),
sectionFiltering(1)
2007-09-15 17:38:38 +02:00
{
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters); ++i)
disabledFilters[i] = -1;
memset(configDirectory, '\0', sizeof(configDirectory));
}
2008-01-05 00:36:37 +01:00
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
{
unsigned int n = 0;
2009-03-20 16:43:31 +01:00
while ((n < ARRAY_SIZE(disabledFilters) && (disabledFilters[n] != -1)))
n++;
return n;
}
2008-01-05 00:36:37 +01:00
int cIptvConfig::GetDisabledFilters(unsigned int Index) const
{
2008-01-05 00:36:37 +01:00
return (Index < ARRAY_SIZE(disabledFilters)) ? disabledFilters[Index] : -1;
}
void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
{
2008-01-05 00:36:37 +01:00
if (Index < ARRAY_SIZE(disabledFilters))
disabledFilters[Index] = Number;
2007-09-15 17:38:38 +02:00
}
void cIptvConfig::SetConfigDirectory(const char *directoryP)
{
debug("cIptvConfig::SetConfigDirectory(%s)\n", directoryP);
ERROR_IF(!realpath(directoryP, configDirectory), "Cannot canonicalize configuration directory");
}