LibVideo: Rename Status -> State in PlaybackStatusChangeEvent class

A bit of a bikeshed, but status sounds more like a result of an action,
and state sounds more accurate to what the `PlaybackManager` does.

The previous and current state fields of the `PlaybackStateChangeEvent`
are now removed, since they were unused (for now).

This is a lead-up to the refactoring of VideoPlaybackManager to make
that diff more legible.
This commit is contained in:
Zaggy1024 2023-02-07 15:53:34 -06:00 committed by Andreas Kling
parent 2ff11bac3d
commit a4c7672802
Notes: sideshowbarker 2024-07-17 10:31:19 +09:00
3 changed files with 7 additions and 14 deletions

View file

@ -234,7 +234,7 @@ void VideoPlayerWidget::event(Core::Event& event)
set_current_timestamp(m_playback_manager->current_playback_time());
frame_event.accept();
} else if (event.type() == Video::EventType::PlaybackStatusChange) {
} else if (event.type() == Video::EventType::PlaybackStateChange) {
update_play_pause_icon();
event.accept();
}

View file

@ -57,7 +57,7 @@ void PlaybackManager::set_playback_status(PlaybackStatus status)
m_present_timer->stop();
}
m_main_loop.post_event(m_event_handler, make<PlaybackStatusChangeEvent>(status, old_status));
m_main_loop.post_event(m_event_handler, make<PlaybackStateChangeEvent>());
}
}

View file

@ -165,7 +165,7 @@ private:
enum EventType : unsigned {
DecoderErrorOccurred = (('v' << 2) | ('i' << 1) | 'd') << 4,
VideoFramePresent,
PlaybackStatusChange,
PlaybackStateChange,
};
class DecoderErrorEvent : public Core::Event {
@ -199,20 +199,13 @@ private:
RefPtr<Gfx::Bitmap> m_frame;
};
class PlaybackStatusChangeEvent : public Core::Event {
class PlaybackStateChangeEvent : public Core::Event {
public:
PlaybackStatusChangeEvent() = default;
explicit PlaybackStatusChangeEvent(PlaybackStatus status, PlaybackStatus previous_status)
: Core::Event(PlaybackStatusChange)
, m_status(status)
, m_previous_status(previous_status)
explicit PlaybackStateChangeEvent()
: Core::Event(PlaybackStateChange)
{
}
virtual ~PlaybackStatusChangeEvent() = default;
private:
PlaybackStatus m_status;
PlaybackStatus m_previous_status;
virtual ~PlaybackStateChangeEvent() = default;
};
inline StringView playback_status_to_string(PlaybackStatus status)