2015-03-07 19:37:07 +01:00
|
|
|
/*
|
|
|
|
* Frontend Status Monitor plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <vdr/menu.h>
|
|
|
|
#include "femonconfig.h"
|
|
|
|
#include "femontools.h"
|
|
|
|
#include "femonsetup.h"
|
|
|
|
|
|
|
|
cMenuFemonSetup::cMenuFemonSetup()
|
2015-03-07 20:37:46 +01:00
|
|
|
: hideMenuM(FemonConfig.GetHideMenu()),
|
|
|
|
displayModeM(FemonConfig.GetDisplayMode()),
|
|
|
|
skinM(FemonConfig.GetSkin()),
|
|
|
|
themeM(FemonConfig.GetTheme()),
|
|
|
|
positionM(FemonConfig.GetPosition()),
|
|
|
|
downscaleM(FemonConfig.GetDownscale()),
|
|
|
|
redLimitM(FemonConfig.GetRedLimit()),
|
|
|
|
greenLimitM(FemonConfig.GetGreenLimit()),
|
|
|
|
updateIntervalM(FemonConfig.GetUpdateInterval()),
|
|
|
|
analyzeStreamM(FemonConfig.GetAnalyzeStream()),
|
|
|
|
calcIntervalM(FemonConfig.GetCalcInterval()),
|
|
|
|
useSvdrpM(FemonConfig.GetUseSvdrp()),
|
|
|
|
svdrpPortM(FemonConfig.GetSvdrpPort())
|
2015-03-07 19:37:07 +01:00
|
|
|
{
|
|
|
|
debug("%s()\n", __PRETTY_FUNCTION__);
|
2015-03-07 20:37:46 +01:00
|
|
|
strn0cpy(svdrpIpM, FemonConfig.GetSvdrpIp(), sizeof(svdrpIpM));
|
|
|
|
|
2015-03-07 19:37:07 +01:00
|
|
|
dispModesM[eFemonModeBasic] = tr("basic");
|
|
|
|
dispModesM[eFemonModeTransponder] = tr("transponder");
|
|
|
|
dispModesM[eFemonModeStream] = tr("stream");
|
|
|
|
dispModesM[eFemonModeAC3] = tr("AC-3");
|
|
|
|
|
|
|
|
skinsM[eFemonSkinClassic] = tr("Classic");
|
|
|
|
skinsM[eFemonSkinElchi] = tr("Elchi");
|
|
|
|
|
|
|
|
themesM[eFemonThemeClassic] = tr("Classic");
|
|
|
|
themesM[eFemonThemeElchi] = tr("Elchi");
|
|
|
|
themesM[eFemonThemeSTTNG] = tr("ST:TNG");
|
|
|
|
themesM[eFemonThemeDeepBlue] = tr("DeepBlue");
|
|
|
|
themesM[eFemonThemeMoronimo] = tr("Moronimo");
|
|
|
|
themesM[eFemonThemeEnigma] = tr("Enigma");
|
|
|
|
themesM[eFemonThemeEgalsTry] = tr("EgalsTry");
|
|
|
|
themesM[eFemonThemeDuotone] = tr("Duotone");
|
|
|
|
themesM[eFemonThemeSilverGreen] = tr("SilverGreen");
|
|
|
|
themesM[eFemonThemePearlHD] = tr("PearlHD");
|
|
|
|
|
|
|
|
SetMenuCategory(mcSetupPlugins);
|
|
|
|
Setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cMenuFemonSetup::Setup(void)
|
|
|
|
{
|
|
|
|
int current = Current();
|
|
|
|
|
|
|
|
Clear();
|
|
|
|
helpM.Clear();
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &hideMenuM));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define whether the main menu entry is hidden."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditStraItem(tr("Default display mode"), &displayModeM, eFemonModeMaxNumber, dispModesM));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the default display mode at startup."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditStraItem(trVDR("Setup.OSD$Skin"), &skinM, eFemonSkinMaxNumber, skinsM));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the used OSD skin."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditStraItem(trVDR("Setup.OSD$Theme"), &themeM, eFemonThemeMaxNumber, themesM));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the used OSD theme."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditBoolItem(tr("Position"), &positionM, trVDR("bottom"), trVDR("top")));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the position of OSD."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditIntItem(tr("Downscale OSD size [%]"), &downscaleM, 0, 20));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the downscale ratio for OSD size."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditIntItem(tr("Red limit [%]"), &redLimitM, 1, 50));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define a limit for red bar, which is used to indicate a bad signal."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditIntItem(tr("Green limit [%]"), &greenLimitM, 51, 100));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define a limit for green bar, which is used to indicate a good signal."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditIntItem(tr("OSD update interval [0.1s]"), &updateIntervalM, 1, 100));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define an interval for OSD updates. The smaller interval generates higher CPU load."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditBoolItem(tr("Analyze stream"), &analyzeStreamM));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define whether the DVB stream is analyzed and bitrates calculated."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
if (analyzeStreamM) {
|
|
|
|
Add(new cMenuEditIntItem(tr("Calculation interval [0.1s]"), &calcIntervalM, 1, 100));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define an interval for calculation. The bigger interval generates more stable values."));
|
|
|
|
}
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditBoolItem(tr("Use SVDRP service"), &useSvdrpM));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define whether the SVDRP service is used in client/server setups."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
if (useSvdrpM) {
|
|
|
|
Add(new cMenuEditIntItem(tr("SVDRP service port"), &svdrpPortM, 1, 65535));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the port number of SVDRP service."));
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
Add(new cMenuEditStrItem(tr("SVDRP service IP"), svdrpIpM, sizeof(svdrpIpM), ".1234567890"));
|
2015-03-07 19:37:07 +01:00
|
|
|
helpM.Append(tr("Define the IP address of SVDRP service."));
|
|
|
|
}
|
|
|
|
|
|
|
|
SetCurrent(Get(current));
|
|
|
|
Display();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cMenuFemonSetup::Store(void)
|
|
|
|
{
|
|
|
|
debug("%s()\n", __PRETTY_FUNCTION__);
|
2015-03-07 20:37:46 +01:00
|
|
|
// Store values into setup.conf
|
|
|
|
SetupStore("HideMenu", hideMenuM);
|
|
|
|
SetupStore("DisplayMode", displayModeM);
|
|
|
|
SetupStore("Skin", skinM);
|
|
|
|
SetupStore("Theme", themeM);
|
|
|
|
SetupStore("Position", positionM);
|
|
|
|
SetupStore("Downscale", downscaleM);
|
|
|
|
SetupStore("RedLimit", redLimitM);
|
|
|
|
SetupStore("GreenLimit", greenLimitM);
|
|
|
|
SetupStore("UpdateInterval", updateIntervalM);
|
|
|
|
SetupStore("AnalStream", analyzeStreamM);
|
|
|
|
SetupStore("CalcInterval", calcIntervalM);
|
|
|
|
SetupStore("UseSvdrp", useSvdrpM);
|
|
|
|
SetupStore("ServerPort", svdrpPortM);
|
|
|
|
SetupStore("ServerIp", svdrpIpM);
|
|
|
|
// Update global config
|
|
|
|
FemonConfig.SetHideMenu(hideMenuM);
|
|
|
|
FemonConfig.SetDisplayMode(displayModeM);
|
|
|
|
FemonConfig.SetSkin(skinM);
|
|
|
|
FemonConfig.SetTheme(themeM);
|
|
|
|
FemonConfig.SetPosition(positionM);
|
|
|
|
FemonConfig.SetDownscale(downscaleM);
|
|
|
|
FemonConfig.SetRedLimit(redLimitM);
|
|
|
|
FemonConfig.SetGreenLimit(greenLimitM);
|
|
|
|
FemonConfig.SetUpdateInterval(updateIntervalM);
|
|
|
|
FemonConfig.SetAnalyzeStream(analyzeStreamM);
|
|
|
|
FemonConfig.SetCalcInterval(calcIntervalM);
|
|
|
|
FemonConfig.SetUseSvdrp(useSvdrpM);
|
|
|
|
FemonConfig.SetSvdrpPort(svdrpPortM);
|
|
|
|
FemonConfig.SetSvdrpIp(svdrpIpM);
|
2015-03-07 19:37:07 +01:00
|
|
|
}
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
eOSState cMenuFemonSetup::ProcessKey(eKeys keyP)
|
2015-03-07 19:37:07 +01:00
|
|
|
{
|
2015-03-07 20:37:46 +01:00
|
|
|
int oldUseSvdrp = useSvdrpM;
|
|
|
|
int oldAnalyzeStream = analyzeStreamM;
|
2015-03-07 19:37:07 +01:00
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
eOSState state = cMenuSetupPage::ProcessKey(keyP);
|
2015-03-07 19:37:07 +01:00
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
if (keyP != kNone && (analyzeStreamM != oldAnalyzeStream || useSvdrpM != oldUseSvdrp))
|
2015-03-07 19:37:07 +01:00
|
|
|
Setup();
|
|
|
|
|
2015-03-07 20:37:46 +01:00
|
|
|
if ((keyP == kInfo) && (state == osUnknown) && (Current() < helpM.Size()))
|
2015-03-07 19:37:07 +01:00
|
|
|
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), helpM[Current()]));
|
|
|
|
|
|
|
|
return state;
|
|
|
|
}
|