RhythmGame 1.4.3
Loading...
Searching...
No Matches
Lr2SelectVisualState.h
Go to the documentation of this file.
1#pragma once
2
3#include <QObject>
4#include <QtQml/qqmlregistration.h>
5
6class Lr2SelectVisualState : public QObject {
7 Q_OBJECT
8 QML_ELEMENT
9 Q_PROPERTY(qreal visualIndex READ visualIndex WRITE setVisualIndex NOTIFY visualIndexChanged)
13 Q_PROPERTY(int fixed READ fixed NOTIFY fixedChanged)
14 Q_PROPERTY(int rawFixed READ rawFixed NOTIFY rawFixedChanged)
15 Q_PROPERTY(int baseIndex READ baseIndex NOTIFY baseIndexChanged)
17 Q_PROPERTY(qreal offset READ offset NOTIFY offsetChanged)
19
20public:
21 explicit Lr2SelectVisualState(QObject* parent = nullptr);
22
23 qreal visualIndex() const;
24 void setVisualIndex(qreal value);
25
26 int logicalCount() const;
27 void setLogicalCount(int value);
28
29 int scrollDirection() const;
30 void setScrollDirection(int value);
31
32 int scrollDownDirection() const;
34
35 int fixed() const;
36 int rawFixed() const;
37 int baseIndex() const;
38 int cursorBaseIndex() const;
39 qreal offset() const;
40 bool animationRunning() const;
41
42 Q_INVOKABLE void jumpTo(qreal value);
43 Q_INVOKABLE void startAnimation(qreal from, qreal to, int durationMs, qreal nowMs);
44 Q_INVOKABLE bool advanceAnimation(qreal nowMs);
45 Q_INVOKABLE void stopAnimation();
46
47signals:
60
61private:
62 void setVisualIndexValue(qreal value);
63 void recompute();
64
65 qreal m_visualIndex = 0.0;
66 int m_logicalCount = 0;
67 int m_scrollDirection = 0;
68 int m_scrollDownDirection = 2;
69 int m_fixed = 0;
70 int m_rawFixed = 0;
71 int m_baseIndex = 0;
72 int m_cursorBaseIndex = 0;
73 qreal m_offset = 0.0;
74 bool m_animationRunning = false;
75 qreal m_animationFrom = 0.0;
76 qreal m_animationTo = 0.0;
77 qreal m_animationStartMs = 0.0;
78 qreal m_animationEndMs = 0.0;
79};
double value
Definition BmsNotesData.cpp:35
Definition Lr2SelectVisualState.h:6
int scrollDirection
Definition Lr2SelectVisualState.h:11
int scrollDownDirection
Definition Lr2SelectVisualState.h:12
int rawFixed
Definition Lr2SelectVisualState.h:14
void setLogicalCount(int value)
Definition Lr2SelectVisualState.cpp:30
void scrollDownDirectionChanged()
QML_ELEMENTqreal visualIndex
Definition Lr2SelectVisualState.h:9
void animationRunningChanged()
int fixed
Definition Lr2SelectVisualState.h:13
qreal offset
Definition Lr2SelectVisualState.h:17
Q_INVOKABLE bool advanceAnimation(qreal nowMs)
Definition Lr2SelectVisualState.cpp:117
Q_INVOKABLE void jumpTo(qreal value)
Definition Lr2SelectVisualState.cpp:90
void setScrollDownDirection(int value)
Definition Lr2SelectVisualState.cpp:57
int baseIndex
Definition Lr2SelectVisualState.h:15
int cursorBaseIndex
Definition Lr2SelectVisualState.h:16
void setScrollDirection(int value)
Definition Lr2SelectVisualState.cpp:44
void setVisualIndex(qreal value)
Definition Lr2SelectVisualState.cpp:12
Q_INVOKABLE void startAnimation(qreal from, qreal to, int durationMs, qreal nowMs)
Definition Lr2SelectVisualState.cpp:95
Q_INVOKABLE void stopAnimation()
Definition Lr2SelectVisualState.cpp:136
int logicalCount
Definition Lr2SelectVisualState.h:10
bool animationRunning
Definition Lr2SelectVisualState.h:18