diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 6d9c891ce..73cc543e1 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -928,7 +928,7 @@ bool CFileBrowser::exec(const char * const dirname) return res; } -bool CFileBrowser::playlist_manager(CFileList &playlist, unsigned int playing, bool is_audio_player) +bool CFileBrowser::playlist_manager(CFileList &playlist, unsigned int playing, bool is_audio_playing) { neutrino_msg_t msg; neutrino_msg_data_t data; @@ -1065,7 +1065,7 @@ bool CFileBrowser::playlist_manager(CFileList &playlist, unsigned int playing, b addfiles->Hide_records = true; addfiles->Multi_Select = true; addfiles->Dirs_Selectable = true; - addfiles->exec(is_audio_player ? g_settings.network_nfs_audioplayerdir.c_str() : g_settings.network_nfs_moviedir.c_str()); + addfiles->exec(is_audio_playing ? g_settings.network_nfs_audioplayerdir.c_str() : g_settings.network_nfs_moviedir.c_str()); CFileList tmplist = addfiles->getSelectedFiles(); filelist.insert( filelist.end(), tmplist.begin(), tmplist.end() ); tmplist.clear(); diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index c5ca5b8fc..57e5c2c3b 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -220,7 +220,7 @@ class CFileBrowser ~CFileBrowser(); bool exec(const char * const dirname); - bool playlist_manager(CFileList &playlist, unsigned int playing, bool is_audio_player = false); + bool playlist_manager(CFileList &playlist, unsigned int playing, bool is_audio_playing = false); CFile *getSelectedFile(); inline const CFileList & getSelectedFiles(void) const diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 48bfd43b1..b2f5601b4 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -965,7 +965,7 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] + timeout_ext); break; case NeutrinoMessages::mode_ts: - if (CMoviePlayerGui::getInstance().IsAudioPlayer()) + if (CMoviePlayerGui::getInstance().IsAudioPlaying()) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MEDIA_AUDIO] + timeout_ext); else timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MEDIA_VIDEO] + timeout_ext); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 565fd0dce..15cf912c7 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -188,6 +188,7 @@ void CMoviePlayerGui::Init(void) stopped = true; currentVideoSystem = -1; currentOsdResolution = 0; + is_audio_playing = false; frameBuffer = CFrameBuffer::getInstance(); @@ -315,9 +316,6 @@ void CMoviePlayerGui::cutNeutrino() g_Zapit->setStandby(true); #endif - if (is_audio_player) - frameBuffer->showFrame("mp3.jpg"); - m_LastMode = (CNeutrinoApp::getInstance()->getMode() /*| NeutrinoMessages::norezap*/); if (isWebTV) m_LastMode |= NeutrinoMessages::norezap; @@ -431,13 +429,13 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) } #endif else if (actionKey == "fileplayback_video") { - is_audio_player = false; + is_audio_playing = false; if (filebrowser) filebrowser->Filter = &filefilter_video; //wakeup_hdd(g_settings.network_nfs_moviedir.c_str()); } else if (actionKey == "fileplayback_audio") { - is_audio_player = true; + is_audio_playing = true; if (filebrowser) filebrowser->Filter = &filefilter_audio; //wakeup_hdd(g_settings.network_nfs_audioplayerdir.c_str()); @@ -691,7 +689,7 @@ void CMoviePlayerGui::ClearFlags() isWebTV = false; isYT = false; is_file_player = false; - is_audio_player = false; + is_audio_playing = false; timeshift = TSHIFT_MODE_OFF; } @@ -796,7 +794,7 @@ bool CMoviePlayerGui::SelectFile() cookie_header.clear(); //reinit Path_local for webif reloadsetup Path_local = "/"; - if (is_audio_player) + if (is_audio_playing) { if (!g_settings.network_nfs_audioplayerdir.empty()) Path_local = g_settings.network_nfs_audioplayerdir; @@ -807,7 +805,7 @@ bool CMoviePlayerGui::SelectFile() Path_local = g_settings.network_nfs_moviedir; } - printf("CMoviePlayerGui::SelectFile: isBookmark %d timeshift %d isMovieBrowser %d is_audio_player %d\n", isBookmark, timeshift, isMovieBrowser, is_audio_player); + printf("CMoviePlayerGui::SelectFile: isBookmark %d timeshift %d isMovieBrowser %d is_audio_playing %d\n", isBookmark, timeshift, isMovieBrowser, is_audio_playing); //NI wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); if (timeshift != TSHIFT_MODE_OFF) { @@ -878,7 +876,7 @@ bool CMoviePlayerGui::SelectFile() menu_ret = filebrowser->getMenuRet(); enableOsdElements(MUTE); } - if (!is_audio_player) + if (!is_audio_playing) g_settings.network_nfs_moviedir = Path_local; return ret; @@ -1448,6 +1446,15 @@ bool CMoviePlayerGui::PlayFileStart(void) showStartingHint = true; pthread_create(&thrStartHint, NULL, CMoviePlayerGui::ShowStartHint, this); } + + if (filefilter_audio.matchFilter(file_name)) + { + frameBuffer->showFrame("mp3.jpg"); + is_audio_playing = true; + } + else + is_audio_playing = false; + bool res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration); if (thrStartHint) { @@ -1652,7 +1659,7 @@ void CMoviePlayerGui::PlayFileLoop(void) updateLcd(); } if (first_start) { - usleep(50000); + usleep(80000); callInfoViewer(); first_start = false; } @@ -1784,7 +1791,7 @@ void CMoviePlayerGui::PlayFileLoop(void) pfile = &(*filelist_it); int selected = std::distance( filelist.begin(), filelist_it ); filelist_it = filelist.end(); - if (playlist->playlist_manager(filelist, selected, is_audio_player)) + if (playlist->playlist_manager(filelist, selected, is_audio_playing)) { playstate = CMoviePlayerGui::STOPPED; CFile *sfile = NULL; @@ -1878,7 +1885,7 @@ void CMoviePlayerGui::PlayFileLoop(void) CFile *pfile = NULL; int selected = std::distance( filelist.begin(), filelist_it ); filelist_it = filelist.end(); - if (playlist->playlist_manager(filelist, selected, is_audio_player)) + if (playlist->playlist_manager(filelist, selected, is_audio_playing)) { playstate = CMoviePlayerGui::STOPPED; CFile *sfile = NULL; diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 07b76df00..add175184 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -189,7 +189,7 @@ class CMoviePlayerGui : public CMenuTarget /* playback from file */ bool is_file_player; - bool is_audio_player; + bool is_audio_playing; bool iso_file; bool stopped; CFileBrowser * filebrowser; @@ -320,7 +320,7 @@ class CMoviePlayerGui : public CMenuTarget void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; void getLivestreamInfo(std::string *i1, std::string *i2) { *i1=livestreamInfo1; *i2=livestreamInfo2; }; bool getLiveUrl(const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2, std::string &header); - bool IsAudioPlayer() { return is_audio_player; }; + bool IsAudioPlaying() { return is_audio_playing; }; }; #endif