Go to the documentation of this file.
9 #define LOC QString("Transition: ")
13 : m_duration(
gCoreContext->GetDurSetting<std::chrono::milliseconds>(
"GalleryTransitionTime", 1s))
35 result =
m_map.value(value--,
nullptr);
41 LOG(VB_GENERAL, LOG_CRIT,
42 LOC + QString(
"No transitions found for setting %1").arg(setting));
59 if (includeAnimations)
82 bool forwards,
float speed)
84 LOG(VB_FILE, LOG_DEBUG,
LOC +
85 QString(
"Starting transition %1 -> %2 (forwards= %3, speed= %4)")
86 .arg(from.objectName(), to.objectName()).arg(forwards).arg(speed));
115 LOG(VB_FILE, LOG_DEBUG,
LOC +
116 QString(
"Finished transition to %1").arg(
m_new->objectName()));
130 bool forwards,
float speed)
171 bool forwards,
float speed)
210 oldPic->Set(255, 0,
m_duration, QEasingCurve::InOutQuad);
215 newPic->Set(0, 255,
m_duration, QEasingCurve::InOutQuad);
240 oldPic->Set(1.0, 0.0,
m_duration / 2, QEasingCurve::InQuart);
245 newPic->Set(0.0, 1.0,
m_duration / 2, QEasingCurve::OutQuart);
273 oldPic->Set(QPoint(0, 0), QPoint(-width, 0),
m_duration, QEasingCurve::InOutQuart);
278 newPic->Set(QPoint(width, 0), QPoint(0, 0),
m_duration, QEasingCurve::InOutQuart);
306 oldZoom->Set(1.0, 0.0,
m_duration, QEasingCurve::OutQuad);
310 oldMove->Set(QPoint(0, 0), QPoint(-width / 2, 0),
m_duration,
311 QEasingCurve::InQuad);
316 newZoom->Set(0.0, 1.0,
m_duration, QEasingCurve::InQuad);
320 newMove->Set(QPoint(width / 2, 0), QPoint(0, 0),
m_duration,
321 QEasingCurve::OutQuad);
351 an->Set(0.0, 360.1,
m_duration, QEasingCurve::InOutQuad);
355 an->Set(0.0, 360.1,
m_duration, QEasingCurve::InOutQuad);
363 an->Set(1.0, 0.5,
m_duration / 2, QEasingCurve::InOutQuad);
367 an->Set(0.5, 1.0,
m_duration / 2, QEasingCurve::InOutQuad);
375 an->Set(1.0, 0.5,
m_duration / 2, QEasingCurve::InOutQuad);
379 an->Set(0.5, 1.0,
m_duration / 2, QEasingCurve::InOutQuad);
423 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()