resonance 1.0.1
Loading...
Searching...
No Matches
playmap.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <vector>
5
6#include "os/hxstr.h"
7
47class PlayMap {
48public:
60 void *operator new(size_t nSize);
61
69 void operator delete(void *pBlock);
70
81
89 virtual ~PlayMap() {
90 }
91
109 virtual void AddStep(int nPosition, HxStr strLabel);
110
118 virtual void SetBarCount(int nBarCount);
119
126 virtual void ResetSpans();
127
144 virtual int MapBar(int nBar) = 0;
145
159 virtual std::vector<int> &FindBarsPlaying(int nStart, int nMin, int nEnd) = 0;
160
174 virtual int MapToLinkedStep(int nPosition, int nSet);
175
182 virtual int GetLength() const;
183
192 virtual int GetEndBar();
193
200 virtual int GetNumSections() const;
201
212 virtual int GetPatternSection(int nIndex);
213
227 virtual int GetPatternIndex(int nBar);
228
242 virtual int GetAbsoluteSectionIndex(int nBar);
243
255 virtual int IsLooping(int nBar);
256
268 virtual void CloseSpan(int nRepeats);
269
280 virtual int EndLoop(int nBar);
281
292 virtual int StartLoop(int nBar);
293
303 virtual int ToggleLoop(int nBar);
304
316 int FindStepIndex(int nPosition);
317
327 int IsStepStart(int nBar);
328
337 int StepStartBar(int nBar);
338
348 int NextStepBar(int nBar);
349
359 int FollowingStepBar(int nBar);
360
369
379 std::vector<int> mSteps;
380
388 std::vector<int> mSectionLengths;
389
396 std::vector<HxStr> mSectionNames;
397
398protected:
399 // Zeroed by the constructor. No routine of the class or its subclasses reads it.
400 int mUnusedValue; // +0x28
401 // The bars FindBarsPlaying() collects and returns by reference.
402 std::vector<int> mFoundBars; // +0x2c
403};
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
virtual int GetLength() const
Slot 8.
virtual int MapToLinkedStep(int nPosition, int nSet)
Slot 7.
int mUnusedValue
Definition playmap.h:400
PlayMap()
Construct an empty map whose first step is at zero.
virtual int GetAbsoluteSectionIndex(int nBar)
Slot 13.
int IsStepStart(int nBar)
Report whether a bar maps exactly onto a step.
virtual void ResetSpans()
Slot 4.
virtual int GetNumSections() const
Slot 10.
int FindStepIndex(int nPosition)
Report the index of the step at or before a position that has already been mapped.
virtual std::vector< int > & FindBarsPlaying(int nStart, int nMin, int nEnd)=0
Slot 6.
virtual int StartLoop(int nBar)
Slot 17.
std::vector< int > mFoundBars
Definition playmap.h:402
virtual int EndLoop(int nBar)
Slot 16.
std::vector< int > mSteps
Ascending sequence of positions.
Definition playmap.h:379
virtual int IsLooping(int nBar)
Slot 14.
int FollowingStepBar(int nBar)
Report the bar at which the first step strictly after a bar begins.
std::vector< HxStr > mSectionNames
Label of each section, the one AddStep() receives with the step.
Definition playmap.h:396
virtual int ToggleLoop(int nBar)
Slot 18.
std::vector< int > mSectionLengths
Length of each section, the gap between one step and the previous one.
Definition playmap.h:388
int NextStepBar(int nBar)
Report the bar at which the first step at or after a bar begins.
virtual int GetEndBar()
Slot 9.
virtual int GetPatternIndex(int nBar)
Slot 12.
virtual void CloseSpan(int nRepeats)
Slot 15.
virtual int GetPatternSection(int nIndex)
Slot 11.
virtual void AddStep(int nPosition, HxStr strLabel)
Slot 2.
virtual ~PlayMap()
Inline.
Definition playmap.h:89
int StepStartBar(int nBar)
Report the bar at which the step containing a bar began.
virtual int MapBar(int nBar)=0
Slot 5.
virtual void SetBarCount(int nBarCount)
Slot 3.
int mBarCount
The number of bars SetBarCount() stores.
Definition playmap.h:368