Hyelicht 2.0
Controller application for the Hyelicht shelf. Paint on the shelf with colors, turn on the fireplace mode, and more.
Loading...
Searching...
No Matches
abstractanimation.h
1/*
2 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
3 * SPDX-FileCopyrightText: 2021-2024 Eike Hein <sho@eikehein.com>
4 */
5
6#pragma once
7
8#include <QTimeLine>
9#include <QPointer>
10
11#include "ledstrip.h"
12
14
28class AbstractAnimation : public QTimeLine
29{
30 Q_OBJECT
31
33
36 Q_PROPERTY(QString name READ name CONSTANT)
37
38
43 Q_PROPERTY(LedStrip* ledStrip READ ledStrip WRITE setLedStrip NOTIFY ledStripChanged)
44
45 public:
47
50 explicit AbstractAnimation(QObject *parent = nullptr);
51 virtual ~AbstractAnimation() override;
52
54
58 virtual QString name() const = 0;
59
61
69 LedStrip *ledStrip() const;
70
72
78
79 Q_SIGNALS:
81
85 void ledStripChanged() const;
86
88
93 void frameComplete() const;
94
95 protected:
96 QPointer<LedStrip> m_ledStrip;
97};
Abstract base class for LED strip animations operating on LedStrip.
Definition abstractanimation.h:29
void setLedStrip(LedStrip *ledStrip)
Set the LedStrip this animation operates on.
Definition abstractanimation.cpp:25
void frameComplete() const
Subclasses must emit this signal after they have finished painting a frame.
QString name
Name of this animation.
Definition abstractanimation.h:36
void ledStripChanged() const
The LedStrip this animation operates on has changed.
LedStrip * ledStrip
LedStrip this animation operates on.
Definition abstractanimation.h:43
QPointer< LedStrip > m_ledStrip
LedStrip instance to operate on.
Definition abstractanimation.h:96
Connects to and performs painting operations on a strip of SK9822/APA102 LEDs.
Definition ledstrip.h:45