wavelength 1.0.0
Loading...
Searching...
No Matches
scratchtrackdata.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5
6#include "gs/scratcher.h"
7#include "mid/tickobj.h"
8
16public:
18 static constexpr int kSetSize = 3;
19
21 struct ScratcherSet {
22 std::unique_ptr<Scratcher> mScratchers[kSetSize];
23 };
24
32 explicit ScratchTrackData(int nEndTick);
33
41
53 void SetScratcher(int nTick, int nIndex, Scratcher *pScratcher);
54
68 int
69 GetScratchers(int nTick, Scratcher **ppFirst, Scratcher **ppSecond, Scratcher **ppThird) const;
70
72 int GetEndTick() const {
73 return mEndTick;
74 }
75
76private:
77 std::vector<TickObj<ScratcherSet>> mSets;
78 int mEndTick;
79};
static constexpr int kSetSize
The number of scratchers in a set.
Definition scratchtrackdata.h:18
~ScratchTrackData()
Release every scratcher.
int GetScratchers(int nTick, Scratcher **ppFirst, Scratcher **ppSecond, Scratcher **ppThird) const
Report the scratchers of the set that plays at a tick.
ScratchTrackData(int nEndTick)
Construct empty data.
void SetScratcher(int nTick, int nIndex, Scratcher *pScratcher)
Place a scratcher in the set that starts at a tick, creating the set when none starts there.
int GetEndTick() const
Definition scratchtrackdata.h:72
Player of the three recorded pieces one scratch button plays.
Definition scratcher.h:20
The scratchers that play from one tick on, deleted with the data.
Definition scratchtrackdata.h:21
std::unique_ptr< Scratcher > mScratchers[kSetSize]
Definition scratchtrackdata.h:22