summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreas 'randy' weinberger <vdr@smue.org>2011-01-23 21:14:23 +0100
committerandreas 'randy' weinberger <vdr@smue.org>2011-01-23 21:14:23 +0100
commit8a131ac2cd9418b18e5239a8fbdc2f18a5885fe4 (patch)
tree919684386fd512394de78adf9b144e79b1d796fe
parent32e068775c30cf3aae5ff5ccf952dd1c04a88041 (diff)
downloadvdr-plugin-graphlcd-8a131ac2cd9418b18e5239a8fbdc2f18a5885fe4.tar.gz
vdr-plugin-graphlcd-8a131ac2cd9418b18e5239a8fbdc2f18a5885fe4.tar.bz2
feature: display menu entries for span only if the plugin is loaded
-rw-r--r--menu.c7
-rw-r--r--plugin.c13
-rw-r--r--setup.c5
-rw-r--r--setup.h3
4 files changed, 23 insertions, 5 deletions
diff --git a/menu.c b/menu.c
index 0d2f208..a23cd98 100644
--- a/menu.c
+++ b/menu.c
@@ -75,8 +75,11 @@ cGraphLCDMenuSetup::cGraphLCDMenuSetup()
Add(new cMenuEditIntItem(tr("Brightness on user activity"), &newGraphLCDSetup.BrightnessActive, 0, 100));
Add(new cMenuEditIntItem(tr("Brightness on user inactivity"), &newGraphLCDSetup.BrightnessIdle, 0, 100));
Add(new cMenuEditIntItem(tr("Brightness delay [s]"), &newGraphLCDSetup.BrightnessDelay, 0, 600));
- Add(new cMenuEditBoolItem(tr("Show spectrum analyzer"), &newGraphLCDSetup.enableSpectrumAnalyzer));
- Add(new cMenuEditBoolItem(tr("Show analyzer volume"), &newGraphLCDSetup.SAShowVolume));
+ if (newGraphLCDSetup.pluginSpectrumAnalyzer)
+ {
+ Add(new cMenuEditBoolItem(tr("Show spectrum analyzer"), &newGraphLCDSetup.enableSpectrumAnalyzer));
+ Add(new cMenuEditBoolItem(tr("Show analyzer volume"), &newGraphLCDSetup.SAShowVolume));
+ }
}
void cGraphLCDMenuSetup::Store()
diff --git a/plugin.c b/plugin.c
index 0710c81..f100c2b 100644
--- a/plugin.c
+++ b/plugin.c
@@ -177,6 +177,19 @@ bool cPluginGraphLCD::Start()
{
int count;
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
+ if (strstr(p->Name(), "span")) {
+ isyslog("graphlcd plugin: found %s (%s) plugin\n", p->Name(), p->Version());
+ GraphLCDSetup.pluginSpectrumAnalyzer=1;
+ };
+ } else {
+ break;
+ }
+ }
+
+
dsyslog("graphlcd plugin: waiting for display thread to get ready");
for (count = 0; count < 1200; count++)
{
diff --git a/setup.c b/setup.c
index d45fdfb..10631d5 100644
--- a/setup.c
+++ b/setup.c
@@ -27,7 +27,6 @@
#include "setup.h"
-
cGraphLCDSetup GraphLCDSetup;
cGraphLCDSetup::cGraphLCDSetup(void)
@@ -53,7 +52,8 @@ cGraphLCDSetup::cGraphLCDSetup(void)
BrightnessActive(100),
BrightnessIdle(100),
BrightnessDelay(30),
- enableSpectrumAnalyzer(1), //span
+ pluginSpectrumAnalyzer(0), // SPAN loaded?
+ enableSpectrumAnalyzer(1),
SAShowVolume(1)
{
}
@@ -92,6 +92,7 @@ void cGraphLCDSetup::CopyFrom(const cGraphLCDSetup * source)
BrightnessActive = source->BrightnessActive;
BrightnessIdle = source->BrightnessIdle;
BrightnessDelay = source->BrightnessDelay;
+ pluginSpectrumAnalyzer = source->pluginSpectrumAnalyzer;
enableSpectrumAnalyzer = source->enableSpectrumAnalyzer;
SAShowVolume = source->SAShowVolume;
}
diff --git a/setup.h b/setup.h
index 2796856..ec73f25 100644
--- a/setup.h
+++ b/setup.h
@@ -54,7 +54,8 @@ public:
int BrightnessActive;
int BrightnessIdle;
int BrightnessDelay;
- int enableSpectrumAnalyzer; //span
+ int pluginSpectrumAnalyzer;
+ int enableSpectrumAnalyzer;
int SAShowVolume;
public: