summaryrefslogtreecommitdiff
path: root/osdpip.c
blob: 7507777248eb6ae5a6984d6ad54ab3bf2c0813fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
 * osdpip.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#include "osd.h"
#include "config.h"
#include "i18n.h"

#include <vdr/plugin.h>

static const char *VERSION        = "0.0.2";
static const char *DESCRIPTION    = "OSD Picture-in-Picture";
static const char *MAINMENUENTRY  = "Picture-in-Picture";

class cPluginOsdpip : public cPlugin {
private:
	
public:
  cPluginOsdpip(void);
  virtual ~cPluginOsdpip();
  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 Housekeeping(void);
  virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); }
  virtual cOsdObject *MainMenuAction(void);
  virtual cMenuSetupPage *SetupMenu(void);
  virtual bool SetupParse(const char *Name, const char *Value);
};

cPluginOsdpip::cPluginOsdpip(void) {
}

cPluginOsdpip::~cPluginOsdpip() {
}

const char *cPluginOsdpip::CommandLineHelp(void) {
  return NULL;
}

bool cPluginOsdpip::ProcessArgs(int argc, char *argv[]) {
  return true;
}

bool cPluginOsdpip::Initialize(void) {
  return true;
}

bool cPluginOsdpip::Start(void) {
	RegisterI18n(Phrases);
  return true;
}

void cPluginOsdpip::Housekeeping(void) {
}

cOsdObject *cPluginOsdpip::MainMenuAction(void) {
	const cChannel *chan;
	cDevice *dev;

	chan = cDevice::CurrentChannel() != 0 
			? Channels.GetByNumber(cDevice::CurrentChannel()) : NULL;
	if (chan != NULL) {
		dev = cDevice::GetDevice(chan, 1); 
		if (dev)
			return new cOsdPipObject(dev, chan);
	}
	return NULL;
}

cMenuSetupPage *cPluginOsdpip::SetupMenu(void) {
  return new cOsdPipSetupPage;
}

bool cPluginOsdpip::SetupParse(const char *Name, const char *Value) {
  return OsdPipSetup.SetupParse(Name, Value);
}

VDRPLUGINCREATOR(cPluginOsdpip); // Don't touch this!