diff --git a/mythplugins/mythmusic/mythmusic/musiccommon.cpp b/mythplugins/mythmusic/mythmusic/musiccommon.cpp index 8693efadda3..8b208e1fede 100644 --- a/mythplugins/mythmusic/mythmusic/musiccommon.cpp +++ b/mythplugins/mythmusic/mythmusic/musiccommon.cpp @@ -889,6 +889,7 @@ void MusicCommon::changeSpeed(bool up) else gPlayer->decSpeed(); showSpeed(true); + updatePlaylistStats(); // update trackspeed and map for templates } } @@ -1066,10 +1067,8 @@ void MusicCommon::stop(void) { gPlayer->stop(); - QString time_string = getTimeString(m_maxTime, 0s); - if (m_timeText) - m_timeText->SetText(time_string); + m_timeText->SetText(getTimeString(m_maxTime, 0s)); if (m_infoText) m_infoText->Reset(); } @@ -2119,6 +2118,9 @@ void MusicCommon::updatePlaylistStats(void) else if (playlistName == "stream_playlist") playlistName = tr("Stream Playlist"); map["playlistname"] = playlistName; + map["playedtime"] = getTimeString(m_currentTime, 0s); // v34 - parts + map["totaltime"] = getTimeString(m_maxTime, 0s); + map["trackspeed"] = getTimeString(-1s, 0s); } else { @@ -2129,6 +2131,9 @@ void MusicCommon::updatePlaylistStats(void) map["playlistplayedtime"] = ""; map["playlisttotaltime"] = ""; map["playlistname"] = ""; + map["playedtime"] = ""; // v34 - parts for track templates + map["totaltime"] = ""; + map["trackspeed"] = ""; } SetTextFromMap(map); @@ -2139,16 +2144,22 @@ void MusicCommon::updatePlaylistStats(void) QString MusicCommon::getTimeString(std::chrono::seconds exTime, std::chrono::seconds maxTime) { - if (maxTime <= 0ms) + if (exTime > -1s && maxTime <= 0s) return MythDate::formatTime(exTime, (exTime >= 1h) ? "H:mm:ss" : "mm:ss"); QString fmt = (maxTime >= 1h) ? "H:mm:ss" : "mm:ss"; QString out = MythDate::formatTime(exTime, fmt) + " / " + MythDate::formatTime(maxTime, fmt); - float speed = gPlayer->getSpeed(); - if (lroundf(speed * 100.0F) != 100.0F) // v34 - show altered speed - out += QString(", %1").arg(speed); + float speed = gPlayer->getSpeed(); // v34 - show altered speed + QString speedstr = ""; + if (lroundf(speed * 100.0F) != 100.0F) + { + speedstr = QString("%1").arg(speed); + out += ", " + speedstr + "X"; + } + if (exTime <= -1s) + return speedstr; return out; } diff --git a/mythplugins/mythmusic/mythmusic/musiccommon.h b/mythplugins/mythmusic/mythmusic/musiccommon.h index 87cb8a38ed4..72862c09531 100644 --- a/mythplugins/mythmusic/mythmusic/musiccommon.h +++ b/mythplugins/mythmusic/mythmusic/musiccommon.h @@ -120,7 +120,7 @@ class MPLUGIN_PUBLIC MusicCommon : public MythScreenType void updateShuffleMode(bool updateUIList = false); void changeVolume(bool up) const; - static void changeSpeed(bool up); + void changeSpeed(bool up); void toggleMute(void) const; static void toggleUpmix(void); static void showVolume(void); diff --git a/mythplugins/mythmusic/theme/default-wide/music-base.xml b/mythplugins/mythmusic/theme/default-wide/music-base.xml index 284d0bbd167..91705d1c793 100644 --- a/mythplugins/mythmusic/theme/default-wide/music-base.xml +++ b/mythplugins/mythmusic/theme/default-wide/music-base.xml @@ -854,7 +854,7 @@ @@ -913,7 +913,7 @@ diff --git a/mythplugins/mythmusic/theme/default-wide/music-ui.xml b/mythplugins/mythmusic/theme/default-wide/music-ui.xml index 52ef2cef3b4..3d517136477 100644 --- a/mythplugins/mythmusic/theme/default-wide/music-ui.xml +++ b/mythplugins/mythmusic/theme/default-wide/music-ui.xml @@ -1281,8 +1281,8 @@ diff --git a/mythtv/themes/MythCenter-wide/music-ui.xml b/mythtv/themes/MythCenter-wide/music-ui.xml index 143d9656157..fbd54d58c4e 100644 --- a/mythtv/themes/MythCenter-wide/music-ui.xml +++ b/mythtv/themes/MythCenter-wide/music-ui.xml @@ -1031,6 +1031,10 @@ -1,5,590,190 + + miniplayer_background.png 10,10,569,170 @@ -1063,8 +1067,8 @@ 170,125,250,25 -