wavelength 1.0.0
Loading...
Searching...
No Matches
pitchtrackgems.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "game/pitchgem.h"
7#include "game/slotgrid.h"
8#include "os/binstream.h"
9
18public:
20 struct SecStats {
21 int mOwner;
23 };
24
36 SlotGrid *pPatterns,
37 int nNumBars,
38 int nTicksPerBar);
39
47
58 bool AddGem(signed char nSlot, int nTick, signed char nOwner);
59
68 bool RemoveGem(int nTick);
69
80 bool ToggleGem(signed char nSlot, int nTick, signed char nOwner);
81
90 int GetOwner(int nBar);
91
99 void ClearBar(int nBar);
100
108 void ClearSection(int nSection);
109
119 void CopyBars(int nStartBar, int nEndBar, int nDestBar);
120
131 void CopyBarsFrom(int nStartBar, int nEndBar, PitchTrackGems *pSource, int nOwner);
132
145 void CopyBars(int nStartBar, int nEndBar, int nDestBar, PitchTrackGems *pSource, int nOwner);
146
154
163 std::vector<PitchGem> *GetBar(int nBar);
164
174 int CountGems(int nStartBar, int nEndBar);
175
183 void Save(BinStream &stream);
184
194 void Load(BinStream &stream);
195
196private:
205 void AddOwner(int nOwner, int nBar);
206
217 void RemoveOwner(int nOwner, int nBar);
218
219 int mTicksPerBar;
220 SectionBoundaries *mSections;
221 SlotGrid *mPatterns;
222 std::vector<SecStats> mSecStats;
223 std::vector<std::vector<PitchGem>> mBars;
224};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
void Save(BinStream &stream)
Write the gems of the sections that repeat no pattern.
PitchTrackGems(SectionBoundaries *pSections, SlotGrid *pPatterns, int nNumBars, int nTicksPerBar)
Construct a track of bars with no gems.
void CopyBarsFrom(int nStartBar, int nEndBar, PitchTrackGems *pSource, int nOwner)
Copy the gems of a range of bars of other gems to the same bars.
void CopyBars(int nStartBar, int nEndBar, int nDestBar)
Copy the gems of a range of bars to other bars.
bool AddGem(signed char nSlot, int nTick, signed char nOwner)
Place a gem, replacing a gem at the same tick.
void Load(BinStream &stream)
Replace every gem with the gems Save() wrote.
bool ToggleGem(signed char nSlot, int nTick, signed char nOwner)
Remove the gem at a tick when it lies under the same gem button, and place it otherwise.
int GetOwner(int nBar)
Report the owner of the section a bar lies in.
void ClearBar(int nBar)
Remove every gem of a bar.
int CountGems(int nStartBar, int nEndBar)
Count the gems of a range of bars.
void ApplyPatterns()
Copy the gems of each section's pattern into the section.
bool RemoveGem(int nTick)
Remove the gem at a tick.
std::vector< PitchGem > * GetBar(int nBar)
Report the gems of a bar.
void CopyBars(int nStartBar, int nEndBar, int nDestBar, PitchTrackGems *pSource, int nOwner)
Copy the gems of a range of bars of other gems, and record the owners of the sections the copies land...
~PitchTrackGems()
Release the gems.
void ClearSection(int nSection)
Remove every gem of a section and its owner.
Ascending list of the measures at which the sections of a song end.
Definition sectionboundaries.h:12
The pattern each section of a remixed song repeats, as the section the pattern comes from.
Definition slotgrid.h:10
The owner of a section, and the number of gems that record the owner.
Definition pitchtrackgems.h:20
int mOwner
Definition pitchtrackgems.h:21
int mNumGems
Definition pitchtrackgems.h:22