2004-02-15 03:20:00 +01:00
|
|
|
/*
|
2004-03-03 03:20:00 +01:00
|
|
|
* Frontend Status Monitor plugin for the Video Disk Recorder
|
2004-02-15 03:20:00 +01:00
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-05-01 03:20:00 +02:00
|
|
|
#include <vdr/menu.h>
|
2005-11-13 03:20:00 +01:00
|
|
|
#include <vdr/remote.h>
|
2008-01-20 03:20:00 +01:00
|
|
|
#include <vdr/menu.h>
|
2004-02-27 03:20:00 +01:00
|
|
|
#include "femoncfg.h"
|
|
|
|
#include "femonreceiver.h"
|
|
|
|
#include "femonosd.h"
|
2005-08-28 03:20:00 +02:00
|
|
|
#include "femonservice.h"
|
|
|
|
#include "femontools.h"
|
2004-02-15 03:20:00 +01:00
|
|
|
|
2008-12-16 11:26:46 +01:00
|
|
|
#if defined(APIVERSNUM) && APIVERSNUM < 10700
|
|
|
|
#error "VDR-1.7.0 API version or greater is required!"
|
2004-05-18 03:20:00 +02:00
|
|
|
#endif
|
|
|
|
|
2008-12-16 11:26:46 +01:00
|
|
|
static const char VERSION[] = "1.7.0";
|
2007-08-14 03:20:00 +02:00
|
|
|
static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
|
|
|
|
static const char MAINMENUENTRY[] = trNOOP("Signal Information");
|
|
|
|
|
|
|
|
class cPluginFemon : public cPlugin {
|
|
|
|
public:
|
|
|
|
cPluginFemon(void);
|
|
|
|
virtual ~cPluginFemon();
|
|
|
|
virtual const char *Version(void) { return VERSION; }
|
|
|
|
virtual const char *Description(void) { return tr(DESCRIPTION); }
|
|
|
|
virtual const char *CommandLineHelp(void);
|
|
|
|
virtual bool ProcessArgs(int argc, char *argv[]);
|
|
|
|
virtual bool Initialize(void);
|
|
|
|
virtual bool Start(void);
|
|
|
|
virtual void Stop(void);
|
|
|
|
virtual void Housekeeping(void);
|
|
|
|
virtual void MainThreadHook(void) {}
|
|
|
|
virtual cString Active(void) { return NULL; }
|
|
|
|
virtual const char *MainMenuEntry(void) { return (femonConfig.hidemenu ? NULL : tr(MAINMENUENTRY)); }
|
|
|
|
virtual cOsdObject *MainMenuAction(void);
|
|
|
|
virtual cMenuSetupPage *SetupMenu(void);
|
|
|
|
virtual bool SetupParse(const char *Name, const char *Value);
|
|
|
|
virtual bool Service(const char *Id, void *Data);
|
|
|
|
virtual const char **SVDRPHelpPages(void);
|
|
|
|
virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
|
|
|
|
};
|
|
|
|
|
2005-11-13 03:20:00 +01:00
|
|
|
cPluginFemon::cPluginFemon()
|
2004-02-15 03:20:00 +01:00
|
|
|
{
|
|
|
|
// Initialize any member variables here.
|
|
|
|
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
|
|
|
|
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
|
2005-11-13 03:20:00 +01:00
|
|
|
Dprintf("%s()\n", __PRETTY_FUNCTION__);
|
2004-02-15 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cPluginFemon::~cPluginFemon()
|
|
|
|
{
|
|
|
|
// Clean up after yourself!
|
2005-11-13 03:20:00 +01:00
|
|
|
Dprintf("%s()\n", __PRETTY_FUNCTION__);
|
2004-02-15 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *cPluginFemon::CommandLineHelp(void)
|
|
|
|
{
|
|
|
|
// Return a string that describes all known command line options.
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cPluginFemon::ProcessArgs(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
// Implement command line argument processing here if applicable.
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cPluginFemon::Initialize(void)
|
|
|
|
{
|
|
|
|
// Initialize any background activities the plugin shall perform.
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cPluginFemon::Start(void)
|
|
|
|
{
|
|
|
|
// Start any background activities the plugin shall perform.
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-02-24 03:20:00 +01:00
|
|
|
void cPluginFemon::Stop(void)
|
|
|
|
{
|
|
|
|
// Stop the background activities.
|
|
|
|
}
|
|
|
|
|
2004-02-15 03:20:00 +01:00
|
|
|
void cPluginFemon::Housekeeping(void)
|
|
|
|
{
|
|
|
|
// Perform any cleanup or other regular tasks.
|
|
|
|
}
|
|
|
|
|
|
|
|
cOsdObject *cPluginFemon::MainMenuAction(void)
|
|
|
|
{
|
|
|
|
// Perform the action when selected from the main VDR menu.
|
2005-11-13 03:20:00 +01:00
|
|
|
Dprintf("%s()\n", __PRETTY_FUNCTION__);
|
2008-06-20 03:20:00 +02:00
|
|
|
if (cReplayControl::NowReplaying() || (Channels.Count() <= 0))
|
|
|
|
Skins.Message(mtInfo, tr("Femon not available"));
|
2007-05-01 03:20:00 +02:00
|
|
|
else
|
|
|
|
return cFemonOsd::Instance(true);
|
|
|
|
return NULL;
|
2004-02-15 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool cPluginFemon::SetupParse(const char *Name, const char *Value)
|
|
|
|
{
|
|
|
|
// Parse your own setup parameters and store their values.
|
2004-03-03 03:20:00 +01:00
|
|
|
if (!strcasecmp(Name, "HideMenu")) femonConfig.hidemenu = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "DisplayMode")) femonConfig.displaymode = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "Position")) femonConfig.position = atoi(Value);
|
2005-01-15 03:20:00 +01:00
|
|
|
else if (!strcasecmp(Name, "OSDHeight")) femonConfig.osdheight = atoi(Value);
|
2005-02-24 03:20:00 +01:00
|
|
|
else if (!strcasecmp(Name, "OSDOffset")) femonConfig.osdoffset = atoi(Value);
|
2005-10-04 03:20:00 +02:00
|
|
|
else if (!strcasecmp(Name, "Skin")) femonConfig.skin = atoi(Value);
|
2005-02-24 03:20:00 +01:00
|
|
|
else if (!strcasecmp(Name, "Theme")) femonConfig.theme = atoi(Value);
|
2004-03-03 03:20:00 +01:00
|
|
|
else if (!strcasecmp(Name, "RedLimit")) femonConfig.redlimit = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "GreenLimit")) femonConfig.greenlimit = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "UpdateInterval")) femonConfig.updateinterval = atoi(Value);
|
2004-05-30 03:20:00 +02:00
|
|
|
else if (!strcasecmp(Name, "AnalStream")) femonConfig.analyzestream = atoi(Value);
|
2004-03-03 03:20:00 +01:00
|
|
|
else if (!strcasecmp(Name, "CalcInterval")) femonConfig.calcinterval = atoi(Value);
|
2006-09-17 03:20:00 +02:00
|
|
|
else if (!strcasecmp(Name, "UseSvdrp")) femonConfig.usesvdrp = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "ServerPort")) femonConfig.svdrpport = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "ServerIp")) strn0cpy(femonConfig.svdrpip, Value, sizeof(femonConfig.svdrpip));
|
2004-02-15 03:20:00 +01:00
|
|
|
else
|
|
|
|
return false;
|
2005-02-24 03:20:00 +01:00
|
|
|
if (femonConfig.displaymode < 0 || femonConfig.displaymode >= eFemonModeMaxNumber) femonConfig.displaymode = 0;
|
2004-02-15 03:20:00 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-08-28 03:20:00 +02:00
|
|
|
bool cPluginFemon::Service(const char *Id, void *Data)
|
|
|
|
{
|
2008-02-18 03:20:00 +01:00
|
|
|
if (strcmp(Id,"FemonService-v1.0") == 0) {
|
|
|
|
if (Data) {
|
|
|
|
FemonService_v1_0 *data = (FemonService_v1_0*)Data;
|
|
|
|
int ndx = cDevice::ActualDevice()->CardIndex();
|
|
|
|
data->fe_name = getFrontendName(ndx);
|
|
|
|
data->fe_status = getFrontendStatus(ndx);
|
|
|
|
data->fe_snr = getSNR(ndx);
|
|
|
|
data->fe_signal = getSignal(ndx);
|
|
|
|
data->fe_ber = getBER(ndx);
|
|
|
|
data->fe_unc = getUNC(ndx);
|
|
|
|
data->video_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetVideoBitrate() : 0.0;
|
|
|
|
data->audio_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetAudioBitrate() : 0.0;
|
|
|
|
data->dolby_bitrate = cFemonOsd::Instance() ? cFemonOsd::Instance()->GetDolbyBitrate() : 0.0;
|
|
|
|
}
|
2005-08-28 03:20:00 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char **cPluginFemon::SVDRPHelpPages(void)
|
|
|
|
{
|
|
|
|
static const char *HelpPages[] = {
|
2005-11-13 03:20:00 +01:00
|
|
|
"OPEN\n"
|
|
|
|
" Open femon plugin.",
|
|
|
|
"QUIT\n"
|
|
|
|
" Close femon plugin.",
|
|
|
|
"NEXT\n"
|
|
|
|
" Switch to next possible device.",
|
|
|
|
"PREV\n"
|
|
|
|
" Switch to previous possible device.",
|
2006-09-17 03:20:00 +02:00
|
|
|
"INFO\n"
|
|
|
|
" Print the current frontend information.",
|
2005-08-28 03:20:00 +02:00
|
|
|
"NAME\n"
|
|
|
|
" Print the current frontend name.",
|
|
|
|
"STAT\n"
|
|
|
|
" Print the current frontend status.",
|
|
|
|
"SGNL\n"
|
|
|
|
" Print the current signal strength.",
|
|
|
|
"SNRA\n"
|
|
|
|
" Print the current signal-to-noise ratio.",
|
|
|
|
"BERA\n"
|
|
|
|
" Print the current bit error rate.",
|
|
|
|
"UNCB\n"
|
2006-09-17 03:20:00 +02:00
|
|
|
" Print the current uncorrected blocks rate.",
|
2005-08-28 03:20:00 +02:00
|
|
|
"VIBR\n"
|
2005-11-13 03:20:00 +01:00
|
|
|
" Print the actual device and current video bitrate [Mbit/s].",
|
2005-08-28 03:20:00 +02:00
|
|
|
"AUBR\n"
|
2005-11-13 03:20:00 +01:00
|
|
|
" Print the actual device and current audio bitrate [kbit/s].",
|
|
|
|
"DDBR\n"
|
|
|
|
" Print the actual device and current dolby bitrate [kbit/s].",
|
2005-08-28 03:20:00 +02:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
return HelpPages;
|
|
|
|
}
|
|
|
|
|
|
|
|
cString cPluginFemon::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
|
|
|
|
{
|
2005-11-13 03:20:00 +01:00
|
|
|
if (strcasecmp(Command, "OPEN") == 0) {
|
2007-05-01 03:20:00 +02:00
|
|
|
if (cReplayControl::NowReplaying()) {
|
|
|
|
ReplyCode = 550; // Requested action not taken
|
|
|
|
return cString("Cannot open femon plugin while replaying");
|
|
|
|
}
|
2005-11-13 03:20:00 +01:00
|
|
|
if (!cFemonOsd::Instance())
|
|
|
|
cRemote::CallPlugin("femon");
|
|
|
|
return cString("Opening femon plugin");
|
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "QUIT") == 0) {
|
|
|
|
if (cFemonOsd::Instance())
|
|
|
|
cRemote::Put(kBack);
|
|
|
|
return cString("Closing femon plugin");
|
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "NEXT") == 0) {
|
|
|
|
if (cFemonOsd::Instance())
|
|
|
|
return cString::sprintf("Switching to next device: %s", cFemonOsd::Instance()->DeviceSwitch(1) ? "ok" : "failed");
|
|
|
|
else
|
|
|
|
return cString("Cannot switch device");
|
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "PREV") == 0) {
|
|
|
|
if (cFemonOsd::Instance())
|
|
|
|
return cString::sprintf("Switching to previous device: %s", cFemonOsd::Instance()->DeviceSwitch(-1) ? "ok" : "failed");
|
|
|
|
else
|
|
|
|
return cString("Cannot switch device");
|
|
|
|
}
|
2006-09-17 03:20:00 +02:00
|
|
|
else if (strcasecmp(Command, "INFO") == 0) {
|
|
|
|
return getFrontendInfo(cDevice::ActualDevice()->CardIndex());
|
|
|
|
}
|
2005-11-13 03:20:00 +01:00
|
|
|
else if (strcasecmp(Command, "NAME") == 0) {
|
2005-08-28 03:20:00 +02:00
|
|
|
return getFrontendName(cDevice::ActualDevice()->CardIndex());
|
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "STAT") == 0) {
|
|
|
|
return getFrontendStatus(cDevice::ActualDevice()->CardIndex());
|
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "SGNL") == 0) {
|
2005-11-13 03:20:00 +01:00
|
|
|
int value = getSignal(cDevice::ActualDevice()->CardIndex());
|
|
|
|
return cString::sprintf("%04X (%02d%%) on device #%d", value, value / 655, cDevice::ActualDevice()->CardIndex());
|
2005-08-28 03:20:00 +02:00
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "SNRA") == 0) {
|
2005-11-13 03:20:00 +01:00
|
|
|
int value = getSNR(cDevice::ActualDevice()->CardIndex());
|
|
|
|
return cString::sprintf("%04X (%02d%%) on device #%d", value, value / 655, cDevice::ActualDevice()->CardIndex());
|
2005-08-28 03:20:00 +02:00
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "BERA") == 0) {
|
2005-11-13 03:20:00 +01:00
|
|
|
return cString::sprintf("%08X on device #%d", getBER(cDevice::ActualDevice()->CardIndex()), cDevice::ActualDevice()->CardIndex());
|
2005-08-28 03:20:00 +02:00
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "UNCB") == 0) {
|
2005-11-13 03:20:00 +01:00
|
|
|
return cString::sprintf("%08X on device #%d", getUNC(cDevice::ActualDevice()->CardIndex()), cDevice::ActualDevice()->CardIndex());
|
2005-08-28 03:20:00 +02:00
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "VIBR") == 0) {
|
2005-11-13 03:20:00 +01:00
|
|
|
if (cFemonOsd::Instance())
|
2006-09-17 03:20:00 +02:00
|
|
|
return cString::sprintf("%s on device #%d", *getBitrateMbits(cFemonOsd::Instance()->GetVideoBitrate()), cDevice::ActualDevice()->CardIndex());
|
2005-11-13 03:20:00 +01:00
|
|
|
else
|
|
|
|
return cString::sprintf("--- Mbit/s on device #%d", cDevice::ActualDevice()->CardIndex());
|
2005-08-28 03:20:00 +02:00
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "AUBR") == 0) {
|
2005-11-13 03:20:00 +01:00
|
|
|
if (cFemonOsd::Instance())
|
2006-09-17 03:20:00 +02:00
|
|
|
return cString::sprintf("%s on device #%d", *getBitrateKbits(cFemonOsd::Instance()->GetAudioBitrate()), cDevice::ActualDevice()->CardIndex());
|
2005-11-13 03:20:00 +01:00
|
|
|
else
|
|
|
|
return cString::sprintf("--- kbit/s on device #%d", cDevice::ActualDevice()->CardIndex());
|
|
|
|
}
|
|
|
|
else if (strcasecmp(Command, "DDBR") == 0) {
|
|
|
|
if (cFemonOsd::Instance())
|
2006-09-17 03:20:00 +02:00
|
|
|
return cString::sprintf("%s on device #%d", *getBitrateKbits(cFemonOsd::Instance()->GetDolbyBitrate()), cDevice::ActualDevice()->CardIndex());
|
2005-11-13 03:20:00 +01:00
|
|
|
else
|
|
|
|
return cString::sprintf("--- kbit/s on device #%d", cDevice::ActualDevice()->CardIndex());
|
2005-08-28 03:20:00 +02:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-08-14 03:20:00 +02:00
|
|
|
class cMenuFemonSetup : public cMenuSetupPage {
|
|
|
|
private:
|
|
|
|
const char *dispmodes[eFemonModeMaxNumber];
|
|
|
|
const char *skins[eFemonSkinMaxNumber];
|
|
|
|
const char *themes[eFemonThemeMaxNumber];
|
|
|
|
cFemonConfig data;
|
2008-01-20 03:20:00 +01:00
|
|
|
cVector<const char*> help;
|
|
|
|
void Setup(void);
|
2007-08-14 03:20:00 +02:00
|
|
|
protected:
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
virtual void Store(void);
|
|
|
|
public:
|
|
|
|
cMenuFemonSetup(void);
|
|
|
|
};
|
|
|
|
|
2004-02-15 03:20:00 +01:00
|
|
|
cMenuFemonSetup::cMenuFemonSetup(void)
|
|
|
|
{
|
2005-11-13 03:20:00 +01:00
|
|
|
Dprintf("%s()\n", __PRETTY_FUNCTION__);
|
2005-02-24 03:20:00 +01:00
|
|
|
dispmodes[eFemonModeBasic] = tr("basic");
|
|
|
|
dispmodes[eFemonModeTransponder] = tr("transponder");
|
|
|
|
dispmodes[eFemonModeStream] = tr("stream");
|
|
|
|
dispmodes[eFemonModeAC3] = tr("AC-3");
|
|
|
|
|
2005-10-04 03:20:00 +02:00
|
|
|
skins[eFemonSkinClassic] = tr("Classic");
|
|
|
|
skins[eFemonSkinElchi] = tr("Elchi");
|
|
|
|
|
2005-02-24 03:20:00 +01:00
|
|
|
themes[eFemonThemeClassic] = tr("Classic");
|
|
|
|
themes[eFemonThemeElchi] = tr("Elchi");
|
2008-03-27 03:20:00 +01:00
|
|
|
themes[eFemonThemeSTTNG] = tr("ST:TNG");
|
2005-02-24 03:20:00 +01:00
|
|
|
themes[eFemonThemeDeepBlue] = tr("DeepBlue");
|
2005-04-01 03:20:00 +02:00
|
|
|
themes[eFemonThemeMoronimo] = tr("Moronimo");
|
2005-10-04 03:20:00 +02:00
|
|
|
themes[eFemonThemeEnigma] = tr("Enigma");
|
|
|
|
themes[eFemonThemeEgalsTry] = tr("EgalsTry");
|
2005-11-13 03:20:00 +01:00
|
|
|
themes[eFemonThemeDuotone] = tr("Duotone");
|
2006-02-06 03:20:00 +01:00
|
|
|
themes[eFemonThemeSilverGreen] = tr("SilverGreen");
|
2005-02-24 03:20:00 +01:00
|
|
|
|
2005-11-13 03:20:00 +01:00
|
|
|
data = femonConfig;
|
2004-03-03 03:20:00 +01:00
|
|
|
Setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cMenuFemonSetup::Setup(void)
|
|
|
|
{
|
|
|
|
int current = Current();
|
|
|
|
|
|
|
|
Clear();
|
2008-01-20 03:20:00 +01:00
|
|
|
help.Clear();
|
|
|
|
|
|
|
|
Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &data.hidemenu));
|
2008-02-18 03:20:00 +01:00
|
|
|
help.Append(tr("Define whether the main menu entry is hidden."));
|
|
|
|
|
2008-01-20 03:20:00 +01:00
|
|
|
Add(new cMenuEditStraItem(tr("Default display mode"), &data.displaymode, eFemonModeMaxNumber, dispmodes));
|
|
|
|
help.Append(tr("Define the default display mode at startup."));
|
|
|
|
|
|
|
|
Add(new cMenuEditStraItem(trVDR("Setup.OSD$Skin"), &data.skin, eFemonSkinMaxNumber, skins));
|
|
|
|
help.Append(tr("Define the used OSD skin."));
|
|
|
|
|
|
|
|
Add(new cMenuEditStraItem(trVDR("Setup.OSD$Theme"), &data.theme, eFemonThemeMaxNumber,themes));
|
|
|
|
help.Append(tr("Define the used OSD theme."));
|
|
|
|
|
|
|
|
Add(new cMenuEditBoolItem(tr("Position"), &data.position, trVDR("bottom"), trVDR("top")));
|
|
|
|
help.Append(tr("Define the position of OSD."));
|
|
|
|
|
|
|
|
Add(new cMenuEditIntItem(trVDR("Setup.OSD$Height"), &data.osdheight, 400, 500));
|
|
|
|
help.Append(tr("Define the height of OSD."));
|
|
|
|
|
|
|
|
Add(new cMenuEditIntItem(tr("Horizontal offset"), &data.osdoffset, -50, 50));
|
|
|
|
help.Append(tr("Define the horizontal offset of OSD."));
|
|
|
|
|
|
|
|
Add(new cMenuEditIntItem(tr("Red limit [%]"), &data.redlimit, 1, 50));
|
|
|
|
help.Append(tr("Define a limit for red bar, which is used to indicate a bad signal."));
|
|
|
|
|
|
|
|
Add(new cMenuEditIntItem(tr("Green limit [%]"), &data.greenlimit, 51, 100));
|
|
|
|
help.Append(tr("Define a limit for green bar, which is used to indicate a good signal."));
|
|
|
|
|
|
|
|
Add(new cMenuEditIntItem(tr("OSD update interval [0.1s]"), &data.updateinterval, 1, 100));
|
|
|
|
help.Append(tr("Define an interval for OSD updates. The smaller interval generates higher CPU load."));
|
|
|
|
|
|
|
|
Add(new cMenuEditBoolItem(tr("Analyze stream"), &data.analyzestream));
|
|
|
|
help.Append(tr("Define whether the DVB stream is analyzed and bitrates calculated."));
|
|
|
|
|
|
|
|
if (femonConfig.analyzestream) {
|
|
|
|
Add(new cMenuEditIntItem(tr("Calculation interval [0.1s]"), &data.calcinterval, 1, 100));
|
|
|
|
help.Append(tr("Define an interval for calculation. The bigger interval generates more stable values."));
|
|
|
|
}
|
|
|
|
|
|
|
|
Add(new cMenuEditBoolItem(tr("Use SVDRP service"), &data.usesvdrp));
|
|
|
|
help.Append(tr("Define whether the SVDRP service is used in client/server setups."));
|
|
|
|
|
2006-09-17 03:20:00 +02:00
|
|
|
if (data.usesvdrp) {
|
2008-01-20 03:20:00 +01:00
|
|
|
Add(new cMenuEditIntItem(tr("SVDRP service port"), &data.svdrpport, 1, 65535));
|
|
|
|
help.Append(tr("Define the port number of SVDRP service."));
|
|
|
|
|
|
|
|
Add(new cMenuEditStrItem(tr("SVDRP service IP"), data.svdrpip, MaxSvdrpIp, ".1234567890"));
|
|
|
|
help.Append(tr("Define the IP address of SVDRP service."));
|
2006-09-17 03:20:00 +02:00
|
|
|
}
|
2004-03-03 03:20:00 +01:00
|
|
|
|
|
|
|
SetCurrent(Get(current));
|
|
|
|
Display();
|
2004-02-15 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cMenuFemonSetup::Store(void)
|
|
|
|
{
|
2005-11-13 03:20:00 +01:00
|
|
|
Dprintf("%s()\n", __PRETTY_FUNCTION__);
|
|
|
|
femonConfig = data;
|
2004-03-03 03:20:00 +01:00
|
|
|
SetupStore("HideMenu", femonConfig.hidemenu);
|
|
|
|
SetupStore("DisplayMode", femonConfig.displaymode);
|
2005-10-04 03:20:00 +02:00
|
|
|
SetupStore("Skin", femonConfig.skin);
|
2005-02-24 03:20:00 +01:00
|
|
|
SetupStore("Theme", femonConfig.theme);
|
2004-09-11 03:20:00 +02:00
|
|
|
SetupStore("Position", femonConfig.position);
|
2005-01-15 03:20:00 +01:00
|
|
|
SetupStore("OSDHeight", femonConfig.osdheight);
|
2005-02-24 03:20:00 +01:00
|
|
|
SetupStore("OSDOffset", femonConfig.osdoffset);
|
2004-03-03 03:20:00 +01:00
|
|
|
SetupStore("RedLimit", femonConfig.redlimit);
|
|
|
|
SetupStore("GreenLimit", femonConfig.greenlimit);
|
|
|
|
SetupStore("UpdateInterval", femonConfig.updateinterval);
|
2004-05-30 03:20:00 +02:00
|
|
|
SetupStore("AnalStream", femonConfig.analyzestream);
|
2004-03-03 03:20:00 +01:00
|
|
|
SetupStore("CalcInterval", femonConfig.calcinterval);
|
2006-09-17 03:20:00 +02:00
|
|
|
SetupStore("UseSvdrp", femonConfig.usesvdrp);
|
|
|
|
SetupStore("ServerPort", femonConfig.svdrpport);
|
|
|
|
SetupStore("ServerIp", femonConfig.svdrpip);
|
2004-03-03 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
eOSState cMenuFemonSetup::ProcessKey(eKeys Key)
|
|
|
|
{
|
2006-09-17 03:20:00 +02:00
|
|
|
int oldUsesvdrp = data.usesvdrp;
|
2005-11-13 03:20:00 +01:00
|
|
|
int oldAnalyzestream = data.analyzestream;
|
2004-03-03 03:20:00 +01:00
|
|
|
|
|
|
|
eOSState state = cMenuSetupPage::ProcessKey(Key);
|
|
|
|
|
2008-01-20 03:20:00 +01:00
|
|
|
if (Key != kNone && (data.analyzestream != oldAnalyzestream || data.usesvdrp != oldUsesvdrp))
|
2004-03-03 03:20:00 +01:00
|
|
|
Setup();
|
2008-01-20 03:20:00 +01:00
|
|
|
|
|
|
|
if ((Key == kInfo) && (state == osUnknown) && (Current() < help.Size()))
|
|
|
|
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()]));
|
2004-03-03 03:20:00 +01:00
|
|
|
|
|
|
|
return state;
|
2004-02-15 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cMenuSetupPage *cPluginFemon::SetupMenu(void)
|
|
|
|
{
|
|
|
|
// Return a setup menu in case the plugin supports one.
|
|
|
|
return new cMenuFemonSetup;
|
|
|
|
}
|
|
|
|
|
|
|
|
VDRPLUGINCREATOR(cPluginFemon); // Don't touch this!
|