mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-21 21:55:38 +00:00
(Android) Added a reset of the video element delay timer on activity resume
This commit is contained in:
parent
2a2400fc73
commit
7e64c15388
|
@ -508,6 +508,7 @@ void applicationLoop()
|
|||
blockInput = true;
|
||||
inputBlockTime = 0;
|
||||
window->setBlockInput(true);
|
||||
ViewController::getInstance()->resetViewVideosTimer();
|
||||
}
|
||||
#endif
|
||||
InputManager::getInstance().parseEvent(event);
|
||||
|
|
|
@ -56,6 +56,13 @@ public:
|
|||
for (auto& video : mStaticVideoComponents)
|
||||
video->muteVideoPlayer();
|
||||
}
|
||||
void resetViewVideosTimer() override
|
||||
{
|
||||
for (auto& video : mVideoComponents)
|
||||
video->resetVideoPlayerTimer();
|
||||
for (auto& video : mStaticVideoComponents)
|
||||
video->resetVideoPlayerTimer();
|
||||
}
|
||||
|
||||
void stopGamelistFadeAnimations() override
|
||||
{
|
||||
|
|
|
@ -94,6 +94,11 @@ public:
|
|||
for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents)
|
||||
video->muteVideoPlayer();
|
||||
}
|
||||
void resetViewVideosTimer() override
|
||||
{
|
||||
for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents)
|
||||
video->resetVideoPlayerTimer();
|
||||
}
|
||||
|
||||
void onThemeChanged(const std::shared_ptr<ThemeData>& theme);
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ public:
|
|||
void stopViewVideos() override { mCurrentView->stopViewVideos(); }
|
||||
void pauseViewVideos() override { mCurrentView->pauseViewVideos(); }
|
||||
void muteViewVideos() override { mCurrentView->muteViewVideos(); }
|
||||
// Needed on Android to reset the static image delay timer on activity resume.
|
||||
void resetViewVideosTimer() override { mCurrentView->resetViewVideosTimer(); }
|
||||
|
||||
void onFileChanged(FileData* file, bool reloadGamelist);
|
||||
void triggerGameLaunch(FileData* game)
|
||||
|
|
|
@ -310,6 +310,8 @@ public:
|
|||
virtual void stopViewVideos() {}
|
||||
virtual void pauseViewVideos() {}
|
||||
virtual void muteViewVideos() {}
|
||||
// Needed on Android to reset the static image delay timer on activity resume.
|
||||
virtual void resetViewVideosTimer() {}
|
||||
|
||||
// Used to reset various components like text scrolling, animations etc.
|
||||
virtual void resetComponent() {}
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include "utils/FileSystemUtil.h"
|
||||
#include "utils/StringUtil.h"
|
||||
|
||||
#include <SDL2/SDL_timer.h>
|
||||
|
||||
#define SCREENSAVER_FADE_IN_TIME 900
|
||||
#define MEDIA_VIEWER_FADE_IN_TIME 600
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include <atomic>
|
||||
#include <string>
|
||||
|
||||
#include <SDL2/SDL_timer.h>
|
||||
|
||||
class MediaViewer;
|
||||
class TextureResource;
|
||||
|
||||
|
@ -84,6 +86,9 @@ public:
|
|||
virtual void stopVideoPlayer(bool muteAudio = true) {}
|
||||
virtual void pauseVideoPlayer() {}
|
||||
|
||||
// Needed on Android to reset the static image delay timer on activity resume.
|
||||
void resetVideoPlayerTimer() { mStartTime = SDL_GetTicks() + mConfig.startDelay; }
|
||||
|
||||
// Handle looping of the video. Must be called periodically.
|
||||
virtual void handleLooping() {}
|
||||
// Used to immediately mute audio even if there are still samples to play in the buffer.
|
||||
|
|
Loading…
Reference in a new issue