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.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*/
|
|
|
|
|
2004-02-27 03:20:00 +01:00
|
|
|
#include "femoncfg.h"
|
2004-02-15 03:20:00 +01:00
|
|
|
#include "femoni18n.h"
|
2004-02-27 03:20:00 +01:00
|
|
|
#include "femonreceiver.h"
|
|
|
|
#include "femonosd.h"
|
|
|
|
#include "femon.h"
|
2004-02-15 03:20:00 +01:00
|
|
|
|
2005-02-24 03:20:00 +01:00
|
|
|
#if VDRVERSNUM && VDRVERSNUM < 10321
|
2004-05-18 03:20:00 +02:00
|
|
|
#error "You don't exist! Go away!"
|
|
|
|
#endif
|
|
|
|
|
2004-02-15 03:20:00 +01:00
|
|
|
cPluginFemon::cPluginFemon(void)
|
|
|
|
{
|
|
|
|
// 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!
|
|
|
|
}
|
|
|
|
|
|
|
|
cPluginFemon::~cPluginFemon()
|
|
|
|
{
|
|
|
|
// Clean up after yourself!
|
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
|
|
|
RegisterI18n(Phrases);
|
|
|
|
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.
|
|
|
|
return new cFemonOsd();
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2004-03-07 03:20:00 +01:00
|
|
|
else if (!strcasecmp(Name, "SyslogOutput")) femonConfig.syslogoutput = atoi(Value);
|
2004-03-03 03:20:00 +01:00
|
|
|
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);
|
|
|
|
else if (!strcasecmp(Name, "Theme")) femonConfig.theme = atoi(Value);
|
2004-09-11 03:20:00 +02:00
|
|
|
else if (!strcasecmp(Name, "ShowCASystem")) femonConfig.showcasystem = 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);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
cMenuFemonSetup::cMenuFemonSetup(void)
|
|
|
|
{
|
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");
|
|
|
|
|
|
|
|
themes[eFemonThemeClassic] = tr("Classic");
|
|
|
|
themes[eFemonThemeElchi] = tr("Elchi");
|
|
|
|
themes[eFemonThemeDeepBlue] = tr("DeepBlue");
|
|
|
|
|
2004-03-03 03:20:00 +01:00
|
|
|
Setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cMenuFemonSetup::Setup(void)
|
|
|
|
{
|
|
|
|
int current = Current();
|
|
|
|
|
|
|
|
Clear();
|
2005-02-24 03:20:00 +01:00
|
|
|
Add(new cMenuEditBoolItem( tr("Hide main menu entry"), &femonConfig.hidemenu, tr("no"), tr("yes")));
|
|
|
|
Add(new cMenuEditBoolItem( tr("Use syslog output"), &femonConfig.syslogoutput, tr("no"), tr("yes")));
|
|
|
|
Add(new cMenuEditStraItem( tr("Default display mode"), &femonConfig.displaymode, eFemonModeMaxNumber, dispmodes));
|
|
|
|
Add(new cMenuEditStraItem( tr("Theme"), &femonConfig.theme, eFemonThemeMaxNumber,themes));
|
|
|
|
Add(new cMenuEditBoolItem( tr("Position"), &femonConfig.position, tr("bottom"), tr("top")));
|
|
|
|
Add(new cMenuEditIntItem( tr("Height"), &femonConfig.osdheight, 400, 500));
|
|
|
|
Add(new cMenuEditIntItem( tr("Horizontal offset"), &femonConfig.osdoffset, -50, 50));
|
|
|
|
Add(new cMenuEditBoolItem( tr("Show CA system"), &femonConfig.showcasystem, tr("no"), tr("yes")));
|
|
|
|
Add(new cMenuEditIntItem( tr("Red limit [%]"), &femonConfig.redlimit, 1, 50));
|
|
|
|
Add(new cMenuEditIntItem( tr("Green limit [%]"), &femonConfig.greenlimit, 51, 100));
|
|
|
|
Add(new cMenuEditIntItem( tr("OSD update interval [0.1s]"), &femonConfig.updateinterval, 1, 100));
|
|
|
|
Add(new cMenuEditBoolItem( tr("Analyze stream"), &femonConfig.analyzestream, tr("no"), tr("yes")));
|
2004-05-30 03:20:00 +02:00
|
|
|
if (femonConfig.analyzestream)
|
2005-02-24 03:20:00 +01:00
|
|
|
Add(new cMenuEditIntItem(tr("Calculation interval [0.1s]"), &femonConfig.calcinterval, 1, 100));
|
2004-03-03 03:20:00 +01:00
|
|
|
|
|
|
|
SetCurrent(Get(current));
|
|
|
|
Display();
|
2004-02-15 03:20:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cMenuFemonSetup::Store(void)
|
|
|
|
{
|
2004-03-03 03:20:00 +01:00
|
|
|
SetupStore("HideMenu", femonConfig.hidemenu);
|
2004-03-07 03:20:00 +01:00
|
|
|
SetupStore("SyslogOutput", femonConfig.syslogoutput);
|
2004-03-03 03:20:00 +01:00
|
|
|
SetupStore("DisplayMode", femonConfig.displaymode);
|
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-09-11 03:20:00 +02:00
|
|
|
SetupStore("ShowCASystem", femonConfig.showcasystem);
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
eOSState cMenuFemonSetup::ProcessKey(eKeys Key)
|
|
|
|
{
|
2004-05-30 03:20:00 +02:00
|
|
|
int oldAnalyzestream = femonConfig.analyzestream;
|
2004-03-03 03:20:00 +01:00
|
|
|
|
|
|
|
eOSState state = cMenuSetupPage::ProcessKey(Key);
|
|
|
|
|
2004-05-30 03:20:00 +02:00
|
|
|
if (Key != kNone && (femonConfig.analyzestream != oldAnalyzestream)) {
|
2004-03-03 03:20:00 +01:00
|
|
|
Setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
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!
|