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

Added a new device status menu.

This commit is contained in:
Rolf Ahrenberg 2014-11-03 21:55:28 +02:00
parent 0de0be5ae4
commit d81f700194
8 changed files with 166 additions and 36 deletions

View File

@ -72,3 +72,4 @@ VDR Plugin 'satip' Revision History
- Fixed server reuse for active transponders. - Fixed server reuse for active transponders.
- Added a preliminary support for Fritz!WLAN Repeater DVB-C - Added a preliminary support for Fritz!WLAN Repeater DVB-C
(Thanks to Christian Wick). (Thanks to Christian Wick).
- Added a new device status menu.

1
README
View File

@ -84,6 +84,7 @@ Setup menu:
to disable the individual section filters. to disable the individual section filters.
Valid range: "none" = 0 ... 7 Valid range: "none" = 0 ... 7
- [Red:Scan] Forces network scanning of SAT>IP hardware. - [Red:Scan] Forces network scanning of SAT>IP hardware.
- [Yellow:Devices] Opens SAT>IP device status menu.
- [Blue:Info] Opens SAT>IP information/statistics menu. - [Blue:Info] Opens SAT>IP information/statistics menu.
- [Ok] Opens information menu of selected SAT>IP - [Ok] Opens information menu of selected SAT>IP
device. device.

View File

@ -34,8 +34,8 @@ msgstr "TDT (0x70)"
msgid "SAT>IP Devices" msgid "SAT>IP Devices"
msgstr "SAT>IP Dispositius" msgstr "SAT>IP Dispositius"
msgid "SAT>IP Device" msgid "SAT>IP Server"
msgstr "SAT>IP Dispositiu" msgstr ""
msgid "Address" msgid "Address"
msgstr "Adressa" msgstr "Adressa"
@ -49,6 +49,12 @@ msgstr "Descripció"
msgid "Creation date" msgid "Creation date"
msgstr "Creació de data" msgstr "Creació de data"
msgid "SAT>IP Device Status"
msgstr ""
msgid "SAT>IP information not available!"
msgstr "SAT>IP Informació no disponible!"
msgid "SAT>IP Information" msgid "SAT>IP Information"
msgstr "SAT>IP Informació" msgstr "SAT>IP Informació"
@ -64,9 +70,6 @@ msgstr "Filtres"
msgid "Bits/bytes" msgid "Bits/bytes"
msgstr "Bits/Bytes" msgstr "Bits/Bytes"
msgid "SAT>IP information not available!"
msgstr "SAT>IP Informació no disponible!"
msgid "off" msgid "off"
msgstr "Apagat" msgstr "Apagat"
@ -79,6 +82,9 @@ msgstr "Normal"
msgid "high" msgid "high"
msgstr "Alt" msgstr "Alt"
msgid "Button$Devices"
msgstr ""
msgid "Operating mode" msgid "Operating mode"
msgstr "Mode de operació" msgstr "Mode de operació"
@ -142,8 +148,8 @@ msgstr "Filtra"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Definir un filtre mal comportar a la llista negra." msgstr "Definir un filtre mal comportar a la llista negra."
msgid "Active SAT>IP devices:" msgid "Active SAT>IP servers:"
msgstr "Dispositius SAT>IP actius:" msgstr ""
msgid "Help" msgid "Help"
msgstr "Ajuda" msgstr "Ajuda"

View File

