From 5e3f02074e353a31b2c2369fe413464074be6126 Mon Sep 17 00:00:00 2001 From: casey langen Date: Fri, 8 Jan 2021 23:31:37 -0800 Subject: [PATCH] Fixed a bug where track numbers would not be correct if the last loaded session was a playlist --- CHANGELOG.txt | 2 ++ src/musikcore/audio/GaplessTransport.cpp | 4 +--- src/musikcube/app/layout/BrowseLayout.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c6242b962..6d730b46f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,8 @@ by linking against the less buggy, homebrew-provided version of ncurses. * upgraded to the most recent version of Android Studio tooling for the musikdroid app. +* fixed a bug where track numbers would not be correct after loading a session + where the last viewed content was a playlist. * ongoing warning cleanups against more modern compilers. -------------------------------------------------------------------------------- diff --git a/src/musikcore/audio/GaplessTransport.cpp b/src/musikcore/audio/GaplessTransport.cpp index a0fb8182b..771c64509 100644 --- a/src/musikcore/audio/GaplessTransport.cpp +++ b/src/musikcore/audio/GaplessTransport.cpp @@ -128,9 +128,7 @@ void GaplessTransport::StartWithPlayer(Player* newPlayer, StartMode mode) { /* first argument suppresses the "Stop" event from getting triggered, the second param is used for gapless playback -- we won't stop the output and will allow pending buffers to finish if we're not automatically - playing the next track. note we do this outside of critical section so - outputs *can* stop buffers immediately, and not to worry about causing a - deadlock. */ + playing the next track. */ this->StopInternal(true, !playingNext, newPlayer); this->SetNextCanStart(false); this->output->Resume(); diff --git a/src/musikcube/app/layout/BrowseLayout.cpp b/src/musikcube/app/layout/BrowseLayout.cpp index c3a04a5f5..6c68b85b0 100755 --- a/src/musikcube/app/layout/BrowseLayout.cpp +++ b/src/musikcube/app/layout/BrowseLayout.cpp @@ -178,6 +178,7 @@ void BrowseLayout::LoadLastSession() { const std::string field = session->GetString(keys::LastBrowseCategoryType, ""); const int64_t id = (int64_t) session->GetDouble(keys::LastBrowseCategoryId, -1.0); if (field.size()) { + this->SwitchCategory(field); this->ScrollTo(field, id); } }