1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:37:35 +00:00

Piano: Add track controls to the player widget

Adds the ability to add a track and cycle through the
tracks from player widget. Also displays the current track
being played or edited in a dropdown that allows
for quick track selection.
This commit is contained in:
Jose Flores 2021-12-04 22:42:35 -06:00 committed by Andreas Kling
parent 2b47e1233b
commit 65df30d00c
7 changed files with 78 additions and 9 deletions

View file

@ -27,6 +27,12 @@ public:
Span<const Sample> buffer() const { return m_current_front_buffer; }
int octave() const { return m_octave; }
int octave_base() const { return (m_octave - octave_min) * 12; }
int track_count() { return m_tracks.size(); };
void set_current_track(size_t track_index)
{
VERIFY((int)track_index < track_count());
m_current_track = track_index;
}
int time() const { return m_time; }
void time_forward(int amount);
@ -38,7 +44,7 @@ public:
void set_octave(Direction);
void set_octave(int octave);
void add_track();
void next_track();
int next_track_index();
private:
Vector<NonnullOwnPtr<Track>> m_tracks;