@ -34,8 +34,8 @@ msgstr "TDT (0x70)"
msgid "SAT>IP Devices" msgid "SAT>IP Devices"
msgstr "SAT>IP Geräte" msgstr "SAT>IP Geräte"
msgid "SAT>IP Device" msgid "SAT>IP Server"
msgstr "SAT>IP Gerät" msgstr ""
msgid "Address" msgid "Address"
msgstr "Adresse" msgstr "Adresse"
@ -49,6 +49,12 @@ msgstr "Beschreibung"
msgid "Creation date" msgid "Creation date"
msgstr "Zeitpunkt der Erstellung" msgstr "Zeitpunkt der Erstellung"
msgid "SAT>IP Device Status"
msgstr ""
msgid "SAT>IP information not available!"
msgstr "Keine SAT>IP Informationen verfügbar!"
msgid "SAT>IP Information" msgid "SAT>IP Information"
msgstr "SAT>IP Informationen" msgstr "SAT>IP Informationen"
@ -64,9 +70,6 @@ msgstr "Filter"
msgid "Bits/bytes" msgid "Bits/bytes"
msgstr "Bits/Bytes" msgstr "Bits/Bytes"
msgid "SAT>IP information not available!"
msgstr "Keine SAT>IP Informationen verfügbar!"
msgid "off" msgid "off"
msgstr "aus" msgstr "aus"
@ -79,6 +82,9 @@ msgstr "normal"
msgid "high" msgid "high"
msgstr "hoch" msgstr "hoch"
msgid "Button$Devices"
msgstr ""
msgid "Operating mode" msgid "Operating mode"
msgstr "Betriebsmodus" msgstr "Betriebsmodus"
@ -142,8 +148,8 @@ msgstr "Filter"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Bestimme einen fehlerhaften Filter der ausgeblendet werden soll." msgstr "Bestimme einen fehlerhaften Filter der ausgeblendet werden soll."
msgid "Active SAT>IP devices:" msgid "Active SAT>IP servers:"
msgstr "Aktive SAT>IP Geräte:" msgstr ""
msgid "Help" msgid "Help"
msgstr "Hilfe" msgstr "Hilfe"

View File

@ -34,8 +34,8 @@ msgstr "TDT (0x70)"
msgid "SAT>IP Devices" msgid "SAT>IP Devices"
msgstr "SAT>IP Dispositivos" msgstr "SAT>IP Dispositivos"
msgid "SAT>IP Device" msgid "SAT>IP Server"
msgstr "SAT>IP Dispositivo" msgstr ""
msgid "Address" msgid "Address"
msgstr "Dirección" msgstr "Dirección"
@ -49,6 +49,12 @@ msgstr "Descripción"
msgid "Creation date" msgid "Creation date"
msgstr "Fecha creación" msgstr "Fecha creación"
msgid "SAT>IP Device Status"
msgstr ""
msgid "SAT>IP information not available!"
msgstr "SAT>IP Información no disponible!"
msgid "SAT>IP Information" msgid "SAT>IP Information"
msgstr "SAT>IP Información" msgstr "SAT>IP Información"
@ -64,9 +70,6 @@ msgstr "Filtros"
msgid "Bits/bytes" msgid "Bits/bytes"
msgstr "Bits/Bytes" msgstr "Bits/Bytes"
msgid "SAT>IP information not available!"
msgstr "SAT>IP Información no disponible!"
msgid "off" msgid "off"
msgstr "Apagado" msgstr "Apagado"
@ -79,6 +82,9 @@ msgstr "Normal"
msgid "high" msgid "high"
msgstr "Alto" msgstr "Alto"
msgid "Button$Devices"
msgstr ""
msgid "Operating mode" msgid "Operating mode"
msgstr "Modo de operación" msgstr "Modo de operación"
@ -142,8 +148,8 @@ msgstr "Filtra"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Define un filtro para poner en la lista negra." msgstr "Define un filtro para poner en la lista negra."
msgid "Active SAT>IP devices:" msgid "Active SAT>IP servers:"
msgstr "Dispositivos SAT>IP activos:" msgstr ""
msgid "Help" msgid "Help"
msgstr "Ayuda" msgstr "Ayuda"

View File

