9#include <QAbstractItemModel>
17#include <QtQml/qqmlregistration.h>
104 void rebuildDescriptors();
105 void updateTimerFires();
106 void updateGameplayTimerFires();
107 void updateSelectInfoTimerFires();
110 struct TimerSnapshot {
119 QVector<lr2skin::runtime::Dst> dsts;
121 bool elementActive =
true;
122 QVariantList elementActiveOptions;
124 TimerSnapshot timers;
127 struct LaneDescriptor {
128 QVector<lr2skin::runtime::Dst> dsts;
133 QVariant modelData(
int row,
const char* roleName)
const;
134 QVariantList modelListProperty(
const char* name)
const;
135 LaneDescriptor buildLaneDescriptor(
const QVariant& dsts)
const;
136 ElementDescriptor buildDescriptor(
int index,
138 const QVariant& sourceValue,
139 const QVariantList& dstValues,
140 const QVariantList&
noteDsts)
const;
141 TimerSnapshot timerSnapshotFor(
const ElementDescriptor&
descriptor)
const;
143 const QVariantList& timerFires,
149 int timerFire)
const;
150 bool laneStateUsesSkinTime(
const QVector<LaneDescriptor>& lanes,
int index)
const;
151 int laneTimerFire(
const LaneDescriptor& lane)
const;
152 QVariantList timerFiresForLanes(
const QVector<LaneDescriptor>& lanes)
const;
153 void updateNoteFieldTimerFires();
154 const ElementDescriptor* descriptorAt(
int index)
const;
155 void updateTimerFiresForIndexes(
const QVector<int>& indexes);
156 void ensureElementTimerStateCount(
int count);
157 void ensureElementNumberStateCount(
int count);
158 void ensureElementActiveOptionsStateCount(
int count);
159 void updateElementTimerState(
int index,
const TimerSnapshot& snapshot);
160 bool updateElementActiveOptionsState(
int index,
const QVariantList&
activeOptions,
bool active);
161 void updateSelectBarElementSortZ();
162 void resetElementTimerStates();
163 void resetElementNumberStates();
164 void resetElementActiveOptionsStates();
165 void reconnectSkinModel();
166 void reconnectTimerState();
167 void refreshActiveOptions(
const QVector<int>& changedOptionIds = {});
168 void notifyElementDataChanged();
170 QPointer<QAbstractItemModel> m_skinModel;
171 QPointer<Lr2SkinTimerState> m_timerState;
172 QList<int> m_runtimeActiveOptions;
173 QSet<int> m_activeOptionSet;
175 bool m_gameplayScreen =
false;
176 qreal m_selectBarElementSortBase = 0.0;
177 QVector<ElementDescriptor> m_descriptors;
178 int m_descriptorRevision = 0;
179 QVector<Lr2SkinElementTimerState*> m_elementTimerStates;
180 QVector<Lr2SkinElementNumberState*> m_elementNumberStates;
181 QVector<Lr2SkinElementActiveOptionsState*> m_elementActiveOptionsStates;
182 std::array<QVector<int>, 8> m_numberDescriptorIndexesByDependency;
183 QVector<int> m_numberRefreshIndexMarks;
184 int m_numberRefreshMark = 0;
185 QVector<int> m_activeOptionDescriptorIndexes;
186 QHash<int, QVector<int>> m_activeOptionDescriptorIndexesByOption;
187 QVector<int> m_activeOptionRefreshIndexMarks;
188 int m_activeOptionRefreshMark = 0;
189 QVector<int> m_timerDescriptorIndexes;
190 QVector<int> m_selectInfoTimerDescriptorIndexes;
191 QHash<int, QVector<int>> m_timerDescriptorIndexesByTimer;
192 QSet<int> m_noteFieldTimerIds;
193 QVector<LaneDescriptor> m_noteLaneDescriptors;
194 QVector<LaneDescriptor> m_lineLaneDescriptors;
195 QVariantList m_noteDstTimerFires;
196 QVariantList m_lineDstTimerFires;
197 bool m_noteFieldUsesActiveOptions =
false;
198 bool m_usesGameplayHitEvents =
false;
199 QList<QMetaObject::Connection> m_skinModelConnections;
200 QList<QMetaObject::Connection> m_timerStateConnections;
ReplaySource source
Definition BeatorajaReplayImporter.cpp:71
Type type
Definition BmsNotesData.cpp:33
double value
Definition BmsNotesData.cpp:35
QMap< int, QVariantList > noteDsts
Definition Lr2SkinParser.cpp:130
std::set< int > activeOptions
Definition Lr2SkinParser.cpp:143
int count
Definition Lr2SkinParser.cpp:1067
zip_uint64_t index
Definition SongAssetStore.cpp:436
Definition Lr2SkinElementActiveOptionsState.h:8
Definition Lr2SkinElementDescriptorValue.h:7
Definition Lr2SkinElementNumberState.h:6
Definition Lr2SkinElementTimerState.h:5
Definition Lr2SkinRuntime.h:23
QList< int > runtimeActiveOptions
Definition Lr2SkinRuntime.h:27
Q_INVOKABLE void refreshGameplayNumbers(int dirtyMask)
Definition Lr2SkinRuntime.cpp:356
void elementTimerStatesChanged()
void runtimeActiveOptionsChanged()
Q_INVOKABLE bool noteDstStateUsesSkinTime(int index) const
Definition Lr2SkinRuntime.cpp:316
void setTimerState(Lr2SkinTimerState *value)
Definition Lr2SkinRuntime.cpp:157
void setSkinModel(QObject *model)
Definition Lr2SkinRuntime.cpp:112
void setGameplayScreen(bool value)
Definition Lr2SkinRuntime.cpp:184
QML_ELEMENTQObject * skinModel
Definition Lr2SkinRuntime.h:26
void gameplayScreenChanged()
void setScreenKey(const QString &value)
Definition Lr2SkinRuntime.cpp:171
void usesGameplayHitEventsChanged()
Q_INVOKABLE bool dstTimerCanFire(int index) const
Definition Lr2SkinRuntime.cpp:334
Q_INVOKABLE int srcTimerFire(int index) const
Definition Lr2SkinRuntime.cpp:329
bool noteFieldUsesActiveOptions
Definition Lr2SkinRuntime.h:37
Q_INVOKABLE Lr2TimelineStateValue noteDstStateForTimerFire(int index, int skinTime, int timerFire) const
Definition Lr2SkinRuntime.cpp:302
Q_INVOKABLE Lr2TimelineStateValue lineDstStateForTimerFire(int index, int skinTime, int timerFire) const
Definition Lr2SkinRuntime.cpp:309
Q_INVOKABLE QVariantList elementActiveOptionsForElement(int index) const
Definition Lr2SkinRuntime.cpp:246
Lr2SkinTimerState * timerState
Definition Lr2SkinRuntime.h:28
QVariantList lineDstTimerFires
Definition Lr2SkinRuntime.h:36
Q_INVOKABLE Lr2SkinElementActiveOptionsState * elementActiveOptionsState(int index) const
Definition Lr2SkinRuntime.cpp:251
bool gameplayScreen
Definition Lr2SkinRuntime.h:30
void elementDescriptorsChanged()
Q_INVOKABLE int dstTimerFire(int index) const
Definition Lr2SkinRuntime.cpp:324
Q_INVOKABLE bool srcTimerCanFire(int index) const
Definition Lr2SkinRuntime.cpp:339
void selectBarElementSortBaseChanged()
Q_INVOKABLE Lr2SkinElementNumberState * elementNumberState(int index) const
Definition Lr2SkinRuntime.cpp:350
Q_INVOKABLE Lr2TimelineStateValue stateForElement(int index, int skinTime) const
Definition Lr2SkinRuntime.cpp:269
QString screenKey
Definition Lr2SkinRuntime.h:29
QVariantList noteDstTimerFires
Definition Lr2SkinRuntime.h:35
bool usesGameplayHitEvents
Definition Lr2SkinRuntime.h:38
Q_INVOKABLE Lr2TimelineStateValue noteDstState(int index, int skinTime) const
Definition Lr2SkinRuntime.cpp:294
Q_INVOKABLE Lr2TimelineStateValue staticStateForElement(int index) const
Definition Lr2SkinRuntime.cpp:257
Q_INVOKABLE Lr2SkinElementDescriptorValue descriptor(int index) const
Definition Lr2SkinRuntime.cpp:240
Q_INVOKABLE Lr2TimelineStateValue lineDstState(int index, int skinTime) const
Definition Lr2SkinRuntime.cpp:298
void setSelectBarElementSortBase(qreal value)
Definition Lr2SkinRuntime.cpp:197
void noteFieldUsesActiveOptionsChanged()
Q_INVOKABLE Lr2TimelineStateValue sliderTrackStateForElement(int index, int skinTime) const
Definition Lr2SkinRuntime.cpp:281
QVariantList elementTimerStates
Definition Lr2SkinRuntime.h:34
Q_INVOKABLE QObject * elementTimerState(int index) const
Definition Lr2SkinRuntime.cpp:344
void setRuntimeActiveOptions(const QList< int > &value)
Definition Lr2SkinRuntime.cpp:127
void lineDstTimerFiresChanged()
int descriptorRevision
Definition Lr2SkinRuntime.h:33
void noteDstTimerFiresChanged()
QVariantList elementDescriptors
Definition Lr2SkinRuntime.h:32
Q_INVOKABLE bool lineDstStateUsesSkinTime(int index) const
Definition Lr2SkinRuntime.cpp:320
qreal selectBarElementSortBase
Definition Lr2SkinRuntime.h:31
Definition Lr2SkinTimerState.h:17
Definition Lr2TimelineStateValue.h:8
Definition Lr2SkinRuntimeTypes.h:113
Definition Lr2SkinRuntimeTypes.h:59