mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Added support for a 'none' value to the video element imageType property
This commit is contained in:
parent
3e7436c347
commit
58b4b361ad
|
|
@ -562,6 +562,7 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
|
||||||
{"fontSizeDimmed", FLOAT},
|
{"fontSizeDimmed", FLOAT},
|
||||||
{"scope", STRING},
|
{"scope", STRING},
|
||||||
{"entries", STRING},
|
{"entries", STRING},
|
||||||
|
{"entryLayout", STRING},
|
||||||
{"entrySpacing", FLOAT},
|
{"entrySpacing", FLOAT},
|
||||||
{"entrySpacingDimmed", FLOAT},
|
{"entrySpacingDimmed", FLOAT},
|
||||||
{"iconTextSpacing", FLOAT},
|
{"iconTextSpacing", FLOAT},
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ VideoComponent::VideoComponent()
|
||||||
, mIsPlaying {false}
|
, mIsPlaying {false}
|
||||||
, mIsActuallyPlaying {false}
|
, mIsActuallyPlaying {false}
|
||||||
, mPaused {false}
|
, mPaused {false}
|
||||||
|
, mImageTypeNone {false}
|
||||||
, mMediaViewerMode {false}
|
, mMediaViewerMode {false}
|
||||||
, mScreensaverMode {false}
|
, mScreensaverMode {false}
|
||||||
, mTargetIsMax {false}
|
, mTargetIsMax {false}
|
||||||
|
|
@ -346,8 +347,8 @@ void VideoComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::string& type : mThemeImageTypes) {
|
for (std::string& type : mThemeImageTypes) {
|
||||||
if (std::find(supportedImageTypes.cbegin(), supportedImageTypes.cend(), type) ==
|
if (std::find(sSupportedImageTypes.cbegin(), sSupportedImageTypes.cend(), type) ==
|
||||||
supportedImageTypes.cend()) {
|
sSupportedImageTypes.cend()) {
|
||||||
LOG(LogError)
|
LOG(LogError)
|
||||||
<< "VideoComponent: Invalid theme configuration, property \"imageType\" "
|
<< "VideoComponent: Invalid theme configuration, property \"imageType\" "
|
||||||
"for element \""
|
"for element \""
|
||||||
|
|
@ -357,6 +358,11 @@ void VideoComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (std::find(mThemeImageTypes.cbegin(), mThemeImageTypes.cend(), "none") !=
|
||||||
|
mThemeImageTypes.cend()) {
|
||||||
|
mImageTypeNone = true;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> sortedTypes {mThemeImageTypes};
|
std::vector<std::string> sortedTypes {mThemeImageTypes};
|
||||||
std::stable_sort(sortedTypes.begin(), sortedTypes.end());
|
std::stable_sort(sortedTypes.begin(), sortedTypes.end());
|
||||||
|
|
||||||
|
|
@ -460,7 +466,7 @@ void VideoComponent::update(int deltaTime)
|
||||||
if (mWindow->getGameLaunchedState())
|
if (mWindow->getGameLaunchedState())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mIsPlaying && (mConfig.startDelay == 0 || mStaticImagePath == "")) {
|
if (!mIsPlaying && (mConfig.startDelay == 0 || (mStaticImagePath == "" && !mImageTypeNone))) {
|
||||||
startVideoStream();
|
startVideoStream();
|
||||||
}
|
}
|
||||||
else if (mStartTime == 0 || SDL_GetTicks() > mStartTime) {
|
else if (mStartTime == 0 || SDL_GetTicks() > mStartTime) {
|
||||||
|
|
@ -502,6 +508,9 @@ void VideoComponent::startVideoPlayer()
|
||||||
mStartTime = SDL_GetTicks() + mConfig.startDelay;
|
mStartTime = SDL_GetTicks() + mConfig.startDelay;
|
||||||
setImage(mStaticImagePath);
|
setImage(mStaticImagePath);
|
||||||
}
|
}
|
||||||
|
else if (mConfig.showStaticImageDelay && mConfig.startDelay != 0 && mImageTypeNone) {
|
||||||
|
mStartTime = SDL_GetTicks() + mConfig.startDelay;
|
||||||
|
}
|
||||||
|
|
||||||
mPaused = false;
|
mPaused = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -134,9 +134,9 @@ protected:
|
||||||
std::string mStaticImagePath;
|
std::string mStaticImagePath;
|
||||||
std::string mDefaultImagePath;
|
std::string mDefaultImagePath;
|
||||||
|
|
||||||
static inline std::vector<std::string> supportedImageTypes {
|
static inline std::vector<std::string> sSupportedImageTypes {
|
||||||
"image", "miximage", "marquee", "screenshot", "titlescreen",
|
"image", "miximage", "marquee", "screenshot", "titlescreen", "cover",
|
||||||
"cover", "backcover", "3dbox", "physicalmedia", "fanart"};
|
"backcover", "3dbox", "physicalmedia", "fanart", "none"};
|
||||||
|
|
||||||
std::string mVideoPath;
|
std::string mVideoPath;
|
||||||
OnIterationsDone mOnIterationsDone;
|
OnIterationsDone mOnIterationsDone;
|
||||||
|
|
@ -144,6 +144,7 @@ protected:
|
||||||
std::atomic<bool> mIsPlaying;
|
std::atomic<bool> mIsPlaying;
|
||||||
std::atomic<bool> mIsActuallyPlaying;
|
std::atomic<bool> mIsActuallyPlaying;
|
||||||
std::atomic<bool> mPaused;
|
std::atomic<bool> mPaused;
|
||||||
|
bool mImageTypeNone;
|
||||||
bool mMediaViewerMode;
|
bool mMediaViewerMode;
|
||||||
bool mScreensaverMode;
|
bool mScreensaverMode;
|
||||||
bool mTargetIsMax;
|
bool mTargetIsMax;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue