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

55 lines
1.5 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.
*
*/
2015-03-08 13:33:18 +01:00
#include "log.h"
2007-09-15 17:38:38 +02:00
#include "config.h"
cIptvConfig IptvConfig;
cIptvConfig::cIptvConfig(void)
2015-03-08 13:33:18 +01:00
: traceModeM(eTraceModeNormal),
protocolBasePortM(4321),
2013-02-23 14:31:11 +01:00
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));
memset(resourceDirectoryM, 0, sizeof(resourceDirectoryM));
}
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)
{
2015-03-08 13:33:18 +01:00
debug1("%s (%s)", __PRETTY_FUNCTION__, directoryP);
2013-02-23 14:31:11 +01:00
ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory");
}
void cIptvConfig::SetResourceDirectory(const char *directoryP)
{
2015-03-08 13:33:18 +01:00
debug1("%s (%s)", __PRETTY_FUNCTION__, directoryP);
ERROR_IF(!realpath(directoryP, resourceDirectoryM), "Cannot canonicalize resource directory");
}