summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-08-17 14:55:52 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-03-24 15:18:07 +0100
commitd991048cfc487a5f01014f141a66d3cb92276c90 (patch)
treed00e187da05bc414f64f1d77824a432fdc2752c3
parentddae08e88f0d63814ad4fa43f9437c046d8a8488 (diff)
downloadskin-lcarsng-d991048cfc487a5f01014f141a66d3cb92276c90.tar.gz
skin-lcarsng-d991048cfc487a5f01014f141a66d3cb92276c90.tar.bz2
Add setupmenue
-rw-r--r--Makefile2
-rw-r--r--config.c63
-rw-r--r--config.h40
-rw-r--r--setup.c51
-rw-r--r--setup.h13
-rw-r--r--skinlcarsng.c5
6 files changed, 172 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4b274f5..b0e1740 100644
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,7 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
-OBJS = displaychannel.o displaymenu.o displaymessage.o displayreplay.o displaytracks.o displayvolume.o lcarsng.o $(PLUGIN).o
+OBJS = config.o displaychannel.o displaymenu.o displaymessage.o displayreplay.o displaytracks.o displayvolume.o lcarsng.o setup.o $(PLUGIN).o
### The main target:
diff --git a/config.c b/config.c
new file mode 100644
index 0000000..3497303
--- /dev/null
+++ b/config.c
@@ -0,0 +1,63 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ */
+
+#include <vdr/plugin.h>
+#include "config.h"
+
+cLCARSNGConfig Config;
+
+cLCARSNGConfig::cLCARSNGConfig(void)
+{
+ Margin = 2;
+// mcUndefined = -1,
+// mcUnknown = 0,
+ mcMainScaled = false;
+ mcScheduleScaled = false;
+// mcScheduleNow,
+// mcScheduleNext,
+ mcChannelScaled = false;
+// mcChannelEdit,
+ mcTimerScaled = false;
+// mcTimerEdit,
+ mcRecordingScaled = false;
+// mcRecordingInfo,
+// mcRecordingEdit,
+ mcPluginScaled = false;
+// mcPluginSetup,
+ mcSetupScaled = false;
+// mcSetupOsd,
+// mcSetupEpg,
+// mcSetupDvb,
+// mcSetupLnb,
+// mcSetupCam,
+// mcSetupRecord,
+// mcSetupReplay,
+// mcSetupMisc,
+// mcSetupPlugins,
+ mcCommandScaled = false;
+ mcEventScaled = false;
+ mcTextScaled = false;
+ mcFolderScaled = false;
+ mcCamScaled = false;
+}
+
+bool cLCARSNGConfig::SetupParse(const char *Name, const char *Value)
+{
+ if (!strcasecmp(Name, "Margin")) Margin = atoi(Value);
+ else if (!strcasecmp(Name, "MainMenue")) mcMainScaled = atoi(Value);
+ else if (!strcasecmp(Name, "ScheduleMenue")) mcScheduleScaled = atoi(Value);
+ else if (!strcasecmp(Name, "ChannelMenue")) mcChannelScaled = atoi(Value);
+ else if (!strcasecmp(Name, "TimerMenue")) mcTimerScaled = atoi(Value);
+ else if (!strcasecmp(Name, "RecordingMenue")) mcRecordingScaled = atoi(Value);
+ else if (!strcasecmp(Name, "PluginMenue")) mcPluginScaled = atoi(Value);
+ else if (!strcasecmp(Name, "SetupMenue")) mcSetupScaled = atoi(Value);
+ else if (!strcasecmp(Name, "CommandMenue")) mcCommandScaled = atoi(Value);
+ else if (!strcasecmp(Name, "EventMenue")) mcEventScaled = atoi(Value);
+ else if (!strcasecmp(Name, "TextMenue")) mcTextScaled = atoi(Value);
+ else if (!strcasecmp(Name, "FolderMenue")) mcFolderScaled = atoi(Value);
+ else if (!strcasecmp(Name, "CamMenue")) mcCamScaled = atoi(Value);
+ else
+ return false;
+ return true;
+}
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..eb8d615
--- /dev/null
+++ b/config.h
@@ -0,0 +1,40 @@
+#include <vdr/menu.h>
+
+class cLCARSNGConfig {
+public:
+ int Margin;
+// mcUndefined = -1,
+// mcUnknown = 0,
+ int mcMainScaled;
+ int mcScheduleScaled;
+// mcScheduleNow,
+// mcScheduleNext,
+ int mcChannelScaled;
+// mcChannelEdit,
+ int mcTimerScaled;
+// mcTimerEdit,
+ int mcRecordingScaled;
+// mcRecordingInfo,
+// mcRecordingEdit,
+ int mcPluginScaled;
+// mcPluginSetup,
+ int mcSetupScaled;
+// mcSetupOsd,
+// mcSetupEpg,
+// mcSetupDvb,
+// mcSetupLnb,
+// mcSetupCam,
+// mcSetupRecord,
+// mcSetupReplay,
+// mcSetupMisc,
+// mcSetupPlugins,
+ int mcCommandScaled;
+ int mcEventScaled;
+ int mcTextScaled;
+ int mcFolderScaled;
+ int mcCamScaled;
+ bool SetupParse(const char *Name, const char *Value);
+ cLCARSNGConfig(void);
+};
+
+extern cLCARSNGConfig Config;
diff --git a/setup.c b/setup.c
new file mode 100644
index 0000000..f8b797f
--- /dev/null
+++ b/setup.c
@@ -0,0 +1,51 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ */
+
+#include "config.h"
+#include "setup.h"
+
+/******************** MenuSetup ********************/
+cLCARSNGSetup::cLCARSNGSetup() {
+
+ tmpConfig = Config;
+
+ int currentItem = Current();
+ SetCols(45);
+
+ Add(new cMenuEditIntItem(tr("Margin"), &tmpConfig.Margin, 0, 3));
+ Add(new cOsdItem(tr("Scaled video in menue:"), osUnknown, false));
+ Add(new cMenuEditBoolItem(tr("MainMenue"), &tmpConfig.mcMainScaled));
+ Add(new cMenuEditBoolItem(tr("ScheduleMenue"), &tmpConfig.mcScheduleScaled));
+ Add(new cMenuEditBoolItem(tr("ChannelMenue"), &tmpConfig.mcChannelScaled));
+ Add(new cMenuEditBoolItem(tr("TimerMenue"), &tmpConfig.mcTimerScaled));
+ Add(new cMenuEditBoolItem(tr("RecordingMenue"), &tmpConfig.mcRecordingScaled));
+ Add(new cMenuEditBoolItem(tr("PluginMenue"), &tmpConfig.mcPluginScaled));
+ Add(new cMenuEditBoolItem(tr("SetupMenue"), &tmpConfig.mcSetupScaled));
+ Add(new cMenuEditBoolItem(tr("CommandMenue"), &tmpConfig.mcCommandScaled));
+ Add(new cMenuEditBoolItem(tr("EventMenue"), &tmpConfig.mcEventScaled));
+ Add(new cMenuEditBoolItem(tr("TextMenue"), &tmpConfig.mcTextScaled));
+ Add(new cMenuEditBoolItem(tr("FolderMenue"), &tmpConfig.mcFolderScaled));
+ Add(new cMenuEditBoolItem(tr("CamMenue"), &tmpConfig.mcCamScaled));
+
+ SetCurrent(Get(currentItem));
+ Display();
+ SetHelp(NULL, NULL, NULL, NULL);
+}
+
+void cLCARSNGSetup::Store(void) {
+ Config = tmpConfig;
+ SetupStore("Margin", Config.Margin);
+ SetupStore("MainMenue", Config.mcMainScaled);
+ SetupStore("ScheduleMenue", Config.mcScheduleScaled);
+ SetupStore("ChannelMenue", Config.mcChannelScaled);
+ SetupStore("TimerMenue", Config.mcTimerScaled);
+ SetupStore("RecordingMenue", Config.mcRecordingScaled);
+ SetupStore("PluginMenue", Config.mcPluginScaled);
+ SetupStore("SetupMenue", Config.mcSetupScaled);
+ SetupStore("CommandMenue", Config.mcCommandScaled);
+ SetupStore("EventMenue", Config.mcEventScaled);
+ SetupStore("TextMenue", Config.mcTextScaled);
+ SetupStore("FolderMenue", Config.mcFolderScaled);
+ SetupStore("CamMenue", Config.mcCamScaled);
+}
diff --git a/setup.h b/setup.h
new file mode 100644
index 0000000..2c9fbd6
--- /dev/null
+++ b/setup.h
@@ -0,0 +1,13 @@
+#include <vdr/menu.h>
+//#include "config.h"
+
+//extern cLCARSNGConfig config;
+
+class cLCARSNGSetup : public cMenuSetupPage {
+protected:
+ virtual void Store(void);
+private:
+ cLCARSNGConfig tmpConfig;
+public:
+ cLCARSNGSetup(void);
+};
diff --git a/skinlcarsng.c b/skinlcarsng.c
index e8dd7fe..e6035f4 100644
--- a/skinlcarsng.c
+++ b/skinlcarsng.c
@@ -7,6 +7,8 @@
*/
#include <getopt.h>
#include <vdr/plugin.h>
+#include "config.h"
+#include "setup.h"
#if defined(APIVERSNUM) && APIVERSNUM < 10734
#error "VDR-1.7.34 API version or greater is required!"
@@ -111,11 +113,12 @@ cOsdObject *cPluginLCARSNG::MainMenuAction(void) {
}
cMenuSetupPage *cPluginLCARSNG::SetupMenu(void) {
+ return new cLCARSNGSetup();
return NULL;
}
bool cPluginLCARSNG::SetupParse(const char *Name, const char *Value) {
- return true;
+ return Config.SetupParse(Name, Value);
}
bool cPluginLCARSNG::Service(const char *Id, void *Data) {