mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Added a 'fadeInType' property to the video element
This commit is contained in:
parent
ec7253a602
commit
61e671501c
|
@ -383,6 +383,7 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
|
|||
{"pillarboxThreshold", NORMALIZED_PAIR},
|
||||
{"scanlines", BOOLEAN},
|
||||
{"delay", FLOAT},
|
||||
{"fadeInType", STRING},
|
||||
{"fadeInTime", FLOAT},
|
||||
{"scrollFadeIn", BOOLEAN},
|
||||
{"brightness", FLOAT},
|
||||
|
|
|
@ -26,6 +26,7 @@ VideoComponent::VideoComponent()
|
|||
, mColorShiftEnd {0xFFFFFFFF}
|
||||
, mVideoCornerRadius {0.0f}
|
||||
, mColorGradientHorizontal {true}
|
||||
, mRenderBlackFrame {true}
|
||||
, mTargetSize {0.0f, 0.0f}
|
||||
, mCropPos {0.5f, 0.5f}
|
||||
, mImageCropPos {0.5f, 0.5f}
|
||||
|
@ -328,6 +329,21 @@ void VideoComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
if (mConfig.startDelay != 0)
|
||||
mConfig.showStaticImageDelay = true;
|
||||
|
||||
if (elem->has("fadeInType")) {
|
||||
const std::string& fadeInType {elem->get<std::string>("fadeInType")};
|
||||
if (fadeInType == "black") {
|
||||
mRenderBlackFrame = true;
|
||||
}
|
||||
else if (fadeInType == "transparent") {
|
||||
mRenderBlackFrame = false;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "VideoComponent: Invalid theme configuration, property "
|
||||
"\"fadeInType\" for element \""
|
||||
<< element.substr(6) << "\" defined as \"" << fadeInType << "\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (properties && elem->has("fadeInTime"))
|
||||
mFadeInTime = glm::clamp(elem->get<float>("fadeInTime"), 0.0f, 8.0f) * 1000.0f;
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ protected:
|
|||
unsigned int mColorShiftEnd;
|
||||
float mVideoCornerRadius;
|
||||
bool mColorGradientHorizontal;
|
||||
bool mRenderBlackFrame;
|
||||
glm::vec2 mTargetSize;
|
||||
glm::vec2 mCropPos;
|
||||
glm::vec2 mImageCropPos;
|
||||
|
|
|
@ -217,7 +217,7 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
|
|||
mRenderer->setMatrix(parentTrans);
|
||||
}
|
||||
|
||||
if (!mScreensaverMode && !mMediaViewerMode) {
|
||||
if (!mScreensaverMode && !mMediaViewerMode && mRenderBlackFrame) {
|
||||
mBlackFrame.setOpacity(mOpacity * mThemeOpacity);
|
||||
mBlackFrame.render(trans);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue