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.
- Added a preliminary support for Fritz!WLAN Repeater DVB-C
(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.
Valid range: "none" = 0 ... 7
- [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.
- [Ok] Opens information menu of selected SAT>IP
device.

View File

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

View File

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

View File

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

View File

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

109
setup.c
View File

@ -98,7 +98,7 @@ public:
};
cSatipServerInfo::cSatipServerInfo(cSatipServer *serverP)
: cOsdMenu(tr("SAT>IP Device"), 20),
: cOsdMenu(tr("SAT>IP Server"), 20),
addressM(serverP ? serverP->Address() : "---"),
modelM(serverP ? serverP->Model() : "---"),
descriptionM(serverP ? serverP->Description() : "---"),
@ -160,6 +160,99 @@ void cSatipServerItem::SetMenuItem(cSkinDisplayMenu *displayMenuP, int indexP, b
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 ---------------------------------------------------------
class cSatipMenuInfo : public cOsdMenu
@ -284,7 +377,7 @@ cSatipPluginSetup::cSatipPluginSetup()
}
SetMenuCategory(mcSetupPlugins);
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)
@ -317,7 +410,7 @@ void cSatipPluginSetup::Setup(void)
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("");
cSatipServers *servers = cSatipDiscover::GetInstance()->GetServers();
@ -352,6 +445,15 @@ eOSState cSatipPluginSetup::DeviceInfo(void)
return osContinue;
}
eOSState cSatipPluginSetup::ShowDeviceStatus(void)
{
debug("cSatipPluginSetup::%s()", __FUNCTION__);
if (HasSubMenu() || Count() == 0)
return osContinue;
return AddSubMenu(new cSatipMenuDeviceStatus());
}
eOSState cSatipPluginSetup::ShowInfo(void)
{
debug("cSatipPluginSetup::%s()", __FUNCTION__);
@ -377,6 +479,7 @@ eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
if (state == osUnknown) {
switch (keyP) {
case kRed: return DeviceScan();
case kYellow: return ShowDeviceStatus();
case kBlue: return ShowInfo();
case kInfo: if (Current() < helpM.Size())
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), helpM[Current()]));

View File

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