Fixed multiple issues where the wrong navigation sound would play.

This commit is contained in:
Leon Styhre 2022-12-18 12:24:12 +01:00
parent 755cb62017
commit 354da078a3
3 changed files with 13 additions and 3 deletions

View file

@ -92,7 +92,10 @@ private:
void onCursorChanged(const CursorState& state) override; void onCursorChanged(const CursorState& state) override;
void onScroll() override void onScroll() override
{ {
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND); if (mGamelistView)
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
else
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND);
} }
void stopScrolling() override void stopScrolling() override

View file

@ -76,8 +76,10 @@ public:
private: private:
void onScroll() override void onScroll() override
{ {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND)) if (mGamelistView)
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND); NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
else
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND);
} }
void onCursorChanged(const CursorState& state) override; void onCursorChanged(const CursorState& state) override;
bool isScrolling() const override { return List::isScrolling(); } bool isScrolling() const override { return List::isScrolling(); }

View file

@ -86,8 +86,11 @@ private:
void onShow() override { mLoopTime = 0; } void onShow() override { mLoopTime = 0; }
void onScroll() override void onScroll() override
{ {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND)) if (mGamelistView &&
!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND); NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
else if (!mGamelistView)
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND);
} }
void onCursorChanged(const CursorState& state) override; void onCursorChanged(const CursorState& state) override;
bool isScrolling() const override { return List::isScrolling(); } bool isScrolling() const override { return List::isScrolling(); }
@ -126,6 +129,7 @@ private:
std::shared_ptr<Font> mFont; std::shared_ptr<Font> mFont;
std::string mIndicators; std::string mIndicators;
std::string mCollectionIndicators; std::string mCollectionIndicators;
bool mGamelistView;
bool mLegacyMode; bool mLegacyMode;
bool mFadeAbovePrimary; bool mFadeAbovePrimary;
LetterCase mLetterCase; LetterCase mLetterCase;
@ -161,6 +165,7 @@ TextListComponent<T>::TextListComponent()
, mFont {Font::get(FONT_SIZE_MEDIUM)} , mFont {Font::get(FONT_SIZE_MEDIUM)}
, mIndicators {"symbols"} , mIndicators {"symbols"}
, mCollectionIndicators {"symbols"} , mCollectionIndicators {"symbols"}
, mGamelistView {std::is_same_v<T, FileData*> ? true : false}
, mLegacyMode {false} , mLegacyMode {false}
, mFadeAbovePrimary {false} , mFadeAbovePrimary {false}
, mLetterCase {LetterCase::NONE} , mLetterCase {LetterCase::NONE}