summaryrefslogtreecommitdiff
path: root/block/block.c
diff options
context:
space:
mode:
authorMidas <vdrportal_midas@gmx.de>2010-04-22 01:06:40 +0200
committerMidas <vdrportal_midas@gmx.de>2010-04-22 01:06:40 +0200
commit4921cf32c8bda089a21dc4a14ce191ed477f80ff (patch)
treeff9debb648949a2ad43ee7759fb667fb03a78b73 /block/block.c
downloadvdr-plugin-block-4921cf32c8bda089a21dc4a14ce191ed477f80ff.tar.gz
vdr-plugin-block-4921cf32c8bda089a21dc4a14ce191ed477f80ff.tar.bz2
Initial release. Version 0.0.1b. Fork of the taste plugin 0.0.2d by LordJaxom.
Patches for the taste plugin by tomg and mapovi were added permanently to the source of the block plugin. For more information, feature list und bugfixes read HISTORY and README please.
Diffstat (limited to 'block/block.c')
-rw-r--r--block/block.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/block/block.c b/block/block.c
new file mode 100644
index 0000000..0e3cf37
--- /dev/null
+++ b/block/block.c
@@ -0,0 +1,96 @@
+/**
+ * block.c: A plugin for the Video Disk Recorder
+ *
+ * based on taste.c v 1.1.1.1 2006/02/26 14:11:02 by lordjaxom
+ *
+ * See the README file for copyright and contact information.
+ *
+ * version by Midas
+ *
+ */
+
+#include <vdr/plugin.h>
+
+#include "status.h"
+#include "event.h"
+#include "setup.h"
+#include "config.h"
+#include "i18n.h"
+
+static const char *VERSION = "0.0.1b";
+static const char *DESCRIPTION = trNOOP("Lock unwanted shows by keywords");
+static const char *MAINMENUENTRY = trNOOP("Schedule not acceptable");
+
+class cPluginBlock : public cPlugin {
+private:
+ cStatusBlock *mStatus;
+
+public:
+ cPluginBlock(void);
+ virtual ~cPluginBlock();
+ virtual const char *Version(void) { return VERSION; }
+ virtual const char *Description(void) { return tr(DESCRIPTION); }
+ virtual bool Initialize(void);
+ virtual bool Start(void);
+ virtual const char *MainMenuEntry(void) { return SetupBlock.HideMenuEntry ? NULL : tr(MAINMENUENTRY); }
+ virtual cOsdObject *MainMenuAction(void);
+ virtual cMenuSetupPage *SetupMenu(void);
+ virtual bool SetupParse(const char *Name, const char *Value);
+ };
+
+cPluginBlock::cPluginBlock(void):
+ cPlugin(),
+ mStatus(NULL)
+{
+}
+
+cPluginBlock::~cPluginBlock()
+{
+ delete mStatus;
+}
+
+bool cPluginBlock::Initialize(void)
+{
+ return EventsBlock.Load(AddDirectory(cPlugin::ConfigDirectory(), "block.conf"), true, false);
+}
+
+bool cPluginBlock::Start(void)
+{
+#if VDRVERSNUM < 10507
+ RegisterI18n(Phrases);
+#endif
+ mStatus = new cStatusBlock();
+ return true;
+}
+
+cOsdObject *cPluginBlock::MainMenuAction(void)
+{
+ const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ if (channel != NULL && !channel->GroupSep()) {
+ cSchedulesLock schedLock;
+ const cSchedules *scheds = cSchedules::Schedules(schedLock);
+ if (scheds == NULL)
+ return NULL;
+
+ const cSchedule *sched = scheds->GetSchedule(channel->GetChannelID());
+ if (sched == NULL)
+ return NULL;
+
+ const cEvent *present = sched->GetPresentEvent();
+ EventsBlock.Add(new cEventBlock(present->Title()));
+ EventsBlock.Save();
+ }
+ return NULL;
+}
+
+cMenuSetupPage *cPluginBlock::SetupMenu(void)
+{
+ return new cMenuSetupBlock();
+}
+
+bool cPluginBlock::SetupParse(const char *Name, const char *Value)
+{
+ return SetupBlock.Parse(Name, Value);
+}
+
+VDRPLUGINCREATOR(cPluginBlock); // Don't touch this!