From 166d4988c26cc6a83841aba7fe725567c96976c1 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Wed, 22 Oct 2014 17:41:57 +0800 Subject: [PATCH] streaminfo: since new libcs return AUDIO_FORMAT as Type in getAudioInfo() update the code and add AAC information while at it. We set audio stream to unknown if we don't know what codec is in use. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2af0d0c4ee26d892fb6e1434e91d1197aab5dcf3 Author: [CST] Bas Date: 2014-10-22 (Wed, 22 Oct 2014) --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + data/locale/nederlands.locale | 1 + src/gui/streaminfo2.cpp | 27 ++++++++++++++++++++++++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index af00b2fe9..73c86ec60 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2062,6 +2062,7 @@ sleeptimerbox.title2 Inaktivitätstimer streaminfo.aratio Verhältnis streaminfo.aratio_unknown unbekannt streaminfo.audiotype Audiotyp +streaminfo.audiotype_unknown unbekannt streaminfo.average_bitrate Durchschnitt streaminfo.bitrate Bitrate streaminfo.framerate Bildrate diff --git a/data/locale/english.locale b/data/locale/english.locale index eea5b0497..15d51a031 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2062,6 +2062,7 @@ sleeptimerbox.title2 Inactivity shutdown timer streaminfo.aratio Aspect Ratio streaminfo.aratio_unknown unknown streaminfo.audiotype Audiotype +streaminfo.audiotype_unknown unknown streaminfo.average_bitrate Average streaminfo.bitrate Bitrate streaminfo.framerate Framerate diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 32bbc3f5f..aed16a96a 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -1735,6 +1735,7 @@ sleeptimerbox.title2 Inactiviteit uitschakel timer streaminfo.aratio Aspect Ratio streaminfo.aratio_unknown Onbekend streaminfo.audiotype Audiotype +streaminfo.audiotype_unknown onbekend streaminfo.bitrate Bitrate streaminfo.framerate Framerate streaminfo.framerate_unknown Framerate: onbekend diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 2d0f3645e..fe2be30e1 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -554,12 +554,33 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); - if(type == 0) { + if(type == AUDIO_FMT_MPEG) { const char *mpegmodes[4] = { "stereo", "joint_st", "dual_ch", "single_ch" }; sprintf (buf, "MPEG %s (%d)", mpegmodes[mode], freq); - } else { + } else if (type == AUDIO_FMT_DOLBY_DIGITAL || type == AUDIO_FMT_DD_PLUS) { const char *ddmodes[8] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" }; - sprintf (buf, "DD %s (%d)", ddmodes[mode], freq); + sprintf (buf, "%s %s (%d)", + (type == AUDIO_FMT_DOLBY_DIGITAL) ? "DD" : "DD+", + ddmodes[mode], + freq); + } else if (type == AUDIO_FMT_AAC || type == AUDIO_FMT_AAC_PLUS) { + const char *aacmodes[10] = { + "N/S", + "Mono", + "L/R", + "L/C/R", + "L/C/R/SR/SL", + "L/C/R/SR/SL/S", + "L/R/RL/RR", + "L/C/R/S", + "L/R/SL/SR", + "Dual-Mono" + }; + sprintf (buf, "%s %s (%d)", + (type == AUDIO_FMT_AAC) ? "AAC" : "AAC+", + aacmodes[mode], freq); + } else { + sprintf (buf, "%s (%d)", g_Locale->getText(LOCALE_STREAMINFO_AUDIOTYPE_UNKNOWN), freq); } g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); diff --git a/src/system/locals.h b/src/system/locals.h index aacf0ef60..6c765e752 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2089,6 +2089,7 @@ typedef enum LOCALE_STREAMINFO_ARATIO, LOCALE_STREAMINFO_ARATIO_UNKNOWN, LOCALE_STREAMINFO_AUDIOTYPE, + LOCALE_STREAMINFO_AUDIOTYPE_UNKNOWN, LOCALE_STREAMINFO_AVERAGE_BITRATE, LOCALE_STREAMINFO_BITRATE, LOCALE_STREAMINFO_FRAMERATE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 91daea5ce..92a3945db 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2089,6 +2089,7 @@ const char * locale_real_names[] = "streaminfo.aratio", "streaminfo.aratio_unknown", "streaminfo.audiotype", + "streaminfo.audiotype_unknown", "streaminfo.average_bitrate", "streaminfo.bitrate", "streaminfo.framerate",