diff options
author | Christian Völlinger <zerov83@gmail.com> | 2013-12-29 18:56:05 +0100 |
---|---|---|
committer | Christian Völlinger <zerov83@gmail.com> | 2013-12-29 18:56:05 +0100 |
commit | 36ab01b35f87a616af20e8b3063a3995a119f197 (patch) | |
tree | 3b179cb769a610b40940da0835f911d4040a716d /main_menu.c | |
parent | b35c5a69889ee3eeb4d3ec136523746fe8ebe233 (diff) | |
download | vdr-plugin-boblight-36ab01b35f87a616af20e8b3063a3995a119f197.tar.gz vdr-plugin-boblight-36ab01b35f87a616af20e8b3063a3995a119f197.tar.bz2 |
Startup View Mode eingebaut.
Refactoring
Makefile angepasst, Es wird nun automatisch die Git Version im Plugin verwendet.
Diffstat (limited to 'main_menu.c')
-rw-r--r-- | main_menu.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/main_menu.c b/main_menu.c new file mode 100644 index 0000000..04c58ef --- /dev/null +++ b/main_menu.c @@ -0,0 +1,60 @@ + +#include <vdr/plugin.h> + +#include "ambiservice.h" +#include "main_menu.h" +#include "config.h" +#include "common.h" + +cBoblightPluginMenu::cBoblightPluginMenu(const char* title, cPluginBoblight* aPlugin) +{ + plugin = aPlugin; + + Create(); +} + +void cBoblightPluginMenu::Create(void) { + Clear(); + + Add(new cMenuEditStraItem(tr("View Mode"), &cfg.viewMode, cAmbiService::vmCount, cAmbiService::viewModes)); + Add(new cMenuEditStraItem(tr("Startup View Mode"), &cfg.startupViewMode, cAmbiService::vmCount, cAmbiService::viewModes)); + + Add(new cMenuEditIntItem(tr("Fixed Color Red"), &cfg.fixedR, 0, 255)); + Add(new cMenuEditIntItem(tr("Fixed Color Green"), &cfg.fixedG, 0, 255)); + Add(new cMenuEditIntItem(tr("Fixed Color Blue"), &cfg.fixedB, 0, 255)); + + SetHelp(0, 0, 0, 0); + Display(); +} + +void cBoblightPluginMenu::Store() { + plugin->Save(); +} + +//*************************************************************************** +// Process Key +//*************************************************************************** + +eOSState cBoblightPluginMenu::ProcessKey(eKeys key) +{ + eOSState state = cOsdMenu::ProcessKey(key); + + if (state != osUnknown) + return state; + + if (key == kLeft || key == kRight) + { + if (cfg.viewMode == cAmbiService::vmDetached && plugin->isRunning()) + plugin->stopAtmo(); + else if (cfg.viewMode != cAmbiService::vmDetached && !plugin->isRunning()) + plugin->startAtmo(); + } + + if (key == kOk) + { + plugin->Save(); + return osEnd; + } + + return state; +}
\ No newline at end of file |