summaryrefslogtreecommitdiff
path: root/hddarchive.c
diff options
context:
space:
mode:
authorThomas Maass <mase@mase1.setho.org>2013-09-22 18:09:18 +0200
committerThomas Maass <mase@mase1.setho.org>2013-09-22 18:09:18 +0200
commit8cc24eb1c96d0b5967de39dee9c4dc4a2ccc940f (patch)
tree48b5f8e49ea515266988c4ed772236b1ff96115b /hddarchive.c
downloadvdr-plugin-hddarchive-8cc24eb1c96d0b5967de39dee9c4dc4a2ccc940f.tar.gz
vdr-plugin-hddarchive-8cc24eb1c96d0b5967de39dee9c4dc4a2ccc940f.tar.bz2
Initial commit.
Diffstat (limited to 'hddarchive.c')
-rw-r--r--hddarchive.c154
1 files changed, 154 insertions, 0 deletions
diff --git a/hddarchive.c b/hddarchive.c
new file mode 100644
index 0000000..ecefac6
--- /dev/null
+++ b/hddarchive.c
@@ -0,0 +1,154 @@
+/*
+ * hddarchive.c: A plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id$
+ */
+
+#include <vdr/plugin.h>
+#include <vdr/recording.h>
+#include "mymenu.h"
+
+static const char *VERSION = "0.0.1";
+static const char *DESCRIPTION = "Archive HDD functions";
+static const char *MAINMENUENTRY = "HDD-Archive";
+cHddArchiveConfig HddArchiveConfig;
+
+class cPluginHddarchive : public cPlugin {
+ private:
+ public:
+ cPluginHddarchive(void);
+ virtual ~cPluginHddarchive();
+ virtual const char *Version(void) { return VERSION; }
+ virtual const char *Description(void) { return DESCRIPTION; }
+ virtual const char *CommandLineHelp(void);
+ virtual bool ProcessArgs(int argc, char *argv[]);
+ virtual bool Initialize(void);
+ virtual bool Start(void);
+ virtual void Stop(void);
+ virtual void Housekeeping(void);
+ virtual void MainThreadHook(void);
+ virtual cString Active(void);
+ virtual time_t WakeupTime(void);
+ virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; }
+ virtual cOsdObject *MainMenuAction(void);
+ virtual cMenuSetupPage *SetupMenu(void);
+ virtual bool SetupParse(const char *Name, const char *Value);
+ virtual bool Service(const char *Id, void *Data = NULL);
+ virtual const char **SVDRPHelpPages(void);
+ virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
+};
+
+cPluginHddarchive::cPluginHddarchive(void)
+{
+
+}
+
+cPluginHddarchive::~cPluginHddarchive()
+{
+}
+
+const char *cPluginHddarchive::CommandLineHelp(void)
+{
+ return NULL;
+}
+
+bool cPluginHddarchive::ProcessArgs(int argc, char *argv[])
+{
+ return true;
+}
+
+bool cPluginHddarchive::Initialize(void)
+{
+ return true;
+}
+
+bool cPluginHddarchive::Start(void)
+{
+ return true;
+}
+
+void cPluginHddarchive::Stop(void)
+{
+}
+
+void cPluginHddarchive::Housekeeping(void)
+{
+}
+
+void cPluginHddarchive::MainThreadHook(void)
+{
+}
+
+cString cPluginHddarchive::Active(void)
+{
+ return NULL;
+}
+
+time_t cPluginHddarchive::WakeupTime(void)
+{
+ return 0;
+}
+
+cOsdObject *cPluginHddarchive::MainMenuAction(void)
+{
+ return new cMyMenuRecordings();
+}
+
+cMenuSetupPage *cPluginHddarchive::SetupMenu(void)
+{
+ return new cHddArchiveSetup();
+}
+
+bool cPluginHddarchive::SetupParse(const char *Name, const char *Value)
+{
+ return HddArchiveConfig.SetupParse(Name, Value);
+}
+
+struct Hddarchive_archiveid_v1_0
+{
+ const cRecording *recording;
+ bool isarchive;
+ const char *archiveid;
+};
+
+struct Hddarchive_play_v1_0
+{
+ cMenuRecordingItem *item;
+};
+
+bool cPluginHddarchive::Service(const char *Id, void *Data)
+{
+ if (!strcmp(Id, "Hddarchive-archiveid_v1.0")) {
+ if (Data == NULL)
+ return true;
+ Hddarchive_archiveid_v1_0 *archive = (Hddarchive_archiveid_v1_0 *)Data;
+ archive->archiveid = cArchive::GetArchiveId(archive->recording);
+ archive->isarchive = strcmp(archive->archiveid, "") ? true : false;
+ return true;
+ }
+
+ if (!strcmp(Id, "Hddarchive-play_v1.0")) {
+ if (Data == NULL)
+ return false;
+ Hddarchive_play_v1_0 *play = (Hddarchive_play_v1_0 *)Data;
+ cMyMenuRecordings player(NULL, 0, false, false);
+ player.SetCurrent((cOsdItem *)play->item, false);
+ player.ProcessKey(kRed);
+ return true;
+ }
+ return false;
+}
+
+const char **cPluginHddarchive::SVDRPHelpPages(void)
+{
+ return NULL;
+}
+
+cString cPluginHddarchive::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
+{
+ return NULL;
+}
+
+VDRPLUGINCREATOR(cPluginHddarchive);