diff --git a/lib/libcoolstream/playback_cs.h b/lib/libcoolstream/playback_cs.h index 399ef152a..8be1ba391 100644 --- a/lib/libcoolstream/playback_cs.h +++ b/lib/libcoolstream/playback_cs.h @@ -66,7 +66,7 @@ public: void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida); void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language); void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + bool SelectSubtitles(int pid, std::string charset = ""); void GetChapters(std::vector &positions, std::vector &titles); void RequestAbort(); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); diff --git a/lib/libcoolstream2/playback_cs.h b/lib/libcoolstream2/playback_cs.h index e89fc576c..8480ed0aa 100644 --- a/lib/libcoolstream2/playback_cs.h +++ b/lib/libcoolstream2/playback_cs.h @@ -67,7 +67,7 @@ public: void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida); void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language); void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + bool SelectSubtitles(int pid, std::string charset = ""); void GetChapters(std::vector &positions, std::vector &titles); void RequestAbort(); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 6e08e274a..587d582f2 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -221,7 +221,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_RED; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -236,7 +236,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -251,7 +251,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -266,7 +266,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -279,16 +279,11 @@ void CInfoViewerBB::getBBButtonInfo() default: break; } - //label audio control button in movieplayer/upnp mode - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) + //label audio control button in movieplayer mode + if (mode == NeutrinoMessages::mode_ts && !CMoviePlayerGui::getInstance().timeshift) { - if (!CMoviePlayerGui::getInstance().timeshift) - { - if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) - { - text = CMoviePlayerGui::getInstance(mode == NeutrinoMessages::mode_webtv).CurrentAudioName(); - } - } + if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) + text = CMoviePlayerGui::getInstance(false).CurrentAudioName(); // use instance_mp } bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(text) + w + 10; bbButtonInfo[i].cx = w + 5; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 2c2be6090..44b1c4494 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1891,7 +1891,7 @@ void CMoviePlayerGui::selectSubtitle() if (!numsubs) playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage); - CMenuOptionStringChooser * sc = new CMenuOptionStringChooser(LOCALE_SUBTITLES_CHARSET, &g_settings.subs_charset, true, NULL, CRCInput::RC_red, NULL, true); + CMenuOptionStringChooser * sc = new CMenuOptionStringChooser(LOCALE_SUBTITLES_CHARSET, &g_settings.subs_charset, currentspid == -1, NULL, CRCInput::RC_red, NULL, true); sc->addOption("UTF-8"); sc->addOption("UCS-2"); sc->addOption("CP1250"); @@ -1919,7 +1919,7 @@ void CMoviePlayerGui::selectSubtitle() APIDSelector.addItem(item); } sprintf(cnt, "%d", count); - APIDSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, selector, cnt, CRCInput::RC_stop), currentspid > 0); + APIDSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, currentspid != -1, NULL, selector, cnt, CRCInput::RC_stop), currentspid > 0); APIDSelector.exec(NULL, ""); delete selector; @@ -1928,12 +1928,12 @@ void CMoviePlayerGui::selectSubtitle() currentspid = spids[select]; /* external subtitles pid is 0x1FFF */ ext_subs = (currentspid == 0x1FFF); - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); printf("[movieplayer] spid changed to %d\n", currentspid); } else if (select > 0) { ext_subs = false; currentspid = -1; - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); printf("[movieplayer] spid changed to %d\n", currentspid); } } @@ -2160,7 +2160,7 @@ void CMoviePlayerGui::selectAutoLang() for (unsigned count = 0; count < numsubs; count++) { if (spids[count] == 0x1FFF) { currentspid = spids[count]; - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); } } } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index dd18cee43..32912b418 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -92,8 +92,8 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ CNeutrinoApp::getInstance()->stopPlayBack(true); m_frameBuffer->showFrame("mp3.jpg"); - // tell neutrino we're in audio mode - CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio); + // tell neutrino we're in upnp mode + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_upnp); // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); @@ -1230,12 +1230,18 @@ printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); void CUpnpBrowserGui::playAudio(std::string name, int type) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio); + CAudiofile mp3(name, (CFile::FileType) type); CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } void CUpnpBrowserGui::showPicture(std::string name) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_pic); + g_PicViewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); g_PicViewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY); @@ -1246,14 +1252,20 @@ void CUpnpBrowserGui::showPicture(std::string name) g_PicViewer->ShowImage(name, false); g_PicViewer->Cleanup(); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } void CUpnpBrowserGui::playVideo(std::string name, std::string url) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); + if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) CAudioPlayer::getInstance()->stop(); m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index e178031eb..f7c5c79b9 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -488,6 +488,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu neutrino_locale_t loc = NONEXISTANT_LOCALE; const char *text = NULL; + int mode = CNeutrinoApp::getInstance()->getMode(); std::vector items = ::split(g_settings.usermenu[button]->items, ','); for (std::vector::iterator it = items.begin(); it != items.end(); ++it) { @@ -538,7 +539,9 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu continue; case SNeutrinoSettings::ITEM_AUDIO_SELECT: if(loc == NONEXISTANT_LOCALE && !text) { - if (!g_RemoteControl->current_PIDs.APIDs.empty()) + if (mode == NeutrinoMessages::mode_webtv) + text = CMoviePlayerGui::getInstance(true).CurrentAudioName().c_str(); // use instance_bg + else if (!g_RemoteControl->current_PIDs.APIDs.empty()) text = g_RemoteControl->current_PIDs.APIDs[ g_RemoteControl->current_PIDs.PIDs.selected_apid].desc; } else diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ed659876f..50a9a910a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3329,7 +3329,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) lastMode=mode; mode=mode_pic; } - if((data & mode_mask)== mode_ts && CMoviePlayerGui::getInstance().Playing()) { + if((data & mode_mask)== mode_ts) { if(mode == mode_radio) frameBuffer->stopFrame(); lastMode=mode; diff --git a/src/neutrino.h b/src/neutrino.h index 9017a1b99..d65f6760c 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -153,6 +153,7 @@ public: mode_ts = 7, mode_off = 8, mode_webtv = 9, + mode_upnp = 10, mode_mask = 0xFF, norezap = 0x100 }; diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index 65519c02f..4049ead7e 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -177,6 +177,7 @@ struct NeutrinoMessages { mode_pic = 6, mode_ts = 7, mode_webtv = 9, + mode_upnp = 10, mode_mask = 0xFF, norezap = 0x100 };