Go to the documentation of this file.
8 #define LOC QString("Transition: ")
12 : m_duration(
gCoreContext->GetDurSetting<std::chrono::milliseconds>(
"GalleryTransitionTime", 1s))
34 result =
m_map.value(value--,
nullptr);
40 LOG(VB_GENERAL, LOG_CRIT,
41 LOC + QString(
"No transitions found for setting %1").arg(setting));
58 if (includeAnimations)
81 bool forwards,
float speed)
83 LOG(VB_FILE, LOG_DEBUG,
LOC +
84 QString(
"Starting transition %1 -> %2 (forwards= %3, speed= %4)")
85 .arg(from.objectName(), to.objectName()).arg(forwards).arg(speed));
114 LOG(VB_FILE, LOG_DEBUG,
LOC +
115 QString(
"Finished transition to %1").arg(
m_new->objectName()));
129 bool forwards,
float speed)
170 bool forwards,
float speed)
209 oldPic->Set(255, 0,
m_duration, QEasingCurve::InOutQuad);
214 newPic->Set(0, 255,
m_duration, QEasingCurve::InOutQuad);
239 oldPic->Set(1.0, 0.0,
m_duration / 2, QEasingCurve::InQuart);
244 newPic->Set(0.0, 1.0,
m_duration / 2, QEasingCurve::OutQuart);
272 oldPic->Set(QPoint(0, 0), QPoint(-width, 0),
m_duration, QEasingCurve::InOutQuart);
277 newPic->Set(QPoint(width, 0), QPoint(0, 0),
m_duration, QEasingCurve::InOutQuart);
305 oldZoom->Set(1.0, 0.0,
m_duration, QEasingCurve::OutQuad);
309 oldMove->Set(QPoint(0, 0), QPoint(-width / 2, 0),
m_duration,
310 QEasingCurve::InQuad);
315 newZoom->Set(0.0, 1.0,
m_duration, QEasingCurve::InQuad);
319 newMove->Set(QPoint(width / 2, 0), QPoint(0, 0),
m_duration,
320 QEasingCurve::OutQuad);
350 an->Set(0.0, 360.1,
m_duration, QEasingCurve::InOutQuad);
354 an->Set(0.0, 360.1,
m_duration, QEasingCurve::InOutQuad);
362 an->Set(1.0, 0.5,
m_duration / 2, QEasingCurve::InOutQuad);
366 an->Set(0.5, 1.0,
m_duration / 2, QEasingCurve::InOutQuad);
374 an->Set(1.0, 0.5,
m_duration / 2, QEasingCurve::InOutQuad);
378 an->Set(0.5, 1.0,
m_duration / 2, QEasingCurve::InOutQuad);
422 disconnect(
m_current,
nullptr,
nullptr,
nullptr);
A specialised image for slideshows.
void SetZoom(float zoom)
Sets slide zoom.
virtual void Finished()
Transition has completed.
void Initialise() override
Set up Twist transition.
GroupTransition(GroupAnimation *animation, const QString &name)
Create group transition.
Transition * m_current
Selected transition.
void Finalise() override
Reset Zoom transition.
QList< Transition * > m_peers
Set of distinct transitions.
void Finalise() override
Reset Spin transition.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Slide * m_new
The new image that will replace the current one (whatever the transition direction)
Base class of an animated transition that can be accelerated & reversed.
void Initialise() override
Set up Slide transition.
GroupAnimation * m_animation
void Finalise() override
Reset Blend transition.
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Zooms from right, then away to left.
Provides transitions for slideshows.
void SetAlpha(int newalpha)
void Finalise() override
Reset Twist transition.
Transition(const QString &name)
void Finalise() override
Reset Slide transition.
Abstract class for groups of animations.
~GroupTransition() override
Destroy group transition.
virtual void Start(Slide &from, Slide &to, bool forwards, float speed=1.0)
Start base transition.
void SetPosition(int x, int y)
Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality...
void Start(Slide &from, Slide &to, bool forwards, float speed=1.0) override
Switch images.
void Start(bool forwards, float speed=1.0) override
Initialise & start base animation.
void Finished() override
Invoked when peer transition completes.
Switches images instantly with no effects.
Invokes random transitions.
void Initialise() override
Set up Blend transition.
Images blend whilst rotating.
void Start(Slide &from, Slide &to, bool forwards, float speed=1.0) override
Starts a random transition from a set of its peer transitions,.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void Pulse() override
Update group transition.
Slide on from right, then off to left.
std::chrono::milliseconds m_duration
Seconds transition will last.
Image twists into the next.
A group of animations to be played sequentially.
A single animation controlling alpha, zoom, rotation and position.
Slide * m_next
The image occurring later in the slideshow sequence.
void Initialise() override
Set up Spin transition.
void SetSpeed(float speed) override
TransitionNone m_immediate
A transition that updates instantly.
virtual void Add(AbstractAnimation *child)
Add child animation to group.
void Start(Slide &from, Slide &to, bool forwards, float speed=1.0) override
Start group transition.
virtual void SetVisible(bool visible)
TransitionRegistry(bool includeAnimations)
Constructor.
Transition & Select(int setting)
Returns the requested transition or an alternative if it is not suitable for the painter.
void SetSpeed(float speed) override
Change transition speed.
void SetHorizontalZoom(float zoom)
void Clear() override
Delete all child animations.
Slide * m_prev
The image occurring earlier in the slideshow sequence.
void SetAngle(float angle)
Slide * m_old
The image currently displayed, which will be replaced (whatever the transition direction)
void Initialise() override
Set up Zoom transition.
uint32_t MythRandom()
generate 32 random bits
void finished()
Signals animation has finished.
TransitionMap m_map
All possible transitions.
Image blends into the next by fading.
virtual void Initialise()