movieplayer: show current AudioName in infoviewer

Origin commit data
------------------
Commit: 3fd2a73d77
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-10-17 (Wed, 17 Oct 2012)
This commit is contained in:
Jacek Jendrzej
2012-10-17 21:39:44 +02:00
parent 4def9db10d
commit 705eb9e33a
3 changed files with 77 additions and 34 deletions

View File

@@ -55,6 +55,7 @@
#include <gui/widget/hintbox.h>
#include <gui/customcolor.h>
#include <gui/pictureviewer.h>
#include <gui/movieplayer.h>
#include <system/helpers.h>
#include <daemonc/remotecontrol.h>
@@ -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();

View File

@@ -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));

View File

@@ -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;
};