summaryrefslogtreecommitdiff
path: root/pvrinput.c
diff options
context:
space:
mode:
Diffstat (limited to 'pvrinput.c')
-rw-r--r--pvrinput.c131
1 files changed, 131 insertions, 0 deletions
diff --git a/pvrinput.c b/pvrinput.c
new file mode 100644
index 0000000..85a3320
--- /dev/null
+++ b/pvrinput.c
@@ -0,0 +1,131 @@
+#include "common.h"
+
+#if VDRVERSNUM < 10713
+#ifndef PLUGINPARAMPATCHVERSNUM
+#error "You must apply the pluginparam patch for VDR!"
+#endif
+#endif
+
+static const char *VERSION = "1.7.1-rc1-9";
+static const char *DESCRIPTION = tr("use Hauppauge PVR as input device");
+static const char *MAINMENUENTRY = tr("PVR picture settings");
+
+
+cPluginPvrInput * PluginPvrInput;
+
+cPluginPvrInput::cPluginPvrInput(void) {
+ PluginPvrInput = this;
+}
+
+cPluginPvrInput::~cPluginPvrInput() {
+ PluginPvrInput = NULL;
+}
+
+const char * cPluginPvrInput::Version(void) {
+ return VERSION;
+}
+
+const char * cPluginPvrInput::Description(void) {
+ return tr(DESCRIPTION);
+}
+
+const char * cPluginPvrInput::CommandLineHelp(void) {
+ return NULL;
+}
+
+bool cPluginPvrInput::ProcessArgs(int argc, char * argv[]) {
+ return true;
+}
+
+bool cPluginPvrInput::Initialize(void) {
+#if VDRVERSNUM < 10507
+ RegisterI18n(pvrinput_Phrases);
+#endif //VDRVERSNUM < 10507
+ return true;
+}
+
+bool cPluginPvrInput::Start(void) {
+/* Start() is called after the primary device and user interface has
+ been set up, but before the main program loop is entered. Is called
+ after Initialize(). */
+ cPvrDevice::Initialize();
+ return true;
+}
+
+void cPluginPvrInput::Stop(void) {
+/* Any threads the plugin may have created shall be stopped
+ in the Stop() function. See VDR/PLUGINS.html */
+ cPvrDevice::Stop();
+};
+
+void cPluginPvrInput::Housekeeping(void) {
+}
+
+const char * cPluginPvrInput::MainMenuEntry(void) {
+ if (PvrSetup.HideMainMenuEntry)
+ return NULL;
+ else
+ return tr(MAINMENUENTRY);
+}
+
+
+cOsdObject * cPluginPvrInput::MainMenuAction(void) {
+ cChannel * channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ if (channel
+#if VDRVERSNUM < 10713
+ && channel->IsPlug()
+#else
+ && (channel->Source() == 'V')
+#endif
+ )
+ return new cPvrMenuMain();
+ Skins.Message(mtError, tr("Setup.pvrinput$Not on an analogue channel!"), 2);
+ return NULL;
+}
+
+cMenuSetupPage * cPluginPvrInput::SetupMenu(void) {
+ return new cPvrMenuSetup();
+}
+
+bool cPluginPvrInput::SetupParse(const char * Name, const char * Value) {
+ if (!strcasecmp(Name, "LogLevel")) PvrSetup.LogLevel = atoi(Value);
+ else if (!strcasecmp(Name, "UseOnlyCard")) PvrSetup.UseOnlyCard = atoi(Value);
+ else if (!strcasecmp(Name, "SliceVBI")) PvrSetup.SliceVBI = atoi(Value);
+ else if (!strcasecmp(Name, "TunerAudioMode")) PvrSetup.TunerAudioMode = atoi(Value);
+ else if (!strcasecmp(Name, "Brightness")) PvrSetup.Brightness.value = atoi(Value);
+ else if (!strcasecmp(Name, "Contrast")) PvrSetup.Contrast.value = atoi(Value);
+ else if (!strcasecmp(Name, "Saturation")) PvrSetup.Saturation.value = atoi(Value);
+ else if (!strcasecmp(Name, "Hue")) PvrSetup.Hue.value = atoi(Value);
+ else if (!strcasecmp(Name, "AudioVolumeTVCommon")) PvrSetup.AudioVolumeTVCommon.value = atoi(Value);
+ else if (!strcasecmp(Name, "AudioVolumeTVException")) PvrSetup.AudioVolumeTVException.value = atoi(Value);
+ else if (!strcasecmp(Name, "AudioVolumeTVExceptionCard")) PvrSetup.AudioVolumeTVExceptionCard = atoi(Value);
+ else if (!strcasecmp(Name, "AudioVolumeFM")) PvrSetup.AudioVolumeFM.value = atoi(Value);
+ else if (!strcasecmp(Name, "AudioSampling")) PvrSetup.AudioSampling.value = atoi(Value);
+ else if (!strcasecmp(Name, "VideoBitrateTV")) PvrSetup.VideoBitrateTV.value = atoi(Value) * 1000;
+ else if (!strcasecmp(Name, "AudioBitrate")) PvrSetup.AudioBitrate.value = atoi(Value);
+ else if (!strcasecmp(Name, "BitrateMode")) PvrSetup.BitrateMode.value = atoi(Value);
+ else if (!strcasecmp(Name, "AspectRatio")) PvrSetup.AspectRatio.value = atoi(Value);
+ else if (!strcasecmp(Name, "StreamType")) PvrSetup.StreamType.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterSpatialMode")) PvrSetup.FilterSpatialMode.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterSpatial")) PvrSetup.FilterSpatial.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterLumaSpatialType")) PvrSetup.FilterLumaSpatialType.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterChromaSpatialType")) PvrSetup.FilterChromaSpatialType.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterTemporalMode")) PvrSetup.FilterTemporalMode.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterTemporal")) PvrSetup.FilterTemporal.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterMedianType")) PvrSetup.FilterMedianType.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterLumaMedianBottom")) PvrSetup.FilterLumaMedianBottom.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterLumaMedianTop")) PvrSetup.FilterLumaMedianTop.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterChromaMedianBottom")) PvrSetup.FilterChromaMedianBottom.value = atoi(Value);
+ else if (!strcasecmp(Name, "FilterChromaMedianTop")) PvrSetup.FilterChromaMedianTop.value = atoi(Value);
+ else if (!strcasecmp(Name, "HideMainMenuEntry")) PvrSetup.HideMainMenuEntry = atoi(Value);
+ else if (!strcasecmp(Name, "TsBufferSizeMB")) PvrSetup.TsBufferSizeMB = atoi(Value);
+ else if (!strcasecmp(Name, "TsBufferPrefillRatio")) PvrSetup.TsBufferPrefillRatio = atoi(Value);
+ else if (!strcasecmp(Name, "UseExternChannelSwitchScript")) PvrSetup.UseExternChannelSwitchScript = atoi(Value);
+ else if (!strcasecmp(Name, "HDPVR_AudioEncoding")) PvrSetup.HDPVR_AudioEncoding.value = atoi(Value) + 3;
+ else if (!strcasecmp(Name, "HDPVR_AudioInput")) PvrSetup.HDPVR_AudioInput = atoi(Value);
+ else
+ return false;
+ return true;
+}
+
+VDRPLUGINCREATOR(cPluginPvrInput); // Don't touch this!