forked from NaiJi/project-kyoku
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
3 years ago
|
#pragma once
|
||
|
|
||
|
#include <vector>
|
||
|
#include "timeline.h"
|
||
|
|
||
|
class Note;
|
||
|
|
||
|
class ClassicTimeline : public Timeline
|
||
|
{
|
||
|
public:
|
||
|
explicit ClassicTimeline();
|
||
|
virtual void update(const microsec& music_offset) override;
|
||
|
virtual void init() override;
|
||
|
virtual void clear() override;
|
||
|
|
||
|
Note *getActiveNote(const microsec &music_offset) noexcept;
|
||
|
|
||
|
private:
|
||
|
std::vector<Note*> _timeline;
|
||
|
std::vector<Note*>::const_iterator _top_note;
|
||
|
Note* _active_note;
|
||
|
|
||
|
std::vector<Note*>::const_iterator _last_visible_note;
|
||
|
microsec _visibility_offset;
|
||
|
|
||
|
void checkCurrentActiveNote(const microsec &music_offset);
|
||
|
void checkForNextActiveNote(const microsec &music_offset);
|
||
|
void prepareNotesToDraw(const microsec &music_offset);
|
||
|
|
||
|
/* Difference between top and active note is that
|
||
|
* top note is the note handling input right now
|
||
|
* OR it's the closest note from current music offset
|
||
|
* position, not necessarily active. A note stops being top only
|
||
|
* after dying or being tapped by player, even if it's already
|
||
|
* past her perfect offset.
|
||
|
*
|
||
|
* Meanwhile active note is the note which is currently handling
|
||
|
* player input for grade.
|
||
|
*
|
||
|
* An active note is always top note but a top note
|
||
|
* is not always active note.
|
||
|
* */
|
||
|
};
|