RhythmGame 1.4.3
Loading...
Searching...
No Matches
Lr2BarInterpolatedState.h
Go to the documentation of this file.
1#pragma once
2
4#include "Lr2BarPositionMap.h"
6
7#include <QMetaObject>
8#include <QObject>
9#include <QPointer>
10#include <QtQml/qqmlregistration.h>
11
12class Lr2BarInterpolatedState : public QObject {
13 Q_OBJECT
14 QML_ELEMENT
17 Q_PROPERTY(int row READ row WRITE setRow NOTIFY rowChanged)
18 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
19 Q_PROPERTY(bool valid READ isValid NOTIFY stateChanged)
20 Q_PROPERTY(qreal x READ x NOTIFY stateChanged)
21 Q_PROPERTY(qreal y READ y NOTIFY stateChanged)
22 Q_PROPERTY(qreal w READ w NOTIFY stateChanged)
23 Q_PROPERTY(qreal h READ h NOTIFY stateChanged)
24 Q_PROPERTY(qreal a READ a NOTIFY stateChanged)
25 Q_PROPERTY(qreal r READ r NOTIFY stateChanged)
26 Q_PROPERTY(qreal g READ g NOTIFY stateChanged)
27 Q_PROPERTY(qreal b READ b NOTIFY stateChanged)
28 Q_PROPERTY(qreal angle READ angle NOTIFY stateChanged)
29 Q_PROPERTY(qreal center READ center NOTIFY stateChanged)
30 Q_PROPERTY(qreal sortId READ sortId NOTIFY stateChanged)
31 Q_PROPERTY(qreal blend READ blend NOTIFY stateChanged)
32 Q_PROPERTY(qreal filter READ filter NOTIFY stateChanged)
33 Q_PROPERTY(qreal op1 READ op1 NOTIFY stateChanged)
34 Q_PROPERTY(qreal op2 READ op2 NOTIFY stateChanged)
35 Q_PROPERTY(qreal op3 READ op3 NOTIFY stateChanged)
36 Q_PROPERTY(qreal op4 READ op4 NOTIFY stateChanged)
37
38public:
39 explicit Lr2BarInterpolatedState(QObject* parent = nullptr);
40
43
46
47 int row() const;
48 void setRow(int row);
49
50 bool isEnabled() const;
51 void setEnabled(bool enabled);
52
53 bool isValid() const;
54 qreal x() const;
55 qreal y() const;
56 qreal w() const;
57 qreal h() const;
58 qreal a() const;
59 qreal r() const;
60 qreal g() const;
61 qreal b() const;
62 qreal angle() const;
63 qreal center() const;
64 qreal sortId() const;
65 qreal blend() const;
66 qreal filter() const;
67 qreal op1() const;
68 qreal op2() const;
69 qreal op3() const;
70 qreal op4() const;
71
72signals:
75 void rowChanged();
78
79private:
81
82 static bool sameReal(qreal lhs, qreal rhs);
83 static State hiddenState();
84 static State visibleState(const State& state);
85 static State interpolate(const State& from, const State& to, qreal progress);
86
87 void updateState();
88 bool assignState(const State& state);
89
90 QPointer<Lr2BarPositionMap> m_positionMap;
91 QMetaObject::Connection m_coordinatesConnection;
92 QPointer<Lr2BarBaseStateResolver> m_baseStateResolver;
93 QMetaObject::Connection m_baseStateResolverConnection;
94 State m_state;
95 int m_row = -1;
96 bool m_enabled = true;
97};
Definition Lr2BarBaseStateResolver.h:13
Definition Lr2BarInterpolatedState.h:12
qreal h
Definition Lr2BarInterpolatedState.h:23
qreal y
Definition Lr2BarInterpolatedState.h:21
Lr2BarPositionMap * positionMap
Definition Lr2BarInterpolatedState.h:16
qreal b
Definition Lr2BarInterpolatedState.h:27
QML_ELEMENTLr2BarBaseStateResolver * baseStateResolver
Definition Lr2BarInterpolatedState.h:15
qreal blend
Definition Lr2BarInterpolatedState.h:31
qreal center
Definition Lr2BarInterpolatedState.h:29
void setEnabled(bool enabled)
Definition Lr2BarInterpolatedState.cpp:82
int row
Definition Lr2BarInterpolatedState.h:17
qreal g
Definition Lr2BarInterpolatedState.h:26
qreal angle
Definition Lr2BarInterpolatedState.h:28
bool valid
Definition Lr2BarInterpolatedState.h:19
qreal op1
Definition Lr2BarInterpolatedState.h:33
qreal r
Definition Lr2BarInterpolatedState.h:25
qreal sortId
Definition Lr2BarInterpolatedState.h:30
void setRow(int row)
Definition Lr2BarInterpolatedState.cpp:69
qreal x
Definition Lr2BarInterpolatedState.h:20
bool isEnabled() const
Definition Lr2BarInterpolatedState.cpp:78
void setBaseStateResolver(Lr2BarBaseStateResolver *resolver)
Definition Lr2BarInterpolatedState.cpp:13
qreal op2
Definition Lr2BarInterpolatedState.h:34
bool isValid() const
Definition Lr2BarInterpolatedState.cpp:91
qreal a
Definition Lr2BarInterpolatedState.h:24
qreal w
Definition Lr2BarInterpolatedState.h:22
qreal filter
Definition Lr2BarInterpolatedState.h:32
bool enabled
Definition Lr2BarInterpolatedState.h:18
qreal op3
Definition Lr2BarInterpolatedState.h:35
void setPositionMap(Lr2BarPositionMap *map)
Definition Lr2BarInterpolatedState.cpp:41
qreal op4
Definition Lr2BarInterpolatedState.h:36
Definition Lr2BarPositionMap.h:12
Definition Lr2TimelineStateValue.h:8