1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

Piano: Use size_t for track count

This commit is contained in:
kleines Filmröllchen 2023-03-29 12:42:47 +02:00 committed by Jelle Raaijmakers
parent 876f00e635
commit d757027638
2 changed files with 3 additions and 3 deletions

View file

@ -53,7 +53,7 @@ ErrorOr<void> PlayerWidget::initialize()
m_track_dropdown->set_model_column(0); m_track_dropdown->set_model_column(0);
m_track_dropdown->set_selected_index(0); m_track_dropdown->set_selected_index(0);
m_track_dropdown->on_change = [this]([[maybe_unused]] auto name, GUI::ModelIndex model_index) { m_track_dropdown->on_change = [this]([[maybe_unused]] auto name, GUI::ModelIndex model_index) {
m_track_manager.set_current_track(model_index.row()); m_track_manager.set_current_track(static_cast<size_t>(model_index.row()));
}; };
m_add_track_button = TRY(try_add<GUI::Button>()); m_add_track_button = TRY(try_add<GUI::Button>());

View file

@ -27,10 +27,10 @@ public:
~TrackManager() = default; ~TrackManager() = default;
NonnullRefPtr<DSP::NoteTrack> current_track() { return *m_tracks[m_current_track]; } NonnullRefPtr<DSP::NoteTrack> current_track() { return *m_tracks[m_current_track]; }
int track_count() { return m_tracks.size(); }; size_t track_count() { return m_tracks.size(); };
void set_current_track(size_t track_index) void set_current_track(size_t track_index)
{ {
VERIFY((int)track_index < track_count()); VERIFY(track_index < track_count());
m_current_track = track_index; m_current_track = track_index;
} }