mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
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:
@@ -55,6 +55,7 @@
|
|||||||
#include <gui/widget/hintbox.h>
|
#include <gui/widget/hintbox.h>
|
||||||
#include <gui/customcolor.h>
|
#include <gui/customcolor.h>
|
||||||
#include <gui/pictureviewer.h>
|
#include <gui/pictureviewer.h>
|
||||||
|
#include <gui/movieplayer.h>
|
||||||
#include <system/helpers.h>
|
#include <system/helpers.h>
|
||||||
#include <daemonc/remotecontrol.h>
|
#include <daemonc/remotecontrol.h>
|
||||||
|
|
||||||
@@ -233,11 +234,14 @@ void CInfoViewerBB::getBBButtonInfo()
|
|||||||
text = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN];
|
text = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN];
|
||||||
if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD))
|
if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD))
|
||||||
text = "";
|
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;
|
int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid;
|
||||||
if (text.empty())
|
if (text.empty()){
|
||||||
text = g_RemoteControl->current_PIDs.APIDs[selected].desc;
|
text = g_RemoteControl->current_PIDs.APIDs[selected].desc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CInfoViewerBB::BUTTON_SUBS:
|
case CInfoViewerBB::BUTTON_SUBS:
|
||||||
icon = NEUTRINO_ICON_BUTTON_YELLOW;
|
icon = NEUTRINO_ICON_BUTTON_YELLOW;
|
||||||
@@ -711,10 +715,9 @@ void CInfoViewerBB::paint_ca_icons(int caid, char * icon, int &icon_space_offset
|
|||||||
|
|
||||||
void CInfoViewerBB::showIcon_CA_Status(int notfirst)
|
void CInfoViewerBB::showIcon_CA_Status(int notfirst)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (g_settings.casystem_display == 3)
|
if (g_settings.casystem_display == 3)
|
||||||
return;
|
return;
|
||||||
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()){
|
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode() && !CMoviePlayerGui::getInstance().timeshift){
|
||||||
if (g_settings.casystem_display == 2) {
|
if (g_settings.casystem_display == 2) {
|
||||||
fta = true;
|
fta = true;
|
||||||
showOne_CAIcon();
|
showOne_CAIcon();
|
||||||
|
@@ -697,6 +697,9 @@ void CMoviePlayerGui::callInfoViewer(const int duration, const int curr_pos)
|
|||||||
CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID());
|
CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
currentaudioname = "Unk";
|
||||||
|
getCurrentAudioName( is_file_player, currentaudioname);
|
||||||
|
|
||||||
if (isMovieBrowser && p_movie_info) {
|
if (isMovieBrowser && p_movie_info) {
|
||||||
g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1,
|
g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1,
|
||||||
duration, curr_pos);
|
duration, curr_pos);
|
||||||
@@ -721,6 +724,68 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle)
|
|||||||
return false;
|
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)
|
void CMoviePlayerGui::selectAudioPid(bool file_player)
|
||||||
{
|
{
|
||||||
CMenuWidget APIDSelector(LOCALE_APIDSELECTOR_HEAD, NEUTRINO_ICON_AUDIO);
|
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]);
|
sprintf(apidnumber, "Stream %d %X", count + 1, apids[count]);
|
||||||
apidtitle = apidnumber;
|
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];
|
char cnt[5];
|
||||||
sprintf(cnt, "%d", count);
|
sprintf(cnt, "%d", count);
|
||||||
CMenuForwarderNonLocalized * item = new CMenuForwarderNonLocalized(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1));
|
CMenuForwarderNonLocalized * item = new CMenuForwarderNonLocalized(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1));
|
||||||
|
@@ -69,7 +69,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
|
|
||||||
std::string full_name;
|
std::string full_name;
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
|
std::string currentaudioname;
|
||||||
bool playing;
|
bool playing;
|
||||||
CMoviePlayerGui::state playstate;
|
CMoviePlayerGui::state playstate;
|
||||||
int speed;
|
int speed;
|
||||||
@@ -112,6 +112,8 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
void fillPids();
|
void fillPids();
|
||||||
bool getAudioName(int pid, std::string &apidtitle);
|
bool getAudioName(int pid, std::string &apidtitle);
|
||||||
void selectAudioPid(bool file_player);
|
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);
|
void handleMovieBrowser(neutrino_msg_t msg, int position = 0);
|
||||||
bool SelectFile();
|
bool SelectFile();
|
||||||
@@ -127,6 +129,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
|
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
bool Playing() { return playing; };
|
bool Playing() { return playing; };
|
||||||
|
std::string CurrentAudioName() { return currentaudioname; };
|
||||||
int timeshift;
|
int timeshift;
|
||||||
int file_prozent;
|
int file_prozent;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user