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)
|
2007-09-28 18:44:59 +02:00
|
|
|
: readBufferTsCount(48),
|
|
|
|
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
|
|
|
{
|
2008-01-05 00:36:37 +01:00
|
|
|
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters) - 1; ++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;
|
2008-01-05 00:36:37 +01:00
|
|
|
while ((disabledFilters[n] != -1) && (n < ARRAY_SIZE(disabledFilters) - 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)
|
|
|
|
{
|
|
|
|
debug("cIptvConfig::SetConfigDirectory(%s)", directoryP);
|
|
|
|
strn0cpy(configDirectory, directoryP, sizeof(configDirectory));
|
|
|
|
}
|