Parcourir la source

Don't pause song playback on first song database load

Clément Wolf il y a 2 semaines
Parent
commit
ccb8fed989
3 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. 2 1
      src/App/Osu/Beatmap.h
  2. 1 0
      src/App/Osu/Changelog.cpp
  3. 7 0
      src/App/Osu/SongBrowser.cpp

+ 2 - 1
src/App/Osu/Beatmap.h

@@ -258,6 +258,8 @@ class Beatmap {
     inline const std::vector<HitObject *> &getHitObjectsPointer() const { return m_hitobjects; }
     inline float getBreakBackgroundFadeAnim() const { return m_fBreakBackgroundFade; }
 
+    Sound *m_music;
+
    protected:
     // internal
     bool canDraw();
@@ -295,7 +297,6 @@ class Beatmap {
     DatabaseBeatmap *m_selectedDifficulty2;
 
     // sound
-    Sound *m_music;
     float m_fMusicFrequencyBackup;
     long m_iCurMusicPos;
     long m_iCurMusicPosWithOffsets;

+ 1 - 0
src/App/Osu/Changelog.cpp

@@ -51,6 +51,7 @@ Changelog::Changelog(Osu *osu) : ScreenBackable(osu) {
     latest.changes.push_back("- Fixed FPoSu camera not following cursor while watching replays");
     latest.changes.push_back("- Fixed FPoSu mod not being included in score data");
     latest.changes.push_back("- Fixed level bar always being at 0%");
+    latest.changes.push_back("- Fixed music pausing on first song database load");
     latest.changes.push_back("- Fixed not being able to adjust volume while song database was loading");
     latest.changes.push_back("- Fixed pause button not working after cancelling database load");
     latest.changes.push_back("- Fixed replay playback starting too fast");

+ 7 - 0
src/App/Osu/SongBrowser.cpp

@@ -1711,6 +1711,13 @@ void SongBrowser::refreshBeatmaps() {
     checkHandleKillDynamicStarCalculator(false);
     checkHandleKillBackgroundSearchMatcher();
 
+    // don't pause the music the first time we load the song database
+    static bool first_refresh = true;
+    if(first_refresh) {
+        m_selectedBeatmap->m_music = nullptr;
+        first_refresh = false;
+    }
+
     m_selectedBeatmap->pausePreviewMusic();
     m_selectedBeatmap->deselect();
     m_selectedBeatmap = new Beatmap(m_osu);