@ -34,8 +34,8 @@ msgstr "TDT (0x70)"
msgid "SAT>IP Devices" msgid "SAT>IP Devices"
msgstr "SAT>IP-laitteet" msgstr "SAT>IP-laitteet"
msgid "SAT>IP Device" msgid "SAT>IP Server"
msgstr "SAT>IP-laite" msgstr "SAT>IP-palvelin"
msgid "Address" msgid "Address"
msgstr "Osoite" msgstr "Osoite"
@ -49,6 +49,12 @@ msgstr "Kuvaus"
msgid "Creation date" msgid "Creation date"
msgstr "Luontiajankohta" msgstr "Luontiajankohta"
msgid "SAT>IP Device Status"
msgstr "SAT>IP-laitteiden tiedot"
msgid "SAT>IP information not available!"
msgstr "SAT>IP-tietoja ei saatavilla!"
msgid "SAT>IP Information" msgid "SAT>IP Information"
msgstr "SAT>IP-tiedot" msgstr "SAT>IP-tiedot"
@ -64,9 +70,6 @@ msgstr "Suodattimet"
msgid "Bits/bytes" msgid "Bits/bytes"
msgstr "Bitit/tavut" msgstr "Bitit/tavut"
msgid "SAT>IP information not available!"
msgstr "SAT>IP-tietoja ei saatavilla!"
msgid "off" msgid "off"
msgstr "ei käytössä" msgstr "ei käytössä"
@ -79,6 +82,9 @@ msgstr "normaali"
msgid "high" msgid "high"
msgstr "korkea" msgstr "korkea"
msgid "Button$Devices"
msgstr "Laitteet"
msgid "Operating mode" msgid "Operating mode"
msgstr "Laitteiden toimintatapa" msgstr "Laitteiden toimintatapa"
@ -144,8 +150,8 @@ msgstr "Suodatin"
msgid "Define an ill-behaving filter to be blacklisted." msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle." msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle."
msgid "Active SAT>IP devices:" msgid "Active SAT>IP servers:"
msgstr "Aktiiviset SAT>IP-laitteet:" msgstr "Aktiiviset SAT>IP-palvelimet:"
msgid "Help" msgid "Help"
msgstr "Opaste" msgstr "Opaste"

119
setup.c
View File

