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)
2013-02-23 14:31:11 +01:00
: tsBufferSizeM(2),
tsBufferPrefillRatioM(0),
extProtocolBasePortM(4321),
useBytesM(1),
sectionFilteringM(1)
2007-09-15 17:38:38 +02:00
{
2013-02-23 14:31:11 +01:00
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
disabledFiltersM[i] = -1;
2013-02-23 16:12:46 +01:00
memset(configDirectoryM, 0, sizeof(configDirectoryM));
}
2008-01-05 00:36:37 +01:00
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
{
unsigned int n = 0;
2013-02-23 14:31:11 +01:00
while ((n < ARRAY_SIZE(disabledFiltersM) && (disabledFiltersM[n] != -1)))
n++;
return n;
}
2013-02-23 14:31:11 +01:00
int cIptvConfig::GetDisabledFilters(unsigned int indexP) const
{
2013-02-23 14:31:11 +01:00
return (indexP < ARRAY_SIZE(disabledFiltersM)) ? disabledFiltersM[indexP] : -1;
}
2013-02-23 14:31:11 +01:00
void cIptvConfig::SetDisabledFilters(unsigned int indexP, int numberP)
{
2013-02-23 14:31:11 +01:00
if (indexP < ARRAY_SIZE(disabledFiltersM))
disabledFiltersM[indexP] = numberP;
2007-09-15 17:38:38 +02:00
}
void cIptvConfig::SetConfigDirectory(const char *directoryP)
{
2013-02-23 16:12:46 +01:00
debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP);
2013-02-23 14:31:11 +01:00
ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory");
}