mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 18:28:57 +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:
parent
2b47e1233b
commit
65df30d00c
Notes:
sideshowbarker
2024-07-17 22:58:08 +09:00
Author: https://github.com/JsFlo 🔰
Commit: 65df30d00c
Pull-request: https://github.com/SerenityOS/serenity/pull/11180
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
7 changed files with 78 additions and 9 deletions
|
@ -90,8 +90,11 @@ void TrackManager::add_track()
|
|||
m_tracks.append(make<Track>(m_time));
|
||||
}
|
||||
|
||||
void TrackManager::next_track()
|
||||
int TrackManager::next_track_index()
|
||||
{
|
||||
if (++m_current_track >= m_tracks.size())
|
||||
m_current_track = 0;
|
||||
auto next_track_index = m_current_track + 1;
|
||||
if (next_track_index >= m_tracks.size())
|
||||
return 0;
|
||||
else
|
||||
return next_track_index;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue