summaryrefslogtreecommitdiff
path: root/pvrinput.c
diff options
context:
space:
mode:
Diffstat (limited to 'pvrinput.c')
-rw-r--r--pvrinput.c135
1 files changed, 73 insertions, 62 deletions
diff --git a/pvrinput.c b/pvrinput.c
index be56ebc..127fc6a 100644
--- a/pvrinput.c
+++ b/pvrinput.c
@@ -11,40 +11,48 @@ static const char *DESCRIPTION = tr("use Hauppauge PVR as input device");
static const char *MAINMENUENTRY = tr("PVR picture settings");
-cPluginPvrInput * PluginPvrInput;
+cPluginPvrInput *PluginPvrInput;
-cPluginPvrInput::cPluginPvrInput(void) {
+cPluginPvrInput::cPluginPvrInput(void)
+{
PluginPvrInput = this;
}
-cPluginPvrInput::~cPluginPvrInput() {
+cPluginPvrInput::~cPluginPvrInput()
+{
PluginPvrInput = NULL;
}
-const char * cPluginPvrInput::Version(void) {
+const char *cPluginPvrInput::Version(void)
+{
return VERSION;
}
-const char * cPluginPvrInput::Description(void) {
+const char *cPluginPvrInput::Description(void)
+{
return tr(DESCRIPTION);
}
-const char * cPluginPvrInput::CommandLineHelp(void) {
+const char *cPluginPvrInput::CommandLineHelp(void)
+{
return NULL;
}
-bool cPluginPvrInput::ProcessArgs(int argc, char * argv[]) {
+bool cPluginPvrInput::ProcessArgs(int argc, char *argv[])
+{
return true;
}
-bool cPluginPvrInput::Initialize(void) {
+bool cPluginPvrInput::Initialize(void)
+{
#if VDRVERSNUM < 10507
RegisterI18n(pvrinput_Phrases);
#endif //VDRVERSNUM < 10507
return true;
}
-bool cPluginPvrInput::Start(void) {
+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(). */
@@ -52,80 +60,83 @@ bool cPluginPvrInput::Start(void) {
return true;
}
-void cPluginPvrInput::Stop(void) {
+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) {
+void cPluginPvrInput::Housekeeping(void)
+{
}
-const char * cPluginPvrInput::MainMenuEntry(void) {
+const char *cPluginPvrInput::MainMenuEntry(void)
+{
if (PvrSetup.HideMainMenuEntry)
return NULL;
- else
- return tr(MAINMENUENTRY);
+ return tr(MAINMENUENTRY);
}
-
-cOsdObject * cPluginPvrInput::MainMenuAction(void) {
- cChannel * channel = Channels.GetByNumber(cDevice::CurrentChannel());
- if (channel
+cOsdObject *cPluginPvrInput::MainMenuAction(void)
+{
+ cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
#if VDRVERSNUM < 10713
- && channel->IsPlug()
+ if (channel && channel->IsPlug())
+ return new cPvrMenuMain();
#else
- && (channel->Source() == 'V')
+ // TODO: rework cPvrSourceParams for use with older vdr
+ if (channel && ((channel->Source() >> 24) == 'V'))
+ return new cPvrMenuMain();
#endif
- )
- return new cPvrMenuMain();
Skins.Message(mtError, tr("Setup.pvrinput$Not on an analogue channel!"), 2);
return NULL;
}
-cMenuSetupPage * cPluginPvrInput::SetupMenu(void) {
+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, "ExternChannelSwitchSleep")) PvrSetup.ExternChannelSwitchSleep = 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;
+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, "ExternChannelSwitchSleep")) PvrSetup.ExternChannelSwitchSleep = 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;
}