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

79 lines
2.0 KiB
C
Raw Normal View History

2014-03-08 12:07:47 +01:00
/*
* config.c: SAT>IP plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#include "discover.h"
2014-12-05 22:14:40 +01:00
#include "log.h"
2014-03-08 12:07:47 +01:00
#include "config.h"
cSatipConfig SatipConfig;
cSatipConfig::cSatipConfig(void)
: operatingModeM(eOperatingModeLow),
2014-12-21 15:11:05 +01:00
traceModeM(eTraceModeNormal),
ciExtensionM(0),
eitScanM(1),
useBytesM(1),
disableServerQuirksM(false),
useSingleModelServersM(false)
2014-03-08 12:07:47 +01:00
{
2015-01-11 00:49:59 +01:00
for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i)
cicamsM[i] = 0;
for (unsigned int i = 0; i < ELEMENTS(disabledSourcesM); ++i)
2014-10-31 21:07:33 +01:00
disabledSourcesM[i] = cSource::stNone;
2015-01-11 00:49:59 +01:00
for (unsigned int i = 0; i < ELEMENTS(disabledFiltersM); ++i)
2014-03-08 12:07:47 +01:00
disabledFiltersM[i] = -1;
}
2015-01-11 00:49:59 +01:00
int cSatipConfig::GetCICAM(unsigned int indexP) const
{
return (indexP < ELEMENTS(cicamsM)) ? cicamsM[indexP] : -1;
}
void cSatipConfig::SetCICAM(unsigned int indexP, int cicamP)
{
if (indexP < ELEMENTS(cicamsM))
cicamsM[indexP] = cicamP;
}
2014-10-31 21:07:33 +01:00
unsigned int cSatipConfig::GetDisabledSourcesCount(void) const
{
unsigned int n = 0;
2015-01-11 00:49:59 +01:00
while ((n < ELEMENTS(disabledSourcesM) && (disabledSourcesM[n] != cSource::stNone)))
2014-10-31 21:07:33 +01:00
n++;
return n;
}
int cSatipConfig::GetDisabledSources(unsigned int indexP) const
{
2015-01-11 00:49:59 +01:00
return (indexP < ELEMENTS(disabledSourcesM)) ? disabledSourcesM[indexP] : cSource::stNone;
2014-10-31 21:07:33 +01:00
}
void cSatipConfig::SetDisabledSources(unsigned int indexP, int sourceP)
{
2015-01-11 00:49:59 +01:00
if (indexP < ELEMENTS(disabledSourcesM))
2014-10-31 21:07:33 +01:00
disabledSourcesM[indexP] = sourceP;
}
2014-03-08 12:07:47 +01:00
unsigned int cSatipConfig::GetDisabledFiltersCount(void) const
{
unsigned int n = 0;
2015-01-11 00:49:59 +01:00
while ((n < ELEMENTS(disabledFiltersM) && (disabledFiltersM[n] != -1)))
2014-03-08 12:07:47 +01:00
n++;
return n;
}
int cSatipConfig::GetDisabledFilters(unsigned int indexP) const
{
2015-01-11 00:49:59 +01:00
return (indexP < ELEMENTS(disabledFiltersM)) ? disabledFiltersM[indexP] : -1;
2014-03-08 12:07:47 +01:00
}
void cSatipConfig::SetDisabledFilters(unsigned int indexP, int numberP)
{
2015-01-11 00:49:59 +01:00
if (indexP < ELEMENTS(disabledFiltersM))
2014-03-08 12:07:47 +01:00
disabledFiltersM[indexP] = numberP;
}