2021-05-16 11:12:31 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
|
|
|
// EmulationStation Desktop Edition
|
|
|
|
// MediaViewer.h
|
|
|
|
//
|
|
|
|
// Fullscreen game media viewer.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ES_APP_MEDIA_VIEWER_H
|
|
|
|
#define ES_APP_MEDIA_VIEWER_H
|
|
|
|
|
|
|
|
#include "FileData.h"
|
|
|
|
#include "Window.h"
|
2021-07-07 18:03:42 +00:00
|
|
|
#include "components/ImageComponent.h"
|
|
|
|
#include "components/VideoComponent.h"
|
2021-05-16 11:12:31 +00:00
|
|
|
|
|
|
|
class MediaViewer : public Window::MediaViewer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MediaViewer(Window* window);
|
|
|
|
virtual ~MediaViewer();
|
|
|
|
|
2021-09-18 09:49:39 +00:00
|
|
|
virtual bool startMediaViewer(FileData* game) override;
|
|
|
|
virtual void stopMediaViewer() override;
|
2021-05-16 11:12:31 +00:00
|
|
|
|
2021-09-18 09:49:39 +00:00
|
|
|
virtual void update(int deltaTime) override;
|
|
|
|
virtual void render(const glm::mat4& parentTrans) override;
|
2021-05-16 11:12:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void initiateViewer();
|
|
|
|
void findMedia();
|
|
|
|
|
|
|
|
void playVideo();
|
|
|
|
void showImage(int index);
|
|
|
|
|
2021-09-18 09:49:39 +00:00
|
|
|
virtual void showNext() override;
|
|
|
|
virtual void showPrevious() override;
|
2021-05-16 11:12:31 +00:00
|
|
|
|
|
|
|
Window* mWindow;
|
|
|
|
FileData* mGame;
|
|
|
|
|
|
|
|
bool mHasVideo;
|
|
|
|
bool mHasImages;
|
|
|
|
bool mDisplayingImage;
|
|
|
|
|
|
|
|
int mCurrentImageIndex;
|
2021-10-28 19:00:23 +00:00
|
|
|
int mScreenshotIndex;
|
|
|
|
int mTitleScreenIndex;
|
2021-05-16 11:12:31 +00:00
|
|
|
|
|
|
|
std::string mVideoFile;
|
|
|
|
std::vector<std::string> mImageFiles;
|
|
|
|
|
|
|
|
VideoComponent* mVideo;
|
|
|
|
ImageComponent* mImage;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ES_APP_MEDIA_VIEWER_H
|