wavelength 1.0.0
Loading...
Searching...
No Matches
catchtrackdisplay.h
Go to the documentation of this file.
1#pragma once
2
4#include "game/playmap.h"
6#include "os/command.h"
7#include "os/ptr.h"
8
17public:
23 class UpdateDisplayCmd : public Command {
24 public:
31 ~UpdateDisplayCmd() override = default;
32
38 explicit UpdateDisplayCmd(CatchTrackDisplay *pDisplay) : mDisplay(pDisplay) {
39 }
40
47 void Execute() override;
48
49 private:
50 CatchTrackDisplay *mDisplay;
51 };
52
67 const SectionBoundaries *pSections,
68 int nTrack,
69 int nIntroBars,
70 int nNumBars,
71 int nTicksPerBar,
72 PlayMap *pPlayMap);
73
81
88 void Start();
89
97 void Seek(int nTick);
98
105 void Stop();
106
115 void Redraw(int nFromBar, int nClear);
116
126 void RedrawRange(int nFromBar, int nToBar, int nClear);
127
128private:
135 void ScheduleUpdate();
136
145 void PlaceGems(int nFromBar, int nToBar);
146
156 void DrawBars(int nFromBar, int nToBar, int nVisible);
157
165 bool Advance();
166
167 CatchTrackState *mState;
168 const SectionBoundaries *mSections;
169 int mTrack;
170 int mIntroBars;
171 int mNumBars;
172 int mTicksPerBar;
173 Ptr<UpdateDisplayCmd> mUpdateCmd;
174 int mDrawnBar;
175 int mTickOffset;
176 PlayMap *mPlayMap;
177};
void Execute() override
Draw the bars that come into view, and run again a bar later until the song ends.
UpdateDisplayCmd(CatchTrackDisplay *pDisplay)
Construct the command of a display.
Definition catchtrackdisplay.h:38
~UpdateDisplayCmd() override=default
Destroy the object.
~CatchTrackDisplay()
Withdraw the scheduled update.
void RedrawRange(int nFromBar, int nToBar, int nClear)
Draw again a range of bars, limited to the bars drawn so far.
CatchTrackDisplay(CatchTrackState *pState, const SectionBoundaries *pSections, int nTrack, int nIntroBars, int nNumBars, int nTicksPerBar, PlayMap *pPlayMap)
Construct a display that has drawn nothing.
void Start()
Schedule the next update.
void Stop()
Withdraw the scheduled update.
void Redraw(int nFromBar, int nClear)
Draw again the bars from one bar up to the last bar drawn.
void Seek(int nTick)
Move the display to a tick, drawing the bars that come into view from it.
Per-bar state of one catch track during a song.
Definition catchtrackstate.h:17
Unit of work a Scheduler runs at a set time.
Definition command.h:13
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
Owner of one reference to an Attachment.
Definition ptr.h:16
Ascending list of the measures at which the sections of a song end.
Definition sectionboundaries.h:12