mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Added support for blacklisted sources.
This commit is contained in:
parent
3630a9f78a
commit
c4d82eac36
1
HISTORY
1
HISTORY
@ -68,3 +68,4 @@ VDR Plugin 'satip' Revision History
|
|||||||
2014-xx-xx: Version 0.3.4
|
2014-xx-xx: Version 0.3.4
|
||||||
|
|
||||||
- Fixed the cable only device detection.
|
- Fixed the cable only device detection.
|
||||||
|
- Added support for blacklisted sources.
|
||||||
|
5
README
5
README
@ -71,10 +71,13 @@ Setup menu:
|
|||||||
- Enable EPG scanning = yes If you want exclude all SAT>IP devices
|
- Enable EPG scanning = yes If you want exclude all SAT>IP devices
|
||||||
from VDR's EIT background scanning, set
|
from VDR's EIT background scanning, set
|
||||||
this option to "no".
|
this option to "no".
|
||||||
|
- Disabled sources = none If your SAT>IP servers don't have certain
|
||||||
|
satellite positions available you can
|
||||||
|
disable them via this option.
|
||||||
- Disabled filters = none Certain section filters might cause some
|
- Disabled filters = none Certain section filters might cause some
|
||||||
unwanted behaviour to VDR such as time
|
unwanted behaviour to VDR such as time
|
||||||
being falsely synchronized etc. This option
|
being falsely synchronized etc. This option
|
||||||
allows creation of blacklists of ill-behaving
|
allows creation of blacklists of ill-behaving
|
||||||
filters. If this option is set to a non-zero
|
filters. If this option is set to a non-zero
|
||||||
value, the menu page will contain that many
|
value, the menu page will contain that many
|
||||||
"Disable filter" options which allow you
|
"Disable filter" options which allow you
|
||||||
|
1
common.h
1
common.h
@ -36,6 +36,7 @@
|
|||||||
#define SATIP_STATS_ACTIVE_PIDS_COUNT 10
|
#define SATIP_STATS_ACTIVE_PIDS_COUNT 10
|
||||||
#define SATIP_STATS_ACTIVE_FILTERS_COUNT 10
|
#define SATIP_STATS_ACTIVE_FILTERS_COUNT 10
|
||||||
|
|
||||||
|
#define MAX_DISABLED_SOURCES_COUNT 5
|
||||||
#define SECTION_FILTER_TABLE_SIZE 5
|
#define SECTION_FILTER_TABLE_SIZE 5
|
||||||
|
|
||||||
#define SATIP_CURL_EASY_GETINFO(X, Y, Z) \
|
#define SATIP_CURL_EASY_GETINFO(X, Y, Z) \
|
||||||
|
21
config.c
21
config.c
@ -15,11 +15,32 @@ cSatipConfig::cSatipConfig(void)
|
|||||||
eitScanM(1),
|
eitScanM(1),
|
||||||
useBytesM(1)
|
useBytesM(1)
|
||||||
{
|
{
|
||||||
|
for (unsigned int i = 0; i < ARRAY_SIZE(disabledSourcesM); ++i)
|
||||||
|
disabledSourcesM[i] = cSource::stNone;
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
|
||||||
disabledFiltersM[i] = -1;
|
disabledFiltersM[i] = -1;
|
||||||
memset(configDirectoryM, 0, sizeof(configDirectoryM));
|
memset(configDirectoryM, 0, sizeof(configDirectoryM));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int cSatipConfig::GetDisabledSourcesCount(void) const
|
||||||
|
{
|
||||||
|
unsigned int n = 0;
|
||||||
|
while ((n < ARRAY_SIZE(disabledSourcesM) && (disabledSourcesM[n] != cSource::stNone)))
|
||||||
|
n++;
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cSatipConfig::GetDisabledSources(unsigned int indexP) const
|
||||||
|
{
|
||||||
|
return (indexP < ARRAY_SIZE(disabledSourcesM)) ? disabledSourcesM[indexP] : cSource::stNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cSatipConfig::SetDisabledSources(unsigned int indexP, int sourceP)
|
||||||
|
{
|
||||||
|
if (indexP < ARRAY_SIZE(disabledSourcesM))
|
||||||
|
disabledSourcesM[indexP] = sourceP;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int cSatipConfig::GetDisabledFiltersCount(void) const
|
unsigned int cSatipConfig::GetDisabledFiltersCount(void) const
|
||||||
{
|
{
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
|
4
config.h
4
config.h
@ -17,6 +17,7 @@ private:
|
|||||||
unsigned int operatingModeM;
|
unsigned int operatingModeM;
|
||||||
unsigned int eitScanM;
|
unsigned int eitScanM;
|
||||||
unsigned int useBytesM;
|
unsigned int useBytesM;
|
||||||
|
int disabledSourcesM[MAX_DISABLED_SOURCES_COUNT];
|
||||||
int disabledFiltersM[SECTION_FILTER_TABLE_SIZE];
|
int disabledFiltersM[SECTION_FILTER_TABLE_SIZE];
|
||||||
char configDirectoryM[PATH_MAX];
|
char configDirectoryM[PATH_MAX];
|
||||||
|
|
||||||
@ -38,6 +39,8 @@ public:
|
|||||||
unsigned int GetEITScan(void) const { return eitScanM; }
|
unsigned int GetEITScan(void) const { return eitScanM; }
|
||||||
unsigned int GetUseBytes(void) const { return useBytesM; }
|
unsigned int GetUseBytes(void) const { return useBytesM; }
|
||||||
const char *GetConfigDirectory(void) const { return configDirectoryM; }
|
const char *GetConfigDirectory(void) const { return configDirectoryM; }
|
||||||
|
unsigned int GetDisabledSourcesCount(void) const;
|
||||||
|
int GetDisabledSources(unsigned int indexP) const;
|
||||||
unsigned int GetDisabledFiltersCount(void) const;
|
unsigned int GetDisabledFiltersCount(void) const;
|
||||||
int GetDisabledFilters(unsigned int indexP) const;
|
int GetDisabledFilters(unsigned int indexP) const;
|
||||||
|
|
||||||
@ -45,6 +48,7 @@ public:
|
|||||||
void SetEITScan(unsigned int onOffP) { eitScanM = onOffP; }
|
void SetEITScan(unsigned int onOffP) { eitScanM = onOffP; }
|
||||||
void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; }
|
void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; }
|
||||||
void SetConfigDirectory(const char *directoryP);
|
void SetConfigDirectory(const char *directoryP);
|
||||||
|
void SetDisabledSources(unsigned int indexP, int sourceP);
|
||||||
void SetDisabledFilters(unsigned int indexP, int numberP);
|
void SetDisabledFilters(unsigned int indexP, int numberP);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
10
device.c
10
device.c
@ -185,7 +185,15 @@ int cSatipDevice::SignalQuality(void) const
|
|||||||
bool cSatipDevice::ProvidesSource(int sourceP) const
|
bool cSatipDevice::ProvidesSource(int sourceP) const
|
||||||
{
|
{
|
||||||
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||||
return (!SatipConfig.IsOperatingModeOff() && !!cSatipDiscover::GetInstance()->GetServer(sourceP));
|
if (!SatipConfig.IsOperatingModeOff() && !!cSatipDiscover::GetInstance()->GetServer(sourceP)) {
|
||||||
|
int numDisabledSourcesM = SatipConfig.GetDisabledSourcesCount();
|
||||||
|
for (int i = 0; i < numDisabledSourcesM; ++i) {
|
||||||
|
if (sourceP == SatipConfig.GetDisabledSources(i))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipDevice::ProvidesTransponder(const cChannel *channelP) const
|
bool cSatipDevice::ProvidesTransponder(const cChannel *channelP) const
|
||||||
|
22
po/ca_ES.po
22
po/ca_ES.po
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-05-18 05:18+0200\n"
|
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
||||||
"PO-Revision-Date: 2014-05-18 05:18+0200\n"
|
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
||||||
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
||||||
"Language-Team: Catalan <vdr@linuxtv.org>\n"
|
"Language-Team: Catalan <vdr@linuxtv.org>\n"
|
||||||
"Language: ca\n"
|
"Language: ca\n"
|
||||||
@ -109,16 +109,28 @@ msgstr ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Aquesta configuració desactiva la funcionalitat d'escaneig EIT automàtica per a tots els dispositius SAT>IP."
|
"Aquesta configuració desactiva la funcionalitat d'escaneig EIT automàtica per a tots els dispositius SAT>IP."
|
||||||
|
|
||||||
msgid "Disabled filters"
|
msgid "Disabled sources"
|
||||||
msgstr "Desactiva filtres"
|
msgstr ""
|
||||||
|
|
||||||
msgid "none"
|
msgid "none"
|
||||||
msgstr "no"
|
msgstr "no"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define number of sources to be disabled.\n"
|
||||||
|
"\n"
|
||||||
|
"SAT>IP servers might not have all satellite positions available and such sources can be blacklisted here."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Define a source to be blacklisted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Disabled filters"
|
||||||
|
msgstr "Desactiva filtres"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define number of section filters to be disabled.\n"
|
"Define number of section filters to be disabled.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By blacklisting the filters here, useful section data can be left intact for VDR to process."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Defineix el numero de filtres de secció que seran deshabilitats.\n"
|
"Defineix el numero de filtres de secció que seran deshabilitats.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
22
po/de_DE.po
22
po/de_DE.po
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-05-18 05:18+0200\n"
|
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
||||||
"PO-Revision-Date: 2014-05-18 05:18+0200\n"
|
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
||||||
"Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
|
"Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
|
||||||
"Language-Team: German <vdr@linuxtv.org>\n"
|
"Language-Team: German <vdr@linuxtv.org>\n"
|
||||||
"Language: de\n"
|
"Language: de\n"
|
||||||
@ -109,16 +109,28 @@ msgstr ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Diese Einstellung schaltet die automatische EIT Aktualisierung für alle SAT>IP Geräte."
|
"Diese Einstellung schaltet die automatische EIT Aktualisierung für alle SAT>IP Geräte."
|
||||||
|
|
||||||
msgid "Disabled filters"
|
msgid "Disabled sources"
|
||||||
msgstr "Deaktivierte Filter"
|
msgstr ""
|
||||||
|
|
||||||
msgid "none"
|
msgid "none"
|
||||||
msgstr "keine"
|
msgstr "keine"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define number of sources to be disabled.\n"
|
||||||
|
"\n"
|
||||||
|
"SAT>IP servers might not have all satellite positions available and such sources can be blacklisted here."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Define a source to be blacklisted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Disabled filters"
|
||||||
|
msgstr "Deaktivierte Filter"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define number of section filters to be disabled.\n"
|
"Define number of section filters to be disabled.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By blacklisting the filters here, useful section data can be left intact for VDR to process."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Bestimme die Anzahl der Abschnittsfilter die deaktiviert werden sollen.\n"
|
"Bestimme die Anzahl der Abschnittsfilter die deaktiviert werden sollen.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
22
po/es_ES.po
22
po/es_ES.po
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-05-18 05:18+0200\n"
|
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
||||||
"PO-Revision-Date: 2014-05-18 05:18+0200\n"
|
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
||||||
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
||||||
"Language-Team: Spanish <vdr@linuxtv.org>\n"
|
"Language-Team: Spanish <vdr@linuxtv.org>\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
@ -109,16 +109,28 @@ msgstr ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Esta configuración desactiva la funcionalidad del escaneo EIT automática para todos los Dispositivos SAT>IP."
|
"Esta configuración desactiva la funcionalidad del escaneo EIT automática para todos los Dispositivos SAT>IP."
|
||||||
|
|
||||||
msgid "Disabled filters"
|
msgid "Disabled sources"
|
||||||
msgstr "Desactiva filtros"
|
msgstr ""
|
||||||
|
|
||||||
msgid "none"
|
msgid "none"
|
||||||
msgstr "no"
|
msgstr "no"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define number of sources to be disabled.\n"
|
||||||
|
"\n"
|
||||||
|
"SAT>IP servers might not have all satellite positions available and such sources can be blacklisted here."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Define a source to be blacklisted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Disabled filters"
|
||||||
|
msgstr "Desactiva filtros"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define number of section filters to be disabled.\n"
|
"Define number of section filters to be disabled.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By blacklisting the filters here, useful section data can be left intact for VDR to process."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Define el numero de filtros de sección que seran deshabilitados.\n"
|
"Define el numero de filtros de sección que seran deshabilitados.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
25
po/fi_FI.po
25
po/fi_FI.po
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-satip 0.3.4\n"
|
"Project-Id-Version: vdr-satip 0.3.4\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\n"
|
"Report-Msgid-Bugs-To: <see README>\n"
|
||||||
"POT-Creation-Date: 2014-05-18 05:18+0200\n"
|
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
|
||||||
"PO-Revision-Date: 2014-05-18 05:18+0200\n"
|
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
|
||||||
"Last-Translator: Rolf Ahrenberg\n"
|
"Last-Translator: Rolf Ahrenberg\n"
|
||||||
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
||||||
"Language: fi\n"
|
"Language: fi\n"
|
||||||
@ -108,16 +108,31 @@ msgstr ""
|
|||||||
"\n"
|
"\n"
|
||||||
"Tällä asetuksella saadaan otettua automaattinen EIT-datan päivitys pois päältä kaikilta SAT>IP-laitteilta."
|
"Tällä asetuksella saadaan otettua automaattinen EIT-datan päivitys pois päältä kaikilta SAT>IP-laitteilta."
|
||||||
|
|
||||||
msgid "Disabled filters"
|
msgid "Disabled sources"
|
||||||
msgstr "Käytöstä poistetut suodattimet"
|
msgstr "Käytöstä poistetut lähteet"
|
||||||
|
|
||||||
msgid "none"
|
msgid "none"
|
||||||
msgstr "tyhjä"
|
msgstr "tyhjä"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Define number of sources to be disabled.\n"
|
||||||
|
"\n"
|
||||||
|
"SAT>IP servers might not have all satellite positions available and such sources can be blacklisted here."
|
||||||
|
msgstr ""
|
||||||
|
"Määrittele käytöstä poistettavien lähteiden lukumäärä.\n"
|
||||||
|
"\n"
|
||||||
|
"SAT>IP-palvelimilla ei välttämättä ole kaikkia ohjelmalähteitä tarjolla."
|
||||||
|
|
||||||
|
msgid "Define a source to be blacklisted."
|
||||||
|
msgstr "Määrittele käytöstä"
|
||||||
|
|
||||||
|
msgid "Disabled filters"
|
||||||
|
msgstr "Käytöstä poistetut suodattimet"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define number of section filters to be disabled.\n"
|
"Define number of section filters to be disabled.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."
|
"Certain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By blacklisting the filters here, useful section data can be left intact for VDR to process."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Määrittele käytöstä poistettavien suodattimien lukumäärä sektioille.\n"
|
"Määrittele käytöstä poistettavien suodattimien lukumäärä sektioille.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
26
satip.c
26
satip.c
@ -32,6 +32,7 @@ class cPluginSatip : public cPlugin {
|
|||||||
private:
|
private:
|
||||||
unsigned int deviceCountM;
|
unsigned int deviceCountM;
|
||||||
cSatipDiscover *discoverM;
|
cSatipDiscover *discoverM;
|
||||||
|
int ParseSources(const char *valueP, int *sourcesP);
|
||||||
int ParseFilters(const char *valueP, int *filtersP);
|
int ParseFilters(const char *valueP, int *filtersP);
|
||||||
public:
|
public:
|
||||||
cPluginSatip(void);
|
cPluginSatip(void);
|
||||||
@ -177,6 +178,23 @@ cMenuSetupPage *cPluginSatip::SetupMenu(void)
|
|||||||
return new cSatipPluginSetup();
|
return new cSatipPluginSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cPluginSatip::ParseSources(const char *valueP, int *sourcesP)
|
||||||
|
{
|
||||||
|
debug("cPluginSatip::%s(%s)", __FUNCTION__, valueP);
|
||||||
|
int n = 0;
|
||||||
|
char *s, *p = (char *)valueP;
|
||||||
|
char *r = strtok_r(p, " ", &s);
|
||||||
|
while (r) {
|
||||||
|
r = skipspace(r);
|
||||||
|
debug("cPluginSatip::%s(): sources[%d]=%s", __FUNCTION__, n, r);
|
||||||
|
if (n < MAX_DISABLED_SOURCES_COUNT) {
|
||||||
|
sourcesP[n++] = cSource::FromString(r);
|
||||||
|
}
|
||||||
|
r = strtok_r(NULL, " \n", &s);
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
int cPluginSatip::ParseFilters(const char *valueP, int *filtersP)
|
int cPluginSatip::ParseFilters(const char *valueP, int *filtersP)
|
||||||
{
|
{
|
||||||
debug("cPluginSatip::%s(%s)", __FUNCTION__, valueP);
|
debug("cPluginSatip::%s(%s)", __FUNCTION__, valueP);
|
||||||
@ -202,6 +220,14 @@ bool cPluginSatip::SetupParse(const char *nameP, const char *valueP)
|
|||||||
SatipConfig.SetOperatingMode(atoi(valueP));
|
SatipConfig.SetOperatingMode(atoi(valueP));
|
||||||
else if (!strcasecmp(nameP, "EnableEITScan"))
|
else if (!strcasecmp(nameP, "EnableEITScan"))
|
||||||
SatipConfig.SetEITScan(atoi(valueP));
|
SatipConfig.SetEITScan(atoi(valueP));
|
||||||
|
else if (!strcasecmp(nameP, "DisabledSources")) {
|
||||||
|
int DisabledSources[MAX_DISABLED_SOURCES_COUNT];
|
||||||
|
for (unsigned int i = 0; i < ARRAY_SIZE(DisabledSources); ++i)
|
||||||
|
DisabledSources[i] = cSource::stNone;
|
||||||
|
unsigned int DisabledSourcesCount = ParseSources(valueP, DisabledSources);
|
||||||
|
for (unsigned int i = 0; i < DisabledSourcesCount; ++i)
|
||||||
|
SatipConfig.SetDisabledSources(i, DisabledSources[i]);
|
||||||
|
}
|
||||||
else if (!strcasecmp(nameP, "DisabledFilters")) {
|
else if (!strcasecmp(nameP, "DisabledFilters")) {
|
||||||
int DisabledFilters[SECTION_FILTER_TABLE_SIZE];
|
int DisabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||||
for (unsigned int i = 0; i < ARRAY_SIZE(DisabledFilters); ++i)
|
for (unsigned int i = 0; i < ARRAY_SIZE(DisabledFilters); ++i)
|
||||||
|
@ -37,10 +37,10 @@ cSatipSectionFilter::cSatipSectionFilter(int deviceIndexP, uint16_t pidP, uint8_
|
|||||||
for (i = 0; i < eDmxMaxFilterSize; ++i)
|
for (i = 0; i < eDmxMaxFilterSize; ++i)
|
||||||
filterValueM[i] ^= 0xFF;
|
filterValueM[i] ^= 0xFF;
|
||||||
|
|
||||||
uint8_t mask, mode, doneq = 0;
|
uint8_t doneq = 0;
|
||||||
for (i = 0; i < eDmxMaxFilterSize; ++i) {
|
for (i = 0; i < eDmxMaxFilterSize; ++i) {
|
||||||
mode = filterModeM[i];
|
uint8_t mode = filterModeM[i];
|
||||||
mask = filterMaskM[i];
|
uint8_t mask = filterMaskM[i];
|
||||||
maskAndModeM[i] = (uint8_t)(mask & mode);
|
maskAndModeM[i] = (uint8_t)(mask & mode);
|
||||||
maskAndNotModeM[i] = (uint8_t)(mask & ~mode);
|
maskAndNotModeM[i] = (uint8_t)(mask & ~mode);
|
||||||
doneq |= maskAndNotModeM[i];
|
doneq |= maskAndNotModeM[i];
|
||||||
@ -117,7 +117,7 @@ inline int cSatipSectionFilter::Feed(void)
|
|||||||
|
|
||||||
int cSatipSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
|
int cSatipSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
|
||||||
{
|
{
|
||||||
uint16_t limit, seclen, n;
|
uint16_t limit, n;
|
||||||
|
|
||||||
if (tsFeedpM >= eDmxMaxSectionFeedSize)
|
if (tsFeedpM >= eDmxMaxSectionFeedSize)
|
||||||
return 0;
|
return 0;
|
||||||
@ -139,7 +139,7 @@ int cSatipSectionFilter::CopyDump(const uint8_t *bufP, uint8_t lenP)
|
|||||||
secBufM = secBufBaseM + secBufpM;
|
secBufM = secBufBaseM + secBufpM;
|
||||||
|
|
||||||
for (n = 0; secBufpM + 2 < limit; ++n) {
|
for (n = 0; secBufpM + 2 < limit; ++n) {
|
||||||
seclen = GetLength(secBufM);
|
uint16_t seclen = GetLength(secBufM);
|
||||||
if ((seclen <= 0) || (seclen > eDmxMaxSectionSize) || ((seclen + secBufpM) > limit))
|
if ((seclen <= 0) || (seclen > eDmxMaxSectionSize) || ((seclen + secBufpM) > limit))
|
||||||
return 0;
|
return 0;
|
||||||
secLenM = seclen;
|
secLenM = seclen;
|
||||||
|
124
setup.c
124
setup.c
@ -14,6 +14,72 @@
|
|||||||
#include "discover.h"
|
#include "discover.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
// --- cSatipEditSrcItem ------------------------------------------------------
|
||||||
|
// This class is a 99% copy of cMenuEditSrcItem() taken from VDR's menu.c
|
||||||
|
|
||||||
|
class cSatipEditSrcItem : public cMenuEditIntItem {
|
||||||
|
private:
|
||||||
|
const cSource *source;
|
||||||
|
protected:
|
||||||
|
virtual void Set(void);
|
||||||
|
public:
|
||||||
|
cSatipEditSrcItem(const char *Name, int *Value);
|
||||||
|
eOSState ProcessKey(eKeys Key);
|
||||||
|
};
|
||||||
|
|
||||||
|
cSatipEditSrcItem::cSatipEditSrcItem(const char *Name, int *Value)
|
||||||
|
:cMenuEditIntItem(Name, Value, 0)
|
||||||
|
{
|
||||||
|
source = Sources.Get(*Value);
|
||||||
|
if (!source)
|
||||||
|
source = Sources.First();
|
||||||
|
Set();
|
||||||
|
}
|
||||||
|
|
||||||
|
void cSatipEditSrcItem::Set(void)
|
||||||
|
{
|
||||||
|
if (source)
|
||||||
|
SetValue(cString::sprintf("%s - %s", *cSource::ToString(source->Code()), source->Description()));
|
||||||
|
else
|
||||||
|
cMenuEditIntItem::Set();
|
||||||
|
}
|
||||||
|
|
||||||
|
eOSState cSatipEditSrcItem::ProcessKey(eKeys Key)
|
||||||
|
{
|
||||||
|
eOSState state = cMenuEditItem::ProcessKey(Key);
|
||||||
|
|
||||||
|
if (state == osUnknown) {
|
||||||
|
bool IsRepeat = Key & k_Repeat;
|
||||||
|
Key = NORMALKEY(Key);
|
||||||
|
if (Key == kLeft) { // TODO might want to increase the delta if repeated quickly?
|
||||||
|
if (source) {
|
||||||
|
if (source->Prev())
|
||||||
|
source = (cSource *)source->Prev();
|
||||||
|
else if (!IsRepeat)
|
||||||
|
source = Sources.Last();
|
||||||
|
*value = source->Code();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Key == kRight) {
|
||||||
|
if (source) {
|
||||||
|
if (source->Next())
|
||||||
|
source = (cSource *)source->Next();
|
||||||
|
else if (!IsRepeat)
|
||||||
|
source = Sources.First();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
source = Sources.First();
|
||||||
|
if (source)
|
||||||
|
*value = source->Code();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return state; // we don't call cMenuEditIntItem::ProcessKey(Key) here since we don't accept numerical input
|
||||||
|
Set();
|
||||||
|
state = osContinue;
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
// --- cSatipServerInfo -------------------------------------------------------
|
// --- cSatipServerInfo -------------------------------------------------------
|
||||||
|
|
||||||
class cSatipServerInfo : public cOsdMenu
|
class cSatipServerInfo : public cOsdMenu
|
||||||
@ -198,6 +264,7 @@ cSatipPluginSetup::cSatipPluginSetup()
|
|||||||
: deviceCountM(0),
|
: deviceCountM(0),
|
||||||
operatingModeM(SatipConfig.GetOperatingMode()),
|
operatingModeM(SatipConfig.GetOperatingMode()),
|
||||||
eitScanM(SatipConfig.GetEITScan()),
|
eitScanM(SatipConfig.GetEITScan()),
|
||||||
|
numDisabledSourcesM(SatipConfig.GetDisabledSourcesCount()),
|
||||||
numDisabledFiltersM(SatipConfig.GetDisabledFiltersCount())
|
numDisabledFiltersM(SatipConfig.GetDisabledFiltersCount())
|
||||||
{
|
{
|
||||||
debug("cSatipPluginSetup::%s()", __FUNCTION__);
|
debug("cSatipPluginSetup::%s()", __FUNCTION__);
|
||||||
@ -205,6 +272,10 @@ cSatipPluginSetup::cSatipPluginSetup()
|
|||||||
operatingModeTextsM[cSatipConfig::eOperatingModeLow] = tr("low");
|
operatingModeTextsM[cSatipConfig::eOperatingModeLow] = tr("low");
|
||||||
operatingModeTextsM[cSatipConfig::eOperatingModeNormal] = tr("normal");
|
operatingModeTextsM[cSatipConfig::eOperatingModeNormal] = tr("normal");
|
||||||
operatingModeTextsM[cSatipConfig::eOperatingModeHigh] = tr("high");
|
operatingModeTextsM[cSatipConfig::eOperatingModeHigh] = tr("high");
|
||||||
|
if (numDisabledSourcesM > MAX_DISABLED_SOURCES_COUNT)
|
||||||
|
numDisabledSourcesM = MAX_DISABLED_SOURCES_COUNT;
|
||||||
|
for (int i = 0; i < MAX_DISABLED_SOURCES_COUNT; ++i)
|
||||||
|
disabledSourcesM[i] = SatipConfig.GetDisabledSources(i);
|
||||||
if (numDisabledFiltersM > SECTION_FILTER_TABLE_SIZE)
|
if (numDisabledFiltersM > SECTION_FILTER_TABLE_SIZE)
|
||||||
numDisabledFiltersM = SECTION_FILTER_TABLE_SIZE;
|
numDisabledFiltersM = SECTION_FILTER_TABLE_SIZE;
|
||||||
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) {
|
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) {
|
||||||
@ -230,8 +301,16 @@ void cSatipPluginSetup::Setup(void)
|
|||||||
Add(new cMenuEditBoolItem(tr("Enable EPG scanning"), &eitScanM));
|
Add(new cMenuEditBoolItem(tr("Enable EPG scanning"), &eitScanM));
|
||||||
helpM.Append(tr("Define whether the EPG background scanning shall be used.\n\nThis setting disables the automatic EIT scanning functionality for all SAT>IP devices."));
|
helpM.Append(tr("Define whether the EPG background scanning shall be used.\n\nThis setting disables the automatic EIT scanning functionality for all SAT>IP devices."));
|
||||||
|
|
||||||
|
Add(new cMenuEditIntItem(tr("Disabled sources"), &numDisabledSourcesM, 0, MAX_DISABLED_SOURCES_COUNT, tr("none")));
|
||||||
|
helpM.Append(tr("Define number of sources to be disabled.\n\nSAT>IP servers might not have all satellite positions available and such sources can be blacklisted here."));
|
||||||
|
|
||||||
|
for (int i = 0; i < numDisabledSourcesM; ++i) {
|
||||||
|
Add(new cSatipEditSrcItem(*cString::sprintf(" %s %d", trVDR("Source"), i + 1), &disabledSourcesM[i]));
|
||||||
|
helpM.Append(tr("Define a source to be blacklisted."));
|
||||||
|
}
|
||||||
|
|
||||||
Add(new cMenuEditIntItem(tr("Disabled filters"), &numDisabledFiltersM, 0, SECTION_FILTER_TABLE_SIZE, tr("none")));
|
Add(new cMenuEditIntItem(tr("Disabled filters"), &numDisabledFiltersM, 0, SECTION_FILTER_TABLE_SIZE, tr("none")));
|
||||||
helpM.Append(tr("Define number of section filters to be disabled.\n\nCertain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By black-listing the filters here useful section data can be left intact for VDR to process."));
|
helpM.Append(tr("Define number of section filters to be disabled.\n\nCertain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By blacklisting the filters here, useful section data can be left intact for VDR to process."));
|
||||||
|
|
||||||
for (int i = 0; i < numDisabledFiltersM; ++i) {
|
for (int i = 0; i < numDisabledFiltersM; ++i) {
|
||||||
Add(new cMenuEditStraItem(*cString::sprintf(" %s %d", tr("Filter"), i + 1), &disabledFilterIndexesM[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNamesM));
|
Add(new cMenuEditStraItem(*cString::sprintf(" %s %d", tr("Filter"), i + 1), &disabledFilterIndexesM[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNamesM));
|
||||||
@ -286,6 +365,7 @@ eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
|
|||||||
{
|
{
|
||||||
bool hadSubMenu = HasSubMenu();
|
bool hadSubMenu = HasSubMenu();
|
||||||
int oldOperatingMode = operatingModeM;
|
int oldOperatingMode = operatingModeM;
|
||||||
|
int oldNumDisabledSources = numDisabledSourcesM;
|
||||||
int oldNumDisabledFilters = numDisabledFiltersM;
|
int oldNumDisabledFilters = numDisabledFiltersM;
|
||||||
eOSState state = cMenuSetupPage::ProcessKey(keyP);
|
eOSState state = cMenuSetupPage::ProcessKey(keyP);
|
||||||
|
|
||||||
@ -307,7 +387,9 @@ eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
|
|||||||
if ((keyP == kNone) && (cSatipDiscover::GetInstance()->GetServers()->Count() != deviceCountM))
|
if ((keyP == kNone) && (cSatipDiscover::GetInstance()->GetServers()->Count() != deviceCountM))
|
||||||
Setup();
|
Setup();
|
||||||
|
|
||||||
if ((keyP != kNone) && ((numDisabledFiltersM != oldNumDisabledFilters) || (operatingModeM != oldOperatingMode))) {
|
if ((keyP != kNone) && ((numDisabledSourcesM != oldNumDisabledSources) || (numDisabledFiltersM != oldNumDisabledFilters) || (operatingModeM != oldOperatingMode))) {
|
||||||
|
while ((numDisabledSourcesM < oldNumDisabledSources) && (oldNumDisabledSources > 0))
|
||||||
|
disabledSourcesM[--oldNumDisabledSources] = cSource::stNone;
|
||||||
while ((numDisabledFiltersM < oldNumDisabledFilters) && (oldNumDisabledFilters > 0))
|
while ((numDisabledFiltersM < oldNumDisabledFilters) && (oldNumDisabledFilters > 0))
|
||||||
disabledFilterIndexesM[--oldNumDisabledFilters] = -1;
|
disabledFilterIndexesM[--oldNumDisabledFilters] = -1;
|
||||||
Setup();
|
Setup();
|
||||||
@ -316,23 +398,36 @@ eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cSatipPluginSetup::StoreSources(const char *nameP, int *sourcesP)
|
||||||
|
{
|
||||||
|
cString buffer = "";
|
||||||
|
int n = 0;
|
||||||
|
for (int i = 0; i < MAX_DISABLED_SOURCES_COUNT; ++i) {
|
||||||
|
if (sourcesP[i] == cSource::stNone)
|
||||||
|
break;
|
||||||
|
if (n++ > 0)
|
||||||
|
buffer = cString::sprintf("%s %s", *buffer, *cSource::ToString(sourcesP[i]));
|
||||||
|
else
|
||||||
|
buffer = cString::sprintf("%s", *cSource::ToString(sourcesP[i]));
|
||||||
|
}
|
||||||
|
debug("cSatipPluginSetup::%s(%s, %s)", __FUNCTION__, nameP, *buffer);
|
||||||
|
SetupStore(nameP, *buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void cSatipPluginSetup::StoreFilters(const char *nameP, int *valuesP)
|
void cSatipPluginSetup::StoreFilters(const char *nameP, int *valuesP)
|
||||||
{
|
{
|
||||||
char buffer[SECTION_FILTER_TABLE_SIZE * 4];
|
cString buffer = "";
|
||||||
char *q = buffer;
|
int n = 0;
|
||||||
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) {
|
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) {
|
||||||
char s[3];
|
|
||||||
if (valuesP[i] < 0)
|
if (valuesP[i] < 0)
|
||||||
break;
|
break;
|
||||||
if (q > buffer)
|
if (n++ > 0)
|
||||||
*q++ = ' ';
|
buffer = cString::sprintf("%s %d", *buffer, valuesP[i]);
|
||||||
snprintf(s, sizeof(s), "%d", valuesP[i]);
|
else
|
||||||
strncpy(q, s, strlen(s));
|
buffer = cString::sprintf("%d", valuesP[i]);
|
||||||
q += strlen(s);
|
|
||||||
}
|
}
|
||||||
*q = 0;
|
debug("cSatipPluginSetup::%s(%s, %s)", __FUNCTION__, nameP, *buffer);
|
||||||
debug("cSatipPluginSetup::%s(%s, %s)", __FUNCTION__, nameP, buffer);
|
SetupStore(nameP, *buffer);
|
||||||
SetupStore(nameP, buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSatipPluginSetup::Store(void)
|
void cSatipPluginSetup::Store(void)
|
||||||
@ -340,10 +435,13 @@ void cSatipPluginSetup::Store(void)
|
|||||||
// Store values into setup.conf
|
// Store values into setup.conf
|
||||||
SetupStore("OperatingMode", operatingModeM);
|
SetupStore("OperatingMode", operatingModeM);
|
||||||
SetupStore("EnableEITScan", eitScanM);
|
SetupStore("EnableEITScan", eitScanM);
|
||||||
|
StoreSources("DisabledSources", disabledSourcesM);
|
||||||
StoreFilters("DisabledFilters", disabledFilterIndexesM);
|
StoreFilters("DisabledFilters", disabledFilterIndexesM);
|
||||||
// Update global config
|
// Update global config
|
||||||
SatipConfig.SetOperatingMode(operatingModeM);
|
SatipConfig.SetOperatingMode(operatingModeM);
|
||||||
SatipConfig.SetEITScan(eitScanM);
|
SatipConfig.SetEITScan(eitScanM);
|
||||||
|
for (int i = 0; i < MAX_DISABLED_SOURCES_COUNT; ++i)
|
||||||
|
SatipConfig.SetDisabledSources(i, disabledSourcesM[i]);
|
||||||
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
|
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
|
||||||
SatipConfig.SetDisabledFilters(i, disabledFilterIndexesM[i]);
|
SatipConfig.SetDisabledFilters(i, disabledFilterIndexesM[i]);
|
||||||
}
|
}
|
||||||
|
3
setup.h
3
setup.h
@ -19,6 +19,8 @@ private:
|
|||||||
int operatingModeM;
|
int operatingModeM;
|
||||||
const char *operatingModeTextsM[cSatipConfig::eOperatingModeCount];
|
const char *operatingModeTextsM[cSatipConfig::eOperatingModeCount];
|
||||||
int eitScanM;
|
int eitScanM;
|
||||||
|
int numDisabledSourcesM;
|
||||||
|
int disabledSourcesM[MAX_DISABLED_SOURCES_COUNT];
|
||||||
int numDisabledFiltersM;
|
int numDisabledFiltersM;
|
||||||
int disabledFilterIndexesM[SECTION_FILTER_TABLE_SIZE];
|
int disabledFilterIndexesM[SECTION_FILTER_TABLE_SIZE];
|
||||||
const char *disabledFilterNamesM[SECTION_FILTER_TABLE_SIZE];
|
const char *disabledFilterNamesM[SECTION_FILTER_TABLE_SIZE];
|
||||||
@ -28,6 +30,7 @@ private:
|
|||||||
eOSState DeviceInfo(void);
|
eOSState DeviceInfo(void);
|
||||||
eOSState ShowInfo(void);
|
eOSState ShowInfo(void);
|
||||||
void Setup(void);
|
void Setup(void);
|
||||||
|
void StoreSources(const char *nameP, int *sourcesP);
|
||||||
void StoreFilters(const char *nameP, int *valuesP);
|
void StoreFilters(const char *nameP, int *valuesP);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user