From f90ea6ca9c53d20352996a4d053bb6c62c0423e7 Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Tue, 4 Jun 2024 18:13:59 +0100 Subject: [PATCH] Add an easy way to get list of object definitions --- x26triplets.cpp | 5 +++++ x26triplets.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/x26triplets.cpp b/x26triplets.cpp index 75c6424..0ad3662 100644 --- a/x26triplets.cpp +++ b/x26triplets.cpp @@ -74,6 +74,10 @@ void X26TripletList::updateInternalData() ActivePosition activePosition; X26Triplet *triplet; + m_objects[0].clear(); + m_objects[1].clear(); + m_objects[2].clear(); + // Check for errors, and fill in where the Active Position goes for Level 2.5 and above for (int i=0; i < m_list.size(); i++) { triplet = &m_list[i]; @@ -140,6 +144,7 @@ void X26TripletList::updateInternalData() case 0x15: // Define Active Object case 0x16: // Define Adaptive Object case 0x17: // Define Passive Object + m_objects[triplet->modeExt() - 0x15].append(i); activePosition.reset(); // Make sure data field holds correct place of triplet // otherwise the object won't appear diff --git a/x26triplets.h b/x26triplets.h index f799449..173a439 100644 --- a/x26triplets.h +++ b/x26triplets.h @@ -96,11 +96,13 @@ public: bool isEmpty() const { return m_list.isEmpty(); } void reserve(int alloc) { m_list.reserve(alloc); } int size() const { return m_list.size(); } + const QList &objects(int t) const { return m_objects[t]; }; private: void updateInternalData(); QList m_list; + QList m_objects[3]; class ActivePosition {