diff options
author | Thomas Reufer <thomas@reufer.ch> | 2015-03-15 09:09:53 +0100 |
---|---|---|
committer | Thomas Reufer <thomas@reufer.ch> | 2015-03-15 09:09:53 +0100 |
commit | 0aaa2e239b824c6078700970f42510f23199f52d (patch) | |
tree | 34cb07fe896955dcda390e1a2f120502554e5de7 | |
parent | 3ba1e43de83c264622e34fe01fbd7c6b24651d21 (diff) | |
download | vdr-plugin-rpihddevice-0aaa2e239b824c6078700970f42510f23199f52d.tar.gz vdr-plugin-rpihddevice-0aaa2e239b824c6078700970f42510f23199f52d.tar.bz2 |
combined digital audio format options to one single setup option
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | audio.c | 3 | ||||
-rw-r--r-- | po/de_DE.po | 24 | ||||
-rw-r--r-- | po/fi_FI.po | 24 | ||||
-rw-r--r-- | po/hu_HU.po | 24 | ||||
-rw-r--r-- | setup.c | 84 | ||||
-rw-r--r-- | setup.h | 19 | ||||
-rw-r--r-- | tools.h | 17 |
8 files changed, 121 insertions, 75 deletions
@@ -2,6 +2,7 @@ VDR Plugin 'rpihddevice' Revision History ----------------------------------------- - new: + - combined digital audio format options to one single setup option - added font kerning - support for GPU accelerated pixmaps - fixed: @@ -1007,8 +1007,7 @@ public: newPort = cRpiAudioPort::eHDMI; // check if pass through is possible - if (cRpiSetup::IsAudioPassthrough() && - cRpiSetup::IsAudioFormatSupported(codec, channels, + if (cRpiSetup::IsAudioFormatSupported(codec, channels, samplingRate)) newCodec = codec; diff --git a/po/de_DE.po b/po/de_DE.po index 6ea219f..bb2c49d 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-rpihddevice 0.0.4\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-11-08 11:42+0100\n" +"POT-Creation-Date: 2015-03-14 19:22+0100\n" "PO-Revision-Date: 2013-10-14 13:36+0200\n" "Last-Translator: <thomas@reufer.ch>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n" @@ -29,6 +29,15 @@ msgstr "analog" msgid "HDMI" msgstr "HDMI" +msgid "pass through" +msgstr "Pass-Through" + +msgid "multi channel PCM" +msgstr "Mehrkanal-PCM" + +msgid "stereo PCM" +msgstr "Stereo-PCM" + msgid "box" msgstr "einrahmen" @@ -56,11 +65,14 @@ msgstr "Seitenverhältnis-Anpassung" msgid "Audio Port" msgstr "Audioanschluss" -msgid "Digital Audio Pass-Through" -msgstr "Digitalton durchreichen" - -msgid "Ignore Audio EDID" -msgstr "Audio EDID ignorieren" +msgid "Digital Audio Format" +msgstr "Digitales Audioformat" msgid "Use GPU accelerated OSD" msgstr "OSD mit GPU-Unterstützung" + +#~ msgid "Digital Audio Pass-Through" +#~ msgstr "Digitalton durchreichen" + +#~ msgid "Ignore Audio EDID" +#~ msgstr "Audio EDID ignorieren" diff --git a/po/fi_FI.po b/po/fi_FI.po index 7fd4e39..834946d 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-rpihddevice 0.0.8\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-10-06 12:59+0200\n" +"POT-Creation-Date: 2015-03-14 19:22+0100\n" "PO-Revision-Date: 2014-03-22 03:22+0200\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: Finnish <vdr@linuxtv.org>\n" @@ -28,6 +28,15 @@ msgstr "analoginen" msgid "HDMI" msgstr "HDMI" +msgid "pass through" +msgstr "" + +msgid "multi channel PCM" +msgstr "" + +msgid "stereo PCM" +msgstr "" + msgid "box" msgstr "kehystys" @@ -55,11 +64,14 @@ msgstr "Kuvan rajaustapa" msgid "Audio Port" msgstr "Äänilähtö" -msgid "Digital Audio Pass-Through" -msgstr "Digitaaliäänen läpivienti" - -msgid "Ignore Audio EDID" -msgstr "Jätä äänen EDID huomioimatta" +msgid "Digital Audio Format" +msgstr "" msgid "Use GPU accelerated OSD" msgstr "Käytä GPU-kiihdytettyä OSD:tä" + +#~ msgid "Digital Audio Pass-Through" +#~ msgstr "Digitaaliäänen läpivienti" + +#~ msgid "Ignore Audio EDID" +#~ msgstr "Jätä äänen EDID huomioimatta" diff --git a/po/hu_HU.po b/po/hu_HU.po index 78b8134..d40c9ee 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-rpihddevice 0.0.4\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2015-02-27 07:13+0100\n" +"POT-Creation-Date: 2015-03-14 19:22+0100\n" "PO-Revision-Date: 2014-12-03 12:18+0200\n" "Last-Translator: Füley István <ifuley at tigercomp dot ro>\n" "Language-Team: \n" @@ -29,6 +29,15 @@ msgstr "analog" msgid "HDMI" msgstr "HDMI" +msgid "pass through" +msgstr "" + +msgid "multi channel PCM" +msgstr "" + +msgid "stereo PCM" +msgstr "" + msgid "box" msgstr "keretben" @@ -56,11 +65,14 @@ msgstr "Video képarány" msgid "Audio Port" msgstr "Hang kimenet" -msgid "Digital Audio Pass-Through" -msgstr "Digitális hang átjátszás" - -msgid "Ignore Audio EDID" -msgstr "Audio EDID figyelmen kivül hagyása" +msgid "Digital Audio Format" +msgstr "" msgid "Use GPU accelerated OSD" msgstr "Hardveresen (GPU) gyorsított OSD" + +#~ msgid "Digital Audio Pass-Through" +#~ msgstr "Digitális hang átjátszás" + +#~ msgid "Ignore Audio EDID" +#~ msgstr "Audio EDID figyelmen kivül hagyása" @@ -31,8 +31,12 @@ public: m_video(video), m_osd(osd) { - m_audioport[0] = tr("analog"); - m_audioport[1] = tr("HDMI"); + m_audioPort[0] = tr("analog"); + m_audioPort[1] = tr("HDMI"); + + m_audioFormat[0] = tr("pass through"); + m_audioFormat[1] = tr("multi channel PCM"); + m_audioFormat[2] = tr("stereo PCM"); m_videoFraming[0] = tr("box"); m_videoFraming[1] = tr("crop"); @@ -61,14 +65,11 @@ public: eOSState ProcessKey(eKeys Key) { int newAudioPort = m_audio.port; - int newPassthrough = m_audio.passthrough; - eOSState state = cMenuSetupPage::ProcessKey(Key); if (Key != kNone) { - if ((newAudioPort != m_audio.port) || - (newPassthrough != m_audio.passthrough)) + if (newAudioPort != m_audio.port) Setup(); } @@ -80,8 +81,7 @@ protected: virtual void Store(void) { SetupStore("AudioPort", m_audio.port); - SetupStore("PassThrough", m_audio.passthrough); - SetupStore("IgnoreAudioEDID", m_audio.ignoreEDID); + SetupStore("AudioFormat", m_audio.format); SetupStore("VideoFraming", m_video.framing); SetupStore("Resolution", m_video.resolution); @@ -112,16 +112,12 @@ private: tr("Video Framing"), &m_video.framing, 3, m_videoFraming)); Add(new cMenuEditStraItem( - tr("Audio Port"), &m_audio.port, 2, m_audioport)); + tr("Audio Port"), &m_audio.port, 2, m_audioPort)); if (m_audio.port == 1) { - Add(new cMenuEditBoolItem( - tr("Digital Audio Pass-Through"), &m_audio.passthrough)); - - if (m_audio.passthrough) - Add(new cMenuEditBoolItem( - tr("Ignore Audio EDID"), &m_audio.ignoreEDID)); + Add(new cMenuEditStraItem(tr("Digital Audio Format"), + &m_audio.format, 3, m_audioFormat)); } Add(new cMenuEditBoolItem( @@ -135,7 +131,8 @@ private: cRpiSetup::VideoParameters m_video; cRpiSetup::OsdParameters m_osd; - const char *m_audioport[2]; + const char *m_audioPort[2]; + const char *m_audioFormat[3]; const char *m_videoFraming[3]; const char *m_videoResolution[6]; const char *m_videoFrameRate[9]; @@ -211,30 +208,31 @@ bool cRpiSetup::IsAudioFormatSupported(cAudioCodec::eCodec codec, if (codec == cAudioCodec::eMPG || codec == cAudioCodec::eAAC) return false; - if (GetInstance()->m_audio.ignoreEDID) - return true; - - if (vc_tv_hdmi_audio_supported( - codec == cAudioCodec::eMPG ? EDID_AudioFormat_eMPEG1 : - codec == cAudioCodec::eAC3 ? EDID_AudioFormat_eAC3 : - codec == cAudioCodec::eEAC3 ? EDID_AudioFormat_eEAC3 : - codec == cAudioCodec::eAAC ? EDID_AudioFormat_eAAC : - EDID_AudioFormat_ePCM, channels, - samplingRate == 32000 ? EDID_AudioSampleRate_e32KHz : - samplingRate == 44100 ? EDID_AudioSampleRate_e44KHz : - samplingRate == 88200 ? EDID_AudioSampleRate_e88KHz : - samplingRate == 96000 ? EDID_AudioSampleRate_e96KHz : - samplingRate == 176000 ? EDID_AudioSampleRate_e176KHz : - samplingRate == 192000 ? EDID_AudioSampleRate_e192KHz : - EDID_AudioSampleRate_e48KHz, - EDID_AudioSampleSize_16bit) == 0) - return true; - - DLOG("%dch %s, %d.%dkHz not supported by HDMI device", - channels, cAudioCodec::Str(codec), - samplingRate / 1000, (samplingRate % 1000) / 100); - - return false; + switch (GetAudioFormat()) + { + case cAudioFormat::ePassThrough: + return (vc_tv_hdmi_audio_supported( + codec == cAudioCodec::eMPG ? EDID_AudioFormat_eMPEG1 : + codec == cAudioCodec::eAC3 ? EDID_AudioFormat_eAC3 : + codec == cAudioCodec::eEAC3 ? EDID_AudioFormat_eEAC3 : + codec == cAudioCodec::eAAC ? EDID_AudioFormat_eAAC : + EDID_AudioFormat_ePCM, channels, + samplingRate == 32000 ? EDID_AudioSampleRate_e32KHz : + samplingRate == 44100 ? EDID_AudioSampleRate_e44KHz : + samplingRate == 88200 ? EDID_AudioSampleRate_e88KHz : + samplingRate == 96000 ? EDID_AudioSampleRate_e96KHz : + samplingRate == 176000 ? EDID_AudioSampleRate_e176KHz : + samplingRate == 192000 ? EDID_AudioSampleRate_e192KHz : + EDID_AudioSampleRate_e48KHz, + EDID_AudioSampleSize_16bit) == 0); + + case cAudioFormat::eMultiChannelPCM: + return codec == cAudioCodec::ePCM; + + default: + case cAudioFormat::eStereoPCM: + return codec == cAudioCodec::ePCM && channels == 2; + } } void cRpiSetup::SetHDMIChannelMapping(bool passthrough, int channels) @@ -289,10 +287,8 @@ bool cRpiSetup::Parse(const char *name, const char *value) { if (!strcasecmp(name, "AudioPort")) m_audio.port = atoi(value); - else if (!strcasecmp(name, "PassThrough")) - m_audio.passthrough = atoi(value); - else if (!strcasecmp(name, "IgnoreAudioEDID")) - m_audio.ignoreEDID = atoi(value); + else if (!strcasecmp(name, "AudioFormat")) + m_audio.format = atoi(value); else if (!strcasecmp(name, "VideoFraming")) m_video.framing = atoi(value); else if (!strcasecmp(name, "Resolution")) @@ -19,16 +19,13 @@ public: { AudioParameters() : port(0), - passthrough(0), - ignoreEDID(0) { } + format(0) { } int port; - int passthrough; - int ignoreEDID; + int format; bool operator!=(const AudioParameters& a) { - return (a.port != port) || (a.passthrough != passthrough) || - (a.ignoreEDID != ignoreEDID); + return (a.port != port) || (a.format != format); } }; @@ -67,11 +64,11 @@ public: return (GetInstance()->m_audio.port) ? cRpiAudioPort::eHDMI : cRpiAudioPort::eLocal; } - static bool IsAudioPassthrough(void) { - return GetInstance()->m_audio.passthrough; } - - static bool IgnoreAudioEDID(void) { - return GetInstance()->m_audio.ignoreEDID; } + static cAudioFormat::eFormat GetAudioFormat(void) { + return GetInstance()->m_audio.format == 0 ? cAudioFormat::ePassThrough : + GetInstance()->m_audio.format == 1 ? cAudioFormat::eMultiChannelPCM : + cAudioFormat::eStereoPCM; + } static cVideoFraming::eFraming GetVideoFraming(void) { return GetInstance()->m_video.framing == 0 ? cVideoFraming::eFrame : @@ -111,6 +111,23 @@ public: } }; +class cAudioFormat +{ +public: + + enum eFormat { + ePassThrough, + eMultiChannelPCM, + eStereoPCM + }; + + static const char* Str(eFormat format) { + return (format == ePassThrough) ? "pass through" : + (format == eMultiChannelPCM) ? "multi channel PCM" : + (format == eStereoPCM) ? "stereo PCM" : "unknown"; + } +}; + class cVideoCodec { public: |