wavelength 1.0.0
Loading...
Searching...
No Matches
voxtrack.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
6#include "game/playmap.h"
7#include "game/remixtrack.h"
9#include "game/slotgrid.h"
11#include "game/voxtrackmusic.h"
12#include "os/binstream.h"
13
21class VoxTrack : public RemixTrack {
22public:
38 PlayMap *pPlayMap,
39 SectionBoundaries *pSections,
40 SlotGrid *pPatternGrid,
41 int nTrack,
42 int nLeadInBars,
43 int nNumBars,
44 int nTicksPerBar);
45
52 ~VoxTrack() override;
53
60 void Start() override;
61
68 void Stop() override;
69
77 void SetPlayer(Player *pPlayer) override;
78
87 void HandleInput(Player *pPlayer, const PlayNoteEvent &event) override;
88
97 void HandleInput(Player *pPlayer, const BtnEvent<8> &event) override;
98
107 void HandleInput([[maybe_unused]] Player *pPlayer,
108 [[maybe_unused]] const StickEvent<2> &event) override {
109 }
110
119 void HandleInput([[maybe_unused]] Player *pPlayer,
120 [[maybe_unused]] const StickEvent<6> &event) override {
121 }
122
131 void HandleInput([[maybe_unused]] Player *pPlayer,
132 [[maybe_unused]] const BtnEvent<10> &event) override {
133 }
134
142 void SetMuteRemote(bool bMuteRemote) override;
143
151 bool GetMuteRemote() const override;
152
161 void SkipBars(int nStartBar, int nEndBar) override;
162
169 void RebuildGems() override;
170
178 void SetActive(bool bActive) override;
179
187 bool IsActive() const override;
188
196 void Redraw(int nStartBar) override;
197
205 void Save(BinStream &stream) override;
206
214 void Load(BinStream &stream) override;
215
223 void SetSection(int nSection);
224
233 void SetSectionMuted(int nSection, bool bMuted);
234
243 bool IsSectionMuted(int nSection) const;
244
245private:
253 void UpdateMute();
254
255 CatchTrackData *mGems;
256 VoxTrackDisplay mDisplay;
257 VoxTrackMusic mMusic;
258 int mMuteRemote;
259 int mActive;
260 std::vector<bool> mSectionMuted;
261 int mSection;
262 SectionBoundaries *mSections;
263 SlotGrid *mPatternGrid;
264};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Input event of a button press that names only the player.
Definition btnevent.h:15
The gems of one catch track, in the order of their ticks.
Definition catchtrackdata.h:14
Map from the bars a song plays to the bars of the song as written, with the loops that repeat stretch...
Definition playmap.h:11
Input event that plays a note on one of the three gem buttons.
Definition playnoteevent.h:10
One participant in a song: the track the participant plays, the score, and the streak.
Definition player.h:19
RemixTrack(int nIndex)
Construct a track with no player.
Definition remixtrack.h:22
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
Input event of an analog stick position.
Definition stickevent.h:15
Display of the bars and gems of a vocal track on the play field, kept a stretch of ticks ahead of the...
Definition voxtrackdisplay.h:15
Player of the gems of a vocal track, one bar of the song at a time.
Definition voxtrackmusic.h:18
void HandleInput(Player *pPlayer, const PlayNoteEvent &event) override
Play the sound of an edit the track refuses when a gem button is pressed.
VoxTrack(CatchTrackData *pGems, PlayMap *pPlayMap, SectionBoundaries *pSections, SlotGrid *pPatternGrid, int nTrack, int nLeadInBars, int nNumBars, int nTicksPerBar)
Construct the track for one song track.
void Load(BinStream &stream) override
Read the switch of each section, one byte per section.
void SetMuteRemote(bool bMuteRemote) override
Set whether the track is silent while a player on another console is on it.
void Start() override
Start the track with the song.
void Redraw(int nStartBar) override
Show the track again from a bar on.
void Stop() override
Stop the track with the song.
void SetSection(int nSection)
Set the section the song plays.
bool IsSectionMuted(int nSection) const
Report whether a section is switched off.
bool GetMuteRemote() const override
Report whether the track is silent while a player on another console is on it.
void SkipBars(int nStartBar, int nEndBar) override
Show a range of bars empty.
bool IsActive() const override
Report whether the track is the one the song's player plays.
void HandleInput(Player *pPlayer, const BtnEvent< 8 > &event) override
Play the sound of an edit the track refuses.
void HandleInput(Player *pPlayer, const StickEvent< 2 > &event) override
Ignore a stick event.
Definition voxtrack.h:107
void HandleInput(Player *pPlayer, const StickEvent< 6 > &event) override
Ignore a stick event.
Definition voxtrack.h:119
void Save(BinStream &stream) override
Write the switch of each section, one byte per section.
void SetPlayer(Player *pPlayer) override
Give the track to the player it plays for, and show the player an empty phrase on it.
void HandleInput(Player *pPlayer, const BtnEvent< 10 > &event) override
Ignore a button event.
Definition voxtrack.h:131
~VoxTrack() override
Release the track.
void SetActive(bool bActive) override
Set whether the track is the one the song's player plays, which silences it.
void RebuildGems() override
Copy the switch of each section's pattern into the section.
void SetSectionMuted(int nSection, bool bMuted)
Switch a section off or on.