diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 2a3c235db..006a529b7 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -233,10 +234,13 @@ void CInfoViewerBB::getBBButtonInfo() text = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN]; if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD)) text = ""; - if (!g_RemoteControl->current_PIDs.APIDs.empty()) { + if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode() && !CMoviePlayerGui::getInstance().timeshift){ + text = CMoviePlayerGui::getInstance().CurrentAudioName(); + }else if (!g_RemoteControl->current_PIDs.APIDs.empty()) { int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid; - if (text.empty()) + if (text.empty()){ text = g_RemoteControl->current_PIDs.APIDs[selected].desc; + } } break; case CInfoViewerBB::BUTTON_SUBS: @@ -711,10 +715,9 @@ void CInfoViewerBB::paint_ca_icons(int caid, char * icon, int &icon_space_offset void CInfoViewerBB::showIcon_CA_Status(int notfirst) { - if (g_settings.casystem_display == 3) return; - if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()){ + if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode() && !CMoviePlayerGui::getInstance().timeshift){ if (g_settings.casystem_display == 2) { fta = true; showOne_CAIcon(); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d2b299c5b..52d40ac9a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -697,6 +697,9 @@ void CMoviePlayerGui::callInfoViewer(const int duration, const int curr_pos) CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID()); return; } + currentaudioname = "Unk"; + getCurrentAudioName( is_file_player, currentaudioname); + if (isMovieBrowser && p_movie_info) { g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1, duration, curr_pos); @@ -721,6 +724,68 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) return false; } +void CMoviePlayerGui::addAudioFormat(int count, std::string &apidtitle, bool file_player, bool& enabled) +{ + switch(ac3flags[count]) + { + case 1: /*AC3,EAC3*/ + if (apidtitle.find("AC3") == std::string::npos || file_player) + apidtitle.append(" (AC3)"); + break; + case 2: /*teletext*/ + apidtitle.append(" (Teletext)"); + enabled = false; + break; + case 3: /*MP2*/ + apidtitle.append("( MP2)"); + break; + case 4: /*MP3*/ + apidtitle.append(" (MP3)"); + break; + case 5: /*AAC*/ + apidtitle.append(" (AAC)"); + break; + case 6: /*DTS*/ + apidtitle.append(" (DTS)"); + enabled = false; + break; + case 7: /*MLP*/ + apidtitle.append(" (MLP)"); + break; + default: + break; + } +} + +void CMoviePlayerGui::getCurrentAudioName( bool file_player, std::string &audioname) +{ + if(file_player && !numpida){ + playback->FindAllPids(apids, ac3flags, &numpida, language); + /* fix current pid in case of file play */ + if(numpida) + currentapid = apids[0]; + } + bool dumm = true; + for (unsigned int count = 0; count < numpida; count++) { + + if(currentapid == apids[count]){ + if(!file_player){ + getAudioName(apids[count], audioname); + return ; + }else if (!language[count].empty()){ + audioname = language[count]; + addAudioFormat(count, audioname, file_player, dumm); + return ; + } + char apidnumber[20]; + sprintf(apidnumber, "Stream %d %X", count + 1, apids[count]); + audioname = apidnumber; + addAudioFormat(count, audioname, file_player, dumm); + return ; + } + } +} + void CMoviePlayerGui::selectAudioPid(bool file_player) { CMenuWidget APIDSelector(LOCALE_APIDSELECTOR_HEAD, NEUTRINO_ICON_AUDIO); @@ -753,36 +818,8 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) sprintf(apidnumber, "Stream %d %X", count + 1, apids[count]); apidtitle = apidnumber; } + addAudioFormat(count, apidtitle, file_player, enabled); - switch(ac3flags[count]) - { - case 1: /*AC3,EAC3*/ - if (apidtitle.find("AC3") == std::string::npos || file_player) - apidtitle.append(" (AC3)"); - break; - case 2: /*teletext*/ - apidtitle.append(" (Teletext)"); - enabled = false; - break; - case 3: /*MP2*/ - apidtitle.append("( MP2)"); - break; - case 4: /*MP3*/ - apidtitle.append(" (MP3)"); - break; - case 5: /*AAC*/ - apidtitle.append(" (AAC)"); - break; - case 6: /*DTS*/ - apidtitle.append(" (DTS)"); - enabled = false; - break; - case 7: /*MLP*/ - apidtitle.append(" (MLP)"); - break; - default: - break; - } char cnt[5]; sprintf(cnt, "%d", count); CMenuForwarderNonLocalized * item = new CMenuForwarderNonLocalized(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1)); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 1ede8b215..31125f1a1 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -69,7 +69,7 @@ class CMoviePlayerGui : public CMenuTarget std::string full_name; std::string file_name; - + std::string currentaudioname; bool playing; CMoviePlayerGui::state playstate; int speed; @@ -112,6 +112,8 @@ class CMoviePlayerGui : public CMenuTarget void fillPids(); bool getAudioName(int pid, std::string &apidtitle); void selectAudioPid(bool file_player); + void getCurrentAudioName( bool file_player, std::string &audioname); + void addAudioFormat(int count, std::string &apidtitle, bool file_player, bool& enabled ); void handleMovieBrowser(neutrino_msg_t msg, int position = 0); bool SelectFile(); @@ -127,6 +129,7 @@ class CMoviePlayerGui : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); bool Playing() { return playing; }; + std::string CurrentAudioName() { return currentaudioname; }; int timeshift; int file_prozent; };