summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--menueditkeys.c51
-rw-r--r--menueditkeys.h22
-rw-r--r--menunoselectitem.h29
-rw-r--r--menutext.c36
-rw-r--r--menutext.h23
5 files changed, 161 insertions, 0 deletions
diff --git a/menueditkeys.c b/menueditkeys.c
new file mode 100644
index 0000000..7eb9933
--- /dev/null
+++ b/menueditkeys.c
@@ -0,0 +1,51 @@
+/*
+ * autotimeredit: A plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id: menueditkeys.c 0.4 2005/11/16 18:39:18 hflor Exp $
+ */
+
+#include "menueditkeys.h"
+#include "undelete.h"
+
+// --- cMenuEditKeysItem -----------------------------------------------------
+
+cMenuEditKeysItem::cMenuEditKeysItem(const char *Name, int *Value)
+:cMenuEditStraItem(Name, Value, MaxKeysName, KeysName)
+{
+}
+
+eOSState cMenuEditKeysItem::ProcessKey(eKeys Key)
+{
+ eOSState state = osUnknown;
+
+ int newkey = -1;
+ switch (Key)
+ {
+ case kBlue: newkey += 2; // no break!
+ case kYellow: newkey += 2; // no break!
+ case kGreen: newkey += 2; // no break!
+ case kRed: newkey += 2; // newkey red=1 green=3 yellow=5 blue=7
+ if (*value == newkey)
+ newkey++;
+ if (*value == (newkey + 1))
+ newkey = 0;
+ break;
+ case k0...k9: newkey = Key - k0 + 9;
+ break;
+ case kUser1...kUser9: newkey = Key - kUser1 + 19;
+ break;
+ default: state = cMenuEditStraItem::ProcessKey(Key);
+ break;
+ }
+ if (*value == newkey)
+ newkey = 0;
+ if (newkey >= 0)
+ {
+ state = osContinue;
+ *value = newkey;
+ Set();
+ }
+ return state;
+}
diff --git a/menueditkeys.h b/menueditkeys.h
new file mode 100644
index 0000000..0726159
--- /dev/null
+++ b/menueditkeys.h
@@ -0,0 +1,22 @@
+/*
+ * autotimeredit: A plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id: menueditkeys.h 0.4 2005/11/16 18:39:18 hflor Exp $
+ */
+
+#ifndef __MENUEDITKEYS_H
+#define __MENUEDITKEYS_H
+
+#include <vdr/menuitems.h>
+
+// --- cMenuEditKeysItem -----------------------------------------------------
+
+class cMenuEditKeysItem : public cMenuEditStraItem {
+public:
+ cMenuEditKeysItem(const char *Name, int *Value);
+ virtual eOSState ProcessKey(eKeys Key);
+ };
+
+#endif //__MENUEDITKEYS_H
diff --git a/menunoselectitem.h b/menunoselectitem.h
new file mode 100644
index 0000000..1a43127
--- /dev/null
+++ b/menunoselectitem.h
@@ -0,0 +1,29 @@
+/*
+ * autotimeredit: A plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id: menunoselectitem.h 0.4 2005/11/16 18:39:18 hflor Exp $
+ */
+
+#ifndef __MENUNOSELECTITEM_H
+#define __MENUNOSELECTITEM_H
+
+#include <vdr/osd.h>
+
+// --- cMenuOsdNoSelectItem -----------------------------------------------------
+
+class cMenuOsdNoSelectItem : public cOsdItem {
+public:
+#if VDRVERSNUM >= 10307
+ cMenuOsdNoSelectItem(const char *Text):cOsdItem(Text) { SetSelectable(false); }
+#else
+ #ifdef HAVE_ELCHI
+ cMenuOsdNoSelectItem(const char *Text):cOsdItem(Text) { SetColor(Setup.Theme == themeVanilla ? clrCyan : clrScrolLine, clrBackground); }
+ #else
+ cMenuOsdNoSelectItem(const char *Text):cOsdItem(Text) { SetColor(clrCyan, clrBackground); }
+ #endif
+#endif
+ };
+
+#endif //__MENUNOSELECTITEM_H
diff --git a/menutext.c b/menutext.c
new file mode 100644
index 0000000..83e5a20
--- /dev/null
+++ b/menutext.c
@@ -0,0 +1,36 @@
+/*
+ * undelete: A plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id: menutext.c 0.4 2005/11/16 18:39:18 hflor Exp $
+ */
+
+#include "menutext.h"
+#include <vdr/menuitems.h>
+
+// --- cMenuText -------------------------------------------------------------
+
+cMenuText::cMenuText(const char *Title, const char *Text, eDvbFont Font)
+:cOsdMenu(Title)
+{
+ Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, Font));
+}
+
+eOSState cMenuText::ProcessKey(eKeys Key)
+{
+ eOSState state = cOsdMenu::ProcessKey(Key);
+
+ switch (state)
+ {
+ case osUnknown: switch (NORMALKEY(Key))
+ {
+ case kOk: state = osBack;
+ break;
+ default: break;
+ }
+ break;
+ default: break;
+ }
+ return state;
+}
diff --git a/menutext.h b/menutext.h
new file mode 100644
index 0000000..1f163fe
--- /dev/null
+++ b/menutext.h
@@ -0,0 +1,23 @@
+/*
+ * undelete: A plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id: menutext.h 0.4 2005/11/16 18:39:18 hflor Exp $
+ */
+
+#ifndef __MENUTEXT_H
+#define __MENUTEXT_H
+
+#include <vdr/osd.h>
+#include <vdr/osdbase.h>
+
+// --- cMenuText -------------------------------------------------------------
+
+class cMenuText : public cOsdMenu {
+public:
+ cMenuText(const char *Title, const char *Text, eDvbFont Font = fontOsd);
+ virtual eOSState ProcessKey(eKeys Key);
+ };
+
+#endif // __MENUTEXT_H