@ -98,7 +98,7 @@ public:
}; };
cSatipServerInfo::cSatipServerInfo(cSatipServer *serverP) cSatipServerInfo::cSatipServerInfo(cSatipServer *serverP)
: cOsdMenu(tr("SAT>IP Device"), 20), : cOsdMenu(tr("SAT>IP Server"), 20),
addressM(serverP ? serverP->Address() : "---"), addressM(serverP ? serverP->Address() : "---"),
modelM(serverP ? serverP->Model() : "---"), modelM(serverP ? serverP->Model() : "---"),
descriptionM(serverP ? serverP->Description() : "---"), descriptionM(serverP ? serverP->Description() : "---"),
@ -160,6 +160,99 @@ void cSatipServerItem::SetMenuItem(cSkinDisplayMenu *displayMenuP, int indexP, b
displayMenuP->SetItem(Text(), indexP, currentP, selectableP); displayMenuP->SetItem(Text(), indexP, currentP, selectableP);
} }
// --- cSatipMenuDeviceStatus -------------------------------------------------
class cSatipMenuDeviceStatus : public cOsdMenu
{
private:
enum {
eInfoTimeoutMs = 15000
};
cString textM;
cTimeMs timeoutM;
void UpdateInfo();
public:
cSatipMenuDeviceStatus();
virtual ~cSatipMenuDeviceStatus();
virtual void Display(void);
virtual eOSState ProcessKey(eKeys keyP);
};
cSatipMenuDeviceStatus::cSatipMenuDeviceStatus()
: cOsdMenu(tr("SAT>IP Device Status")),
textM(""),
timeoutM()
{
SetMenuCategory(mcText);
timeoutM.Set(eInfoTimeoutMs);
UpdateInfo();
SetHelp(NULL, NULL, NULL, NULL);
}
cSatipMenuDeviceStatus::~cSatipMenuDeviceStatus()
{
}
void cSatipMenuDeviceStatus::UpdateInfo()
{
textM = "";
for (int i = 0; i < cDevice::NumDevices(); i++) {
const cDevice *device = cDevice::GetDevice(i);
if (device && strstr(device->DeviceType(), "SAT>IP")) {
int timers = 0;
bool live = (device == cDevice::ActualDevice());
bool lock = device->HasLock();
const cChannel *channel = device->GetCurrentlyTunedTransponder();
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
if (timer->Recording()) {
cRecordControl *control = cRecordControls::GetRecordControl(timer);
if (control && control->Device() == device)
timers++;
}
}
textM = cString::sprintf("%sDevice: %s\n", *textM, *device->DeviceName());
if (lock)
textM = cString::sprintf("%sCardIndex: %d HasLock: yes Strength: %d Quality: %d%s\n", *textM, device->CardIndex(), device->SignalStrength(), device->SignalQuality(), live ? " Live: yes" : "");
else
textM = cString::sprintf("%sCardIndex: %d HasLock: no\n", *textM, device->CardIndex());
if (channel && channel->Number() > 0)
textM = cString::sprintf("%sChannel: %s\n", *textM, (channel && channel->Number() > 0) ? channel->Name() : "---");
if (timers)
textM = cString::sprintf("%sRecording: %d timer%s\n", *textM, timers, (timers > 1) ? "s" : "");
textM = cString::sprintf("%s\n", *textM);
}
}
if (isempty(*textM))
textM = cString(tr("SAT>IP information not available!"));
Display();
timeoutM.Set(eInfoTimeoutMs);
}
void cSatipMenuDeviceStatus::Display(void)
{
cOsdMenu::Display();
DisplayMenu()->SetText(textM, true);
if (*textM)
cStatus::MsgOsdTextItem(textM);
}
eOSState cSatipMenuDeviceStatus::ProcessKey(eKeys keyP)
{
eOSState state = cOsdMenu::ProcessKey(keyP);
if (state == osUnknown) {
switch (keyP) {
case kOk: state = osBack; break;
default: if (timeoutM.TimedOut())
UpdateInfo();
state = osContinue;
break;
}
}
return state;
}
// --- cSatipMenuInfo --------------------------------------------------------- // --- cSatipMenuInfo ---------------------------------------------------------
class cSatipMenuInfo : public cOsdMenu class cSatipMenuInfo : public cOsdMenu
@ -284,7 +377,7 @@ cSatipPluginSetup::cSatipPluginSetup()
} }
SetMenuCategory(mcSetupPlugins); SetMenuCategory(mcSetupPlugins);
Setup(); Setup();
SetHelp(trVDR("Button$Scan"), NULL, NULL, trVDR("Button$Info")); SetHelp(trVDR("Button$Scan"), NULL, tr("Button$Devices"), trVDR("Button$Info"));
} }
void cSatipPluginSetup::Setup(void) void cSatipPluginSetup::Setup(void)
@ -317,7 +410,7 @@ void cSatipPluginSetup::Setup(void)
helpM.Append(tr("Define an ill-behaving filter to be blacklisted.")); helpM.Append(tr("Define an ill-behaving filter to be blacklisted."));
} }
} }
Add(new cOsdItem(tr("Active SAT>IP devices:"), osUnknown, false)); Add(new cOsdItem(tr("Active SAT>IP servers:"), osUnknown, false));
helpM.Append(""); helpM.Append("");
cSatipServers *servers = cSatipDiscover::GetInstance()->GetServers(); cSatipServers *servers = cSatipDiscover::GetInstance()->GetServers();
@ -352,6 +445,15 @@ eOSState cSatipPluginSetup::DeviceInfo(void)
return osContinue; return osContinue;
} }
eOSState cSatipPluginSetup::ShowDeviceStatus(void)
{
debug("cSatipPluginSetup::%s()", __FUNCTION__);
if (HasSubMenu() || Count() == 0)
return osContinue;
return AddSubMenu(new cSatipMenuDeviceStatus());
}
eOSState cSatipPluginSetup::ShowInfo(void) eOSState cSatipPluginSetup::ShowInfo(void)
{ {
debug("cSatipPluginSetup::%s()", __FUNCTION__); debug("cSatipPluginSetup::%s()", __FUNCTION__);
@ -376,11 +478,12 @@ eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
if (state == osUnknown) { if (state == osUnknown) {
switch (keyP) { switch (keyP) {
case kRed: return DeviceScan(); case kRed: return DeviceScan();
case kBlue: return ShowInfo(); case kYellow: return ShowDeviceStatus();
case kInfo: if (Current() < helpM.Size()) case kBlue: return ShowInfo();
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), helpM[Current()])); case kInfo: if (Current() < helpM.Size())
default: state = osContinue; break; return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), helpM[Current()]));
default: state = osContinue; break;
} }
} }

View File

@ -28,6 +28,7 @@ private:
eOSState DeviceScan(void); eOSState DeviceScan(void);
eOSState DeviceInfo(void); eOSState DeviceInfo(void);
eOSState ShowDeviceStatus(void);
eOSState ShowInfo(void); eOSState ShowInfo(void);
void Setup(void); void Setup(void);
void StoreSources(const char *nameP, int *sourcesP); void StoreSources(const char *nameP, int *sourcesP);