mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
audio_select: copy full code from TangoCash
Just compile tested. Maybe some more alignments needed.
Signed-off-by: Thilo Graf <dbt@novatux.de>
Additional changes on cs playback_cs.h, because broken build
Signed-off-by: Thilo Graf <dbt@novatux.de>
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5fd7ec68ac
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-10-12 (Thu, 12 Oct 2017)
Origin message was:
------------------
- audio_select: copy full code from TangoCash
Just compile tested. Maybe some more alignments needed.
Signed-off-by: Thilo Graf <dbt@novatux.de>
Additional changes on cs playback_cs.h, because broken build
Signed-off-by: Thilo Graf <dbt@novatux.de>
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
AUDIOSelectMenue.head Tonoptionen
|
AUDIOSelectMenue.head Tonoptionen
|
||||||
|
AUDIOSelectMenue.volume Tonspur und Lautstärkeanpassung
|
||||||
EPGMenu.epgplus EPG-Zeitlinen (EPG-Plus)
|
EPGMenu.epgplus EPG-Zeitlinen (EPG-Plus)
|
||||||
EPGMenu.eventinfo Info zur Sendung
|
EPGMenu.eventinfo Info zur Sendung
|
||||||
EPGMenu.eventlist Vorschau aktuelles Programm
|
EPGMenu.eventlist Vorschau aktuelles Programm
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
AUDIOSelectMenue.head Audio Options
|
AUDIOSelectMenue.head Audio Options
|
||||||
|
AUDIOSelectMenue.volume Audio selection and volume adjustment
|
||||||
EPGMenu.epgplus EPG-Timelines (EPG-Plus)
|
EPGMenu.epgplus EPG-Timelines (EPG-Plus)
|
||||||
EPGMenu.eventinfo Details current program
|
EPGMenu.eventinfo Details current program
|
||||||
EPGMenu.eventlist Eventlist current programm
|
EPGMenu.eventlist Eventlist current programm
|
||||||
|
@@ -57,6 +57,7 @@ public:
|
|||||||
bool Start(std::string filename, std::string headers = "");
|
bool Start(std::string filename, std::string headers = "");
|
||||||
bool Stop(void);
|
bool Stop(void);
|
||||||
bool SetAPid(unsigned short pid, int audio_flag);
|
bool SetAPid(unsigned short pid, int audio_flag);
|
||||||
|
bool SetSubtitlePid(int /*pid*/){return true;}
|
||||||
bool SetSpeed(int speed);
|
bool SetSpeed(int speed);
|
||||||
bool GetSpeed(int &speed) const;
|
bool GetSpeed(int &speed) const;
|
||||||
bool GetPosition(int &position, int &duration);
|
bool GetPosition(int &position, int &duration);
|
||||||
|
@@ -58,6 +58,7 @@ public:
|
|||||||
bool Start(std::string filename, std::string headers = "");
|
bool Start(std::string filename, std::string headers = "");
|
||||||
bool Stop(void);
|
bool Stop(void);
|
||||||
bool SetAPid(unsigned short pid, int audio_flag);
|
bool SetAPid(unsigned short pid, int audio_flag);
|
||||||
|
bool SetSubtitlePid(int /*pid*/){return true;}
|
||||||
bool SetSpeed(int speed);
|
bool SetSpeed(int speed);
|
||||||
bool GetSpeed(int &speed) const;
|
bool GetSpeed(int &speed) const;
|
||||||
bool GetPosition(int &position, int &duration);
|
bool GetPosition(int &position, int &duration);
|
||||||
|
@@ -40,8 +40,8 @@
|
|||||||
#include <gui/widget/icons.h>
|
#include <gui/widget/icons.h>
|
||||||
#include <gui/widget/menue.h>
|
#include <gui/widget/menue.h>
|
||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
#include <driver/volume.h>
|
|
||||||
#include <zapit/zapit.h>
|
#include <zapit/zapit.h>
|
||||||
|
#include <system/helpers.h>
|
||||||
|
|
||||||
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
||||||
extern CAudioSetupNotifier * audioSetupNotifier;
|
extern CAudioSetupNotifier * audioSetupNotifier;
|
||||||
@@ -58,7 +58,11 @@ extern CAudioSetupNotifier * audioSetupNotifier;
|
|||||||
|
|
||||||
CAudioSelectMenuHandler::CAudioSelectMenuHandler()
|
CAudioSelectMenuHandler::CAudioSelectMenuHandler()
|
||||||
{
|
{
|
||||||
|
AudioSelector = NULL;
|
||||||
width = 40;
|
width = 40;
|
||||||
|
mp = &CMoviePlayerGui::getInstance();
|
||||||
|
if (IS_WEBTV(g_Zapit->getCurrentServiceID()))
|
||||||
|
mp = &CMoviePlayerGui::getInstance(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAudioSelectMenuHandler::~CAudioSelectMenuHandler()
|
CAudioSelectMenuHandler::~CAudioSelectMenuHandler()
|
||||||
@@ -66,6 +70,7 @@ CAudioSelectMenuHandler::~CAudioSelectMenuHandler()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !HAVE_SPARK_HARDWARE && !HAVE_DUCKBOX_HARDWARE
|
||||||
// -- this is a copy from neutrino.cpp!!
|
// -- this is a copy from neutrino.cpp!!
|
||||||
#define AUDIOMENU_ANALOGOUT_OPTION_COUNT 3
|
#define AUDIOMENU_ANALOGOUT_OPTION_COUNT 3
|
||||||
const CMenuOptionChooser::keyval AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT_OPTION_COUNT] =
|
const CMenuOptionChooser::keyval AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT_OPTION_COUNT] =
|
||||||
@@ -74,18 +79,56 @@ const CMenuOptionChooser::keyval AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT
|
|||||||
{ 1, LOCALE_AUDIOMENU_MONOLEFT },
|
{ 1, LOCALE_AUDIOMENU_MONOLEFT },
|
||||||
{ 2, LOCALE_AUDIOMENU_MONORIGHT }
|
{ 2, LOCALE_AUDIOMENU_MONORIGHT }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey)
|
int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey)
|
||||||
{
|
{
|
||||||
int sel= atoi(actionkey.c_str());
|
int sel = -1;
|
||||||
if(sel >= 0) {
|
if (AudioSelector) {
|
||||||
if (g_RemoteControl->current_PIDs.PIDs.selected_apid!= (unsigned int) sel )
|
sel = AudioSelector->getSelected();
|
||||||
{
|
sel -= apid_offset;
|
||||||
|
if (sel < 0 || sel >= p_count)
|
||||||
|
return menu_return::RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actionkey == "-" || actionkey == "+") {
|
||||||
|
if (actionkey == "-") {
|
||||||
|
if (perc_val[sel] == 0)
|
||||||
|
return menu_return::RETURN_NONE;
|
||||||
|
perc_val[sel]--;
|
||||||
|
} else {
|
||||||
|
if (perc_val[sel] == 999)
|
||||||
|
return menu_return::RETURN_NONE;
|
||||||
|
perc_val[sel]++;
|
||||||
|
}
|
||||||
|
perc_str[sel] = to_string(perc_val[sel]) + "%";
|
||||||
|
|
||||||
|
#if !HAVE_SPARK_HARDWARE && !HAVE_DUCKBOX_HARDWARE
|
||||||
|
int vol = CZapit::getInstance()->GetVolume();
|
||||||
|
/* keep resulting volume = (vol * percent)/100 not more than 115 */
|
||||||
|
if (vol * perc_val[sel] > 11500)
|
||||||
|
perc_val[sel] = 11500 / vol;
|
||||||
|
#endif
|
||||||
|
CZapit::getInstance()->SetPidVolume(chan, apid[sel], perc_val[sel]);
|
||||||
|
if (sel == sel_apid)
|
||||||
|
CZapit::getInstance()->SetVolumePercent(perc_val[sel]);
|
||||||
|
|
||||||
|
return menu_return::RETURN_REPAINT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actionkey == "s") {
|
||||||
|
if (mp->Playing()) {
|
||||||
|
mp->setAPID(sel);
|
||||||
|
} else if (g_RemoteControl->current_PIDs.PIDs.selected_apid != (unsigned int) sel ) {
|
||||||
g_RemoteControl->setAPID(sel);
|
g_RemoteControl->setAPID(sel);
|
||||||
}
|
}
|
||||||
return menu_return::RETURN_EXIT;
|
return menu_return::RETURN_EXIT;
|
||||||
}
|
}
|
||||||
|
if (actionkey == "x")
|
||||||
|
return menu_return::RETURN_EXIT;
|
||||||
|
|
||||||
|
if (mp->Playing())
|
||||||
|
playback = mp->getPlayback();
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
@@ -94,37 +137,64 @@ int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &action
|
|||||||
|
|
||||||
int CAudioSelectMenuHandler::doMenu ()
|
int CAudioSelectMenuHandler::doMenu ()
|
||||||
{
|
{
|
||||||
int mode = CNeutrinoApp::getInstance()->getMode();
|
AudioSelector = new CMenuWidget(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width);
|
||||||
if (mode == NeutrinoMessages::mode_webtv) {
|
|
||||||
CMoviePlayerGui::getInstance(true).selectAudioPid();
|
|
||||||
return menu_return::RETURN_EXIT;
|
|
||||||
}
|
|
||||||
CMenuWidget AudioSelector(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width);
|
|
||||||
|
|
||||||
CSubtitleChangeExec SubtitleChanger;
|
CSubtitleChangeExec SubtitleChanger(playback);
|
||||||
|
|
||||||
//show cancel button if configured in usermenu settings
|
//show cancel button if configured in usermenu settings
|
||||||
if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL])
|
if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL])
|
||||||
AudioSelector.addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
|
AudioSelector->addIntroItems(NONEXISTANT_LOCALE, LOCALE_AUDIOSELECTMENUE_VOLUME, CMenuWidget::BTN_TYPE_CANCEL);
|
||||||
else
|
else
|
||||||
AudioSelector.addItem(GenericMenuSeparator);
|
AudioSelector->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOSELECTMENUE_VOLUME));
|
||||||
|
apid_offset = AudioSelector->getItemsCount();
|
||||||
|
AudioSelector->addKey(CRCInput::RC_right, this, "+");
|
||||||
|
AudioSelector->addKey(CRCInput::RC_left, this, "-");
|
||||||
|
AudioSelector->addKey(CRCInput::RC_red, this, "x");
|
||||||
|
#if !HAVE_SPARK_HARDWARE && !HAVE_DUCKBOX_HARDWARE
|
||||||
|
AudioSelector->addKey(CRCInput::RC_green, this, "x");
|
||||||
|
#endif
|
||||||
|
AudioSelector->addKey(CRCInput::RC_yellow, this, "x");
|
||||||
|
AudioSelector->addKey(CRCInput::RC_blue, this, "x");
|
||||||
|
|
||||||
unsigned int shortcut_num = 1;
|
bool is_mp = mp->Playing();
|
||||||
|
|
||||||
|
p_count = is_mp ? mp->getAPIDCount() : g_RemoteControl->current_PIDs.APIDs.size();
|
||||||
|
sel_apid = is_mp ? mp->getAPID() : g_RemoteControl->current_PIDs.PIDs.selected_apid;
|
||||||
|
|
||||||
|
int _apid[p_count];
|
||||||
|
int _perc_val[p_count];
|
||||||
|
unsigned int _is_ac3[p_count];
|
||||||
|
std::string _perc_str[p_count];
|
||||||
|
perc_val = _perc_val;
|
||||||
|
perc_str = _perc_str;
|
||||||
|
is_ac3 = _is_ac3;
|
||||||
|
apid = _apid;
|
||||||
|
chan = is_mp ? mp->getChannelId() : 0;
|
||||||
|
|
||||||
uint p_count = g_RemoteControl->current_PIDs.APIDs.size();
|
|
||||||
// -- setup menue due to Audio PIDs
|
// -- setup menue due to Audio PIDs
|
||||||
for( uint i=0; i < p_count; i++ )
|
for (int i = 0; i < p_count; i++)
|
||||||
{
|
{
|
||||||
char apid[5];
|
if (is_mp) {
|
||||||
sprintf(apid, "%d", i);
|
mp->getAPID(i, apid[i], is_ac3[i]);
|
||||||
CMenuForwarder *fw = new CMenuForwarder(g_RemoteControl->current_PIDs.APIDs[i].desc,
|
perc_val[i] = (is_ac3[i] == 1) ? g_settings.audio_volume_percent_ac3 : g_settings.audio_volume_percent_pcm;
|
||||||
true, NULL, this, apid, CRCInput::convertDigitToKey(i + 1));
|
} else {
|
||||||
|
apid[i] = g_RemoteControl->current_PIDs.APIDs[i].pid;
|
||||||
|
is_ac3[i] = g_RemoteControl->current_PIDs.APIDs[i].is_ac3;
|
||||||
|
perc_val[i] = CZapit::getInstance()->GetPidVolume(chan, apid[i], is_ac3[i]);
|
||||||
|
}
|
||||||
|
perc_str[i] = to_string(perc_val[i]) + "%";
|
||||||
|
|
||||||
|
CMenuForwarder *fw = new CMenuForwarder(is_mp ? mp->getAPIDDesc(i).c_str() : g_RemoteControl->current_PIDs.APIDs[i].desc,
|
||||||
|
true, perc_str[i], this, "s", CRCInput::convertDigitToKey(i + 1));
|
||||||
fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
|
fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
|
||||||
AudioSelector.addItem(fw, (i == g_RemoteControl->current_PIDs.PIDs.selected_apid));
|
fw->setMarked(sel_apid == i);
|
||||||
shortcut_num = i+1;
|
|
||||||
|
AudioSelector->addItem(fw, sel_apid == i);
|
||||||
}
|
}
|
||||||
|
unsigned int shortcut_num = p_count;
|
||||||
|
#if !HAVE_SPARK_HARDWARE && !HAVE_DUCKBOX_HARDWARE
|
||||||
if (p_count)
|
if (p_count)
|
||||||
AudioSelector.addItem(GenericMenuSeparatorLine);
|
AudioSelector->addItem(GenericMenuSeparatorLine);
|
||||||
|
|
||||||
// -- setup menue for to Dual Channel Stereo
|
// -- setup menue for to Dual Channel Stereo
|
||||||
CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE,
|
CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE,
|
||||||
@@ -132,65 +202,86 @@ int CAudioSelectMenuHandler::doMenu ()
|
|||||||
AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT,
|
AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT,
|
||||||
true, audioSetupNotifier, CRCInput::RC_red);
|
true, audioSetupNotifier, CRCInput::RC_red);
|
||||||
|
|
||||||
AudioSelector.addItem( oj );
|
AudioSelector->addItem( oj );
|
||||||
|
|
||||||
oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out,
|
oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out,
|
||||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT,
|
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT,
|
||||||
true, audioSetupNotifier, CRCInput::RC_green);
|
true, audioSetupNotifier, CRCInput::RC_green);
|
||||||
AudioSelector.addItem( oj );
|
AudioSelector->addItem( oj );
|
||||||
|
#endif
|
||||||
|
|
||||||
CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList;
|
CZapitChannel * cc = NULL;
|
||||||
int curnum = channelList->getActiveChannelNumber();
|
int subtitleCount = 0;
|
||||||
CZapitChannel * cc = channelList->getChannel(curnum);
|
if (is_mp) {
|
||||||
|
subtitleCount = mp->getSubtitleCount();
|
||||||
|
} else {
|
||||||
|
CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList;
|
||||||
|
int curnum = channelList->getActiveChannelNumber();
|
||||||
|
cc = channelList->getChannel(curnum);
|
||||||
|
subtitleCount = (int)cc->getSubtitleCount();
|
||||||
|
}
|
||||||
|
|
||||||
bool sep_added = false;
|
bool sep_added = false;
|
||||||
if(cc)
|
if (subtitleCount > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0 ; i < (int)cc->getSubtitleCount() ; ++i)
|
bool sub_active = false;
|
||||||
|
|
||||||
|
for (int i = 0 ; i < subtitleCount ; ++i)
|
||||||
{
|
{
|
||||||
CZapitAbsSub* s = cc->getChannelSub(i);
|
CZapitAbsSub* s = is_mp ? mp->getChannelSub(i, &s) : cc->getChannelSub(i);
|
||||||
|
if (!s)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!sep_added)
|
||||||
|
{
|
||||||
|
sep_added = true;
|
||||||
|
AudioSelector->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ena = false;
|
||||||
|
bool add = true;
|
||||||
|
char spid[64];
|
||||||
|
char item[64];
|
||||||
|
|
||||||
if (s->thisSubType == CZapitAbsSub::DVB) {
|
if (s->thisSubType == CZapitAbsSub::DVB) {
|
||||||
CZapitDVBSub* sd = reinterpret_cast<CZapitDVBSub*>(s);
|
CZapitDVBSub* sd = reinterpret_cast<CZapitDVBSub*>(s);
|
||||||
printf("[neutrino] adding DVB subtitle %s pid %x\n", sd->ISO639_language_code.c_str(), sd->pId);
|
// printf("[neutrino] adding DVB subtitle %s pid %x\n", sd->ISO639_language_code.c_str(), sd->pId);
|
||||||
if(!sep_added)
|
|
||||||
{
|
|
||||||
sep_added = true;
|
|
||||||
AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD));
|
|
||||||
}
|
|
||||||
char spid[10];
|
|
||||||
snprintf(spid,sizeof(spid), "DVB:%d", sd->pId);
|
snprintf(spid,sizeof(spid), "DVB:%d", sd->pId);
|
||||||
char item[64];
|
|
||||||
snprintf(item,sizeof(item), "DVB: %s (pid %x)", sd->ISO639_language_code.c_str(), sd->pId);
|
snprintf(item,sizeof(item), "DVB: %s (pid %x)", sd->ISO639_language_code.c_str(), sd->pId);
|
||||||
AudioSelector.addItem(new CMenuForwarder(item /*sd->ISO639_language_code.c_str()*/,
|
ena = sd->pId != (is_mp ? mp->getCurrentSubPid(CZapitAbsSub::DVB) : dvbsub_getpid());
|
||||||
sd->pId != dvbsub_getpid(), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num)));
|
} else if (s->thisSubType == CZapitAbsSub::TTX) {
|
||||||
}
|
|
||||||
if (s->thisSubType == CZapitAbsSub::TTX)
|
|
||||||
{
|
|
||||||
CZapitTTXSub* sd = reinterpret_cast<CZapitTTXSub*>(s);
|
CZapitTTXSub* sd = reinterpret_cast<CZapitTTXSub*>(s);
|
||||||
printf("[neutrino] adding TTX subtitle %s pid %x mag %X page %x\n", sd->ISO639_language_code.c_str(), sd->pId, sd->teletext_magazine_number, sd->teletext_page_number);
|
// printf("[neutrino] adding TTX subtitle %s pid %x mag %X page %x\n", sd->ISO639_language_code.c_str(), sd->pId, sd->teletext_magazine_number, sd->teletext_page_number);
|
||||||
if(!sep_added)
|
|
||||||
{
|
|
||||||
sep_added = true;
|
|
||||||
AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD));
|
|
||||||
}
|
|
||||||
char spid[64];
|
|
||||||
int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number;
|
int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number;
|
||||||
int pid = sd->pId;
|
int pid = sd->pId;
|
||||||
snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str());
|
snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str());
|
||||||
char item[64];
|
|
||||||
snprintf(item,sizeof(item), "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page);
|
snprintf(item,sizeof(item), "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page);
|
||||||
AudioSelector.addItem(new CMenuForwarder(item /*sd->ISO639_language_code.c_str()*/,
|
ena = !tuxtx_subtitle_running(&pid, &page, NULL);
|
||||||
!tuxtx_subtitle_running(&pid, &page, NULL), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num)));
|
} else if (is_mp && s->thisSubType == CZapitAbsSub::SUB) {
|
||||||
}
|
// printf("[neutrino] adding SUB subtitle %s pid %x\n", s->ISO639_language_code.c_str(), s->pId);
|
||||||
|
snprintf(spid,sizeof(spid), "SUB:%d", s->pId);
|
||||||
|
snprintf(item,sizeof(item), "SUB: %s (pid %x)", s->ISO639_language_code.c_str(), s->pId);
|
||||||
|
ena = s->pId != mp->getCurrentSubPid(CZapitAbsSub::SUB);
|
||||||
|
} else
|
||||||
|
add = false;
|
||||||
|
|
||||||
|
if (add)
|
||||||
|
AudioSelector->addItem(new CMenuForwarder(item, ena,
|
||||||
|
NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num)));
|
||||||
|
if (is_mp)
|
||||||
|
delete s;
|
||||||
|
|
||||||
|
sub_active |= !ena;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sep_added) {
|
if (sub_active) {
|
||||||
CMenuForwarder * item = new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, &SubtitleChanger, "off", CRCInput::RC_stop);
|
CMenuForwarder * item = new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, &SubtitleChanger, "off", CRCInput::RC_stop);
|
||||||
item->setItemButton(NEUTRINO_ICON_BUTTON_STOP, false);
|
item->setItemButton(NEUTRINO_ICON_BUTTON_STOP, false);
|
||||||
AudioSelector.addItem(item);
|
AudioSelector->addItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST));
|
AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST));
|
||||||
|
|
||||||
/* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */
|
/* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */
|
||||||
@@ -203,6 +294,20 @@ int CAudioSelectMenuHandler::doMenu ()
|
|||||||
&percent[i], i == g_RemoteControl->current_PIDs.PIDs.selected_apid,
|
&percent[i], i == g_RemoteControl->current_PIDs.PIDs.selected_apid,
|
||||||
0, 999, CVolume::getInstance()));
|
0, 999, CVolume::getInstance()));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return AudioSelector.exec(NULL, "");
|
//tonbug
|
||||||
|
AudioSelector->addItem(GenericMenuSeparatorLine);
|
||||||
|
#if !HAVE_SPARK_HARDWARE && !HAVE_DUCKBOX_HARDWARE
|
||||||
|
AudioSelector->addItem(new CMenuForwarder(LOCALE_CI_RESET, true, NULL, CNeutrinoApp::getInstance(), "tonbug", CRCInput::convertDigitToKey(++shortcut_num)));
|
||||||
|
#else
|
||||||
|
AudioSelector->addItem(new CMenuForwarder(LOCALE_CI_RESET, true, NULL, CNeutrinoApp::getInstance(), "tonbug", CRCInput::RC_green));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int res = AudioSelector->exec(NULL, "");
|
||||||
|
|
||||||
|
delete AudioSelector;
|
||||||
|
AudioSelector = NULL;
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -29,14 +29,26 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "widget/menue.h"
|
#include "widget/menue.h"
|
||||||
|
#include "movieplayer.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CAudioSelectMenuHandler : public CMenuTarget
|
class CAudioSelectMenuHandler : public CMenuTarget
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
CMoviePlayerGui *mp;
|
||||||
int width;
|
int width;
|
||||||
|
cPlayback *playback;
|
||||||
|
|
||||||
|
int sel_apid;
|
||||||
|
int apid_offset;
|
||||||
|
int *apid;
|
||||||
|
int p_count;
|
||||||
|
int *perc_val;
|
||||||
|
unsigned int *is_ac3;
|
||||||
|
std::string *perc_str;
|
||||||
|
CMenuWidget *AudioSelector;
|
||||||
|
t_channel_id chan;
|
||||||
public:
|
public:
|
||||||
CAudioSelectMenuHandler();
|
CAudioSelectMenuHandler();
|
||||||
~CAudioSelectMenuHandler();
|
~CAudioSelectMenuHandler();
|
||||||
|
@@ -4329,6 +4329,15 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
InfoClock->switchClockOnOff();
|
InfoClock->switchClockOnOff();
|
||||||
returnval = menu_return::RETURN_EXIT_ALL;
|
returnval = menu_return::RETURN_EXIT_ALL;
|
||||||
}
|
}
|
||||||
|
else if (actionKey=="tonbug")
|
||||||
|
{
|
||||||
|
CZapitChannel * chan = CZapit::getInstance()->GetCurrentChannel();
|
||||||
|
if (chan)
|
||||||
|
{
|
||||||
|
CZapit::getInstance()->ChangeAudioPid(chan->getAudioChannelIndex());
|
||||||
|
returnval = menu_return::RETURN_EXIT_ALL;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (actionKey=="tv_radio_switch")//used in mainmenu
|
else if (actionKey=="tv_radio_switch")//used in mainmenu
|
||||||
{
|
{
|
||||||
switchTvRadioMode();
|
switchTvRadioMode();
|
||||||
|
@@ -26,6 +26,7 @@ typedef enum
|
|||||||
{
|
{
|
||||||
NONEXISTANT_LOCALE,
|
NONEXISTANT_LOCALE,
|
||||||
LOCALE_AUDIOSELECTMENUE_HEAD,
|
LOCALE_AUDIOSELECTMENUE_HEAD,
|
||||||
|
LOCALE_AUDIOSELECTMENUE_VOLUME,
|
||||||
LOCALE_EPGMENU_EPGPLUS,
|
LOCALE_EPGMENU_EPGPLUS,
|
||||||
LOCALE_EPGMENU_EVENTINFO,
|
LOCALE_EPGMENU_EVENTINFO,
|
||||||
LOCALE_EPGMENU_EVENTLIST,
|
LOCALE_EPGMENU_EVENTLIST,
|
||||||
|
@@ -26,6 +26,7 @@ const char * locale_real_names[] =
|
|||||||
{
|
{
|
||||||
"INTERNAL ERROR - PLEASE REPORT",
|
"INTERNAL ERROR - PLEASE REPORT",
|
||||||
"AUDIOSelectMenue.head",
|
"AUDIOSelectMenue.head",
|
||||||
|
"AUDIOSelectMenue.volume",
|
||||||
"EPGMenu.epgplus",
|
"EPGMenu.epgplus",
|
||||||
"EPGMenu.eventinfo",
|
"EPGMenu.eventinfo",
|
||||||
"EPGMenu.eventlist",
|
"EPGMenu.eventlist",
|
||||||
|
@@ -49,11 +49,13 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <playback.h>
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
#include <gui/widget/stringinput.h>
|
#include <gui/widget/stringinput.h>
|
||||||
#include <gui/infoclock.h>
|
#include <gui/infoclock.h>
|
||||||
#include <gui/infoviewer.h>
|
#include <gui/infoviewer.h>
|
||||||
|
#include <gui/movieplayer.h>
|
||||||
#include <driver/display.h>
|
#include <driver/display.h>
|
||||||
#include <driver/volume.h>
|
#include <driver/volume.h>
|
||||||
#include <system/helpers.h>
|
#include <system/helpers.h>
|
||||||
@@ -338,9 +340,19 @@ bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *)
|
|||||||
int CSubtitleChangeExec::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
int CSubtitleChangeExec::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||||
{
|
{
|
||||||
printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str());
|
printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str());
|
||||||
|
|
||||||
|
CMoviePlayerGui *mp = &CMoviePlayerGui::getInstance();
|
||||||
|
bool is_mp = mp->Playing();
|
||||||
|
|
||||||
if(actionKey == "off") {
|
if(actionKey == "off") {
|
||||||
tuxtx_stop_subtitle();
|
tuxtx_stop_subtitle();
|
||||||
dvbsub_stop();
|
if (!is_mp && dvbsub_getpid() > 0)
|
||||||
|
dvbsub_stop();
|
||||||
|
if (is_mp && playback) {
|
||||||
|
playback->SetSubtitlePid(0);
|
||||||
|
playback->SetTeletextPid(0);
|
||||||
|
mp->setCurrentTTXSub("");
|
||||||
|
}
|
||||||
return menu_return::RETURN_EXIT;
|
return menu_return::RETURN_EXIT;
|
||||||
}
|
}
|
||||||
if(!strncmp(actionKey.c_str(), "DVB", 3)) {
|
if(!strncmp(actionKey.c_str(), "DVB", 3)) {
|
||||||
@@ -349,7 +361,7 @@ printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str());
|
|||||||
tuxtx_stop_subtitle();
|
tuxtx_stop_subtitle();
|
||||||
dvbsub_pause();
|
dvbsub_pause();
|
||||||
dvbsub_start(pid);
|
dvbsub_start(pid);
|
||||||
} else {
|
} else if (!strncmp(actionKey.c_str(), "TTX", 3)) {
|
||||||
char const * ptr = strchr(actionKey.c_str(), ':');
|
char const * ptr = strchr(actionKey.c_str(), ':');
|
||||||
ptr++;
|
ptr++;
|
||||||
int pid = atoi(ptr);
|
int pid = atoi(ptr);
|
||||||
@@ -362,7 +374,29 @@ printf("CSubtitleChangeExec::exec: TTX, pid %x page %x lang %s\n", pid, page, pt
|
|||||||
tuxtx_stop_subtitle();
|
tuxtx_stop_subtitle();
|
||||||
tuxtx_set_pid(pid, page, ptr);
|
tuxtx_set_pid(pid, page, ptr);
|
||||||
dvbsub_stop();
|
dvbsub_stop();
|
||||||
tuxtx_main(pid, page);
|
if (is_mp) {
|
||||||
|
playback->SetSubtitlePid(0);
|
||||||
|
playback->SetTeletextPid(pid);
|
||||||
|
tuxtx_set_pid(pid, page, ptr);
|
||||||
|
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
|
||||||
|
tuxtx_main(pid, page, 0, true);
|
||||||
|
#else
|
||||||
|
tuxtx_main(pid, page, 0);
|
||||||
|
#endif
|
||||||
|
mp->setCurrentTTXSub(actionKey.c_str());
|
||||||
|
} else {
|
||||||
|
tuxtx_set_pid(pid, page, ptr);
|
||||||
|
tuxtx_main(pid, page);
|
||||||
|
}
|
||||||
|
} else if (is_mp && !strncmp(actionKey.c_str(), "SUB", 3)) {
|
||||||
|
tuxtx_stop_subtitle();
|
||||||
|
dvbsub_stop();
|
||||||
|
playback->SetSubtitlePid(0);
|
||||||
|
playback->SetTeletextPid(0);
|
||||||
|
mp->setCurrentTTXSub("");
|
||||||
|
char const * pidptr = strchr(actionKey.c_str(), ':');
|
||||||
|
int pid = atoi(pidptr+1);
|
||||||
|
playback->SetSubtitlePid(pid);
|
||||||
}
|
}
|
||||||
return menu_return::RETURN_EXIT;
|
return menu_return::RETURN_EXIT;
|
||||||
}
|
}
|
||||||
|
@@ -35,6 +35,11 @@
|
|||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <gui/widget/menue.h>
|
#include <gui/widget/menue.h>
|
||||||
|
#include <zapit/client/zapittypes.h>
|
||||||
|
#include <playback.h>
|
||||||
|
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
|
||||||
|
#include <audio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -103,7 +108,10 @@ class CFontSizeNotifier : public CChangeObserver
|
|||||||
|
|
||||||
class CSubtitleChangeExec : public CMenuTarget
|
class CSubtitleChangeExec : public CMenuTarget
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
cPlayback *playback;
|
||||||
public:
|
public:
|
||||||
|
CSubtitleChangeExec(cPlayback *p = NULL) { playback = p; }
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user