-
Notifications
You must be signed in to change notification settings - Fork 0
/
pvr350.c
124 lines (107 loc) · 4.08 KB
/
pvr350.c
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* pvr350.c: A plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
* $Id: pvr350.c,v 1.9 2007/01/02 20:00:00 dom Exp $
*/
#include <vdr/plugin.h>
#include "pvr350device.h"
#include "pvr350menu.h"
#include "pvr350.h"
static const char *VERSION = "2.0.0";
static const char *DESCRIPTION = trNOOP("PVR350 as output device");
cPluginPvr350::cPluginPvr350(void)
{
// Initialize any member variables here.
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
pvr350device = NULL;
}
cPluginPvr350::~cPluginPvr350()
{
// Clean up after yourself!
if (pvr350device) {
// FIXME: 'delete pvr350device;' gives segfaults
pvr350device = NULL;
}
}
const char * cPluginPvr350::Version(void) {
return VERSION;
}
const char * cPluginPvr350::Description(void) {
return tr(DESCRIPTION);
}
const char *cPluginPvr350::CommandLineHelp(void)
{
// Return a string that describes all known command line options.
return NULL;
}
bool cPluginPvr350::ProcessArgs(int argc, char *argv[])
{
// Implement command line argument processing here if applicable.
return true;
}
bool cPluginPvr350::Initialize(void)
{
// Initialize any background activities the plugin shall perform.
pvr350device = new cPvr350Device();
return true;
}
bool cPluginPvr350::Start(void)
{
// Start any background activities the plugin shall perform.
return true;
}
void cPluginPvr350::Housekeeping(void)
{
// Perform any cleanup or other regular tasks.
}
cMenuSetupPage * cPluginPvr350::SetupMenu(void)
{
return new cPvr350MenuSetup();
}
bool cPluginPvr350::SetupParse(const char *Name, const char *Value)
{
if (!strcasecmp(Name, "LogLevel")) Pvr350Setup.LogLevel = atoi(Value);
else if (!strcasecmp(Name, "UseWssBits")) Pvr350Setup.UseWssBits = atoi(Value);
else if (!strcasecmp(Name, "WSS_16:9_for_pmExtern")) Pvr350Setup.WSS_169_for_pmExtern = atoi(Value);
else if (!strcasecmp(Name, "AC3Gain")) Pvr350Setup.AC3Gain = atoi(Value);
else if (!strcasecmp(Name, "DeviceNumber")) Pvr350Setup.DeviceNumber = atoi(Value);
else if (!strcasecmp(Name, "BlackVideoForAudioOnly")) Pvr350Setup.BlackVideoForAudioOnly = atoi(Value);
else if (!strcasecmp(Name, "RecodeMP2")) Pvr350Setup.RecodeMP2 = atoi(Value);
else
return false;
return true;
}
const char **cPluginPvr350::SVDRPHelpPages(void)
{
// Return help text for SVDRP commands this plugin implements
static const char *HelpPages[] = {
"WSS_16:9\n"
" Send a 16:9 (anamorphic) WSS signal to the TV\n"
" Note: makes only sense if UseWssBits is set to 'no' or for PlayMode pmExtern (e.g. mplayer)\n"
" Otherwise autodetection will immidiately overwrite the signal",
"WSS_4:3\n"
" Send a 4:3 WSS signal to the TV\n"
" Note: makes only sense if UseWssBits is set to 'no' or for PlayMode pmExtern (e.g. mplayer)\n"
" Otherwise autodetection will immidiately overwrite the signal",
"WSS_ZOOM\n"
" Send a 'zoom 4:3 to 16:9 Letterbox' WSS signal to the TV\n"
" Note: makes only sense if UseWssBits is set to 'no' or for PlayMode pmExtern (e.g. mplayer)\n"
" Otherwise autodetection will immidiately overwrite the signal",
"RESET\n"
" Reset pvr350-plugin\n",
NULL
};
return HelpPages;
}
cString cPluginPvr350::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
{
if(!strcasecmp(Command,"WSS_16:9")) { pvr350device->Set_wss_mode(7); return "16:9 WSS signal sent"; }
else if(!strcasecmp(Command,"WSS_4:3")) { pvr350device->Set_wss_mode(8); return "4:3 WSS signal sent"; }
else if(!strcasecmp(Command,"WSS_ZOOM")) { pvr350device->Set_wss_mode(11); return "Zoom WSS signal sent"; }
else if(!strcasecmp(Command,"RESET")) { new cPvr350Device(); return "resetted pvr350- plugin";}
return NULL;
}
VDRPLUGINCREATOR(cPluginPvr350); // Don't touch this!