mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
The video player is now stopped before attempting to remove media files.
This commit is contained in:
parent
4305c211eb
commit
4556a0c71a
|
@ -234,6 +234,9 @@ void BasicGameListView::removeMedia(FileData* game)
|
|||
std::string mediaType;
|
||||
std::string path;
|
||||
|
||||
// Stop the video player, especially important on Windows as the file would otherwise be locked.
|
||||
onStopVideo();
|
||||
|
||||
// If there are no media files left in the directory after the deletion, then remove
|
||||
// the directory too. Remove any empty parent directories as well.
|
||||
auto removeEmptyDirFunc = []
|
||||
|
|
|
@ -543,6 +543,12 @@ void GuiComponent::onHide()
|
|||
getChild(i)->onHide();
|
||||
}
|
||||
|
||||
void GuiComponent::onStopVideo()
|
||||
{
|
||||
for (unsigned int i = 0; i < getChildCount(); i++)
|
||||
getChild(i)->onStopVideo();
|
||||
}
|
||||
|
||||
void GuiComponent::onPauseVideo()
|
||||
{
|
||||
for (unsigned int i = 0; i < getChildCount(); i++)
|
||||
|
|
|
@ -178,6 +178,7 @@ public:
|
|||
|
||||
virtual void onShow();
|
||||
virtual void onHide();
|
||||
virtual void onStopVideo();
|
||||
virtual void onPauseVideo();
|
||||
virtual void onUnpauseVideo();
|
||||
virtual bool isVideoPaused() { return false; };
|
||||
|
|
|
@ -116,6 +116,12 @@ void VideoComponent::onHide()
|
|||
manageState();
|
||||
}
|
||||
|
||||
void VideoComponent::onStopVideo()
|
||||
{
|
||||
stopVideo();
|
||||
manageState();
|
||||
}
|
||||
|
||||
void VideoComponent::onPauseVideo()
|
||||
{
|
||||
mBlockPlayer = true;
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
|
||||
virtual void onShow() override;
|
||||
virtual void onHide() override;
|
||||
virtual void onStopVideo() override;
|
||||
virtual void onPauseVideo() override;
|
||||
virtual void onUnpauseVideo() override;
|
||||
virtual bool isVideoPaused() override { return mPause; }
|
||||
|
|
Loading…
Reference in a new issue