mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-11 23:50:58 +02:00
Code and option to auto select subtitles for prefered language
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@376 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5c0f6e6db4
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-02-18 (Thu, 18 Feb 2010)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -140,7 +140,8 @@ audiomenu.hdmi_dd Encoded DD on HDMI
|
||||
audiomenu.spdif_dd Encoded DD on SPDIF
|
||||
audiomenu.avsync A/V sync
|
||||
audiomenu.avsync_am Audio master
|
||||
audiomenu.auto_lang Use prefered languages
|
||||
audiomenu.auto_lang Auto select audio
|
||||
audiomenu.auto_subs Auto select subtitles
|
||||
audiomenu.pref_lang_head Audio/EPG language preferences
|
||||
audiomenu.pref_lang Prefered language
|
||||
audioplayer.add Add
|
||||
|
@@ -800,6 +800,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
||||
|
||||
g_settings.audio_avs_Control = false;
|
||||
g_settings.auto_lang = configfile.getInt32( "auto_lang", 0 );
|
||||
g_settings.auto_subs = configfile.getInt32( "auto_subs", 0 );
|
||||
for(int i = 0; i < 3; i++) {
|
||||
sprintf(cfg_key, "pref_lang_%d", i);
|
||||
strncpy(g_settings.pref_lang[i], configfile.getString(cfg_key, "").c_str(), 30);
|
||||
@@ -1306,6 +1307,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
||||
configfile.setBool("audio_DolbyDigital" , g_settings.audio_DolbyDigital );
|
||||
configfile.setInt32( "audio_avs_Control", g_settings.audio_avs_Control );
|
||||
configfile.setInt32( "auto_lang", g_settings.auto_lang );
|
||||
configfile.setInt32( "auto_subs", g_settings.auto_subs );
|
||||
for(int i = 0; i < 3; i++) {
|
||||
sprintf(cfg_key, "pref_lang_%d", i);
|
||||
configfile.setString(cfg_key, g_settings.pref_lang[i]);
|
||||
@@ -2231,6 +2233,7 @@ void CNeutrinoApp::InitZapper()
|
||||
tuxtxt_start(g_RemoteControl->current_PIDs.PIDs.vtxtpid);
|
||||
g_RCInput->postMsg(NeutrinoMessages::SHOW_INFOBAR, 0);
|
||||
//g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_COMPLETE, (neutrino_msg_data_t) &live_channel_id);
|
||||
SelectSubtitles();
|
||||
StartSubtitles();
|
||||
}
|
||||
}
|
||||
@@ -2933,6 +2936,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
|
||||
scrambled_timer = 0;
|
||||
}
|
||||
scrambled_timer = g_RCInput->addTimer(10*1000*1000, true);
|
||||
SelectSubtitles();
|
||||
if(!g_InfoViewer->is_visible)
|
||||
StartSubtitles();
|
||||
}
|
||||
@@ -4834,3 +4838,51 @@ void CNeutrinoApp::StartSubtitles()
|
||||
dvbsub_start(0);
|
||||
tuxtx_pause_subtitle(false);
|
||||
}
|
||||
|
||||
void CNeutrinoApp::SelectSubtitles()
|
||||
{
|
||||
if(!g_settings.auto_subs)
|
||||
return;
|
||||
|
||||
int curnum = channelList->getActiveChannelNumber();
|
||||
CZapitChannel * cc = channelList->getChannel(curnum);
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
if(strlen(g_settings.pref_lang[i]) == 0)
|
||||
continue;
|
||||
|
||||
std::string temp(g_settings.pref_lang[i]);
|
||||
|
||||
for(int j = 0 ; j < (int)cc->getSubtitleCount() ; j++) {
|
||||
CZapitAbsSub* s = cc->getChannelSub(j);
|
||||
if (s->thisSubType == CZapitAbsSub::DVB) {
|
||||
CZapitDVBSub* sd = reinterpret_cast<CZapitDVBSub*>(s);
|
||||
std::map<std::string, std::string>::const_iterator it;
|
||||
for(it = iso639.begin(); it != iso639.end(); it++) {
|
||||
if(temp == it->second && sd->ISO639_language_code == it->first) {
|
||||
printf("CNeutrinoApp::SelectSubtitles: found DVB %s, pid %x\n", sd->ISO639_language_code.c_str(), sd->pId);
|
||||
dvbsub_stop();
|
||||
dvbsub_setpid(sd->pId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int j = 0 ; j < (int)cc->getSubtitleCount() ; j++) {
|
||||
CZapitAbsSub* s = cc->getChannelSub(j);
|
||||
if (s->thisSubType == CZapitAbsSub::TTX) {
|
||||
CZapitTTXSub* sd = reinterpret_cast<CZapitTTXSub*>(s);
|
||||
std::map<std::string, std::string>::const_iterator it;
|
||||
for(it = iso639.begin(); it != iso639.end(); it++) {
|
||||
if(temp == it->second && sd->ISO639_language_code == it->first) {
|
||||
int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number;
|
||||
printf("CNeutrinoApp::SelectSubtitles: found TTX %s, pid %x page %03X\n", sd->ISO639_language_code.c_str(), sd->pId, page);
|
||||
tuxtx_stop_subtitle();
|
||||
tuxtx_set_pid(sd->pId, page);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -264,6 +264,7 @@ public:
|
||||
void quickZap(int msg);
|
||||
void StopSubtitles();
|
||||
void StartSubtitles();
|
||||
void SelectSubtitles();
|
||||
void showInfo(void);
|
||||
};
|
||||
#endif
|
||||
|
@@ -1682,7 +1682,8 @@ void CNeutrinoApp::InitAudioSettings(CMenuWidget &audioSettings, CAudioSetupNoti
|
||||
|
||||
audioSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_PREF_LANG_HEAD));
|
||||
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier));
|
||||
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_AUTO_LANG, &g_settings.auto_lang, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier));
|
||||
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_AUTO_LANG, &g_settings.auto_lang, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL));
|
||||
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_AUTO_SUBS, &g_settings.auto_subs, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL));
|
||||
|
||||
CLangSelectNotifier * langNotifier = new CLangSelectNotifier();
|
||||
for(int i = 0; i < 3; i++) {
|
||||
|
@@ -148,6 +148,7 @@ typedef enum {
|
||||
LOCALE_AUDIOMENU_AVSYNC_AM,
|
||||
LOCALE_AUDIOMENU_CLOCKREC,
|
||||
LOCALE_AUDIOMENU_AUTO_LANG,
|
||||
LOCALE_AUDIOMENU_AUTO_SUBS,
|
||||
LOCALE_AUDIOMENU_PREF_LANG_HEAD,
|
||||
LOCALE_AUDIOMENU_PREF_LANG,
|
||||
LOCALE_AUDIOPLAYER_ADD,
|
||||
|
@@ -148,6 +148,7 @@ const char *locale_real_names[] = {
|
||||
"audiomenu.avsync_am",
|
||||
"audiomenu.clockrec",
|
||||
"audiomenu.auto_lang",
|
||||
"audiomenu.auto_subs",
|
||||
"audiomenu.pref_lang_head",
|
||||
"audiomenu.pref_lang",
|
||||
"audioplayer.add",
|
||||
|
@@ -71,6 +71,7 @@ struct SNeutrinoSettings
|
||||
int audio_DolbyDigital;
|
||||
int audio_avs_Control;
|
||||
int auto_lang;
|
||||
int auto_subs;
|
||||
char audio_PCMOffset[3];
|
||||
int srs_enable;
|
||||
int srs_algo;
|
||||
|
Reference in New Issue
Block a user