Enum mpv_client::Event
source · pub enum Event {
Show 17 variants
None,
Shutdown,
LogMessage(LogMessage),
GetPropertyReply(Result<()>, u64, Property),
SetPropertyReply(Result<()>, u64),
CommandReply(Result<()>, u64),
StartFile(StartFile),
EndFile(EndFile),
FileLoaded,
ClientMessage(ClientMessage),
VideoReconfig,
AudioReconfig,
Seek,
PlaybackRestart,
PropertyChange(u64, Property),
QueueOverflow,
Hook(u64, Hook),
}
Expand description
An enum representing the available events that can be received by
Handle::wait_event
.
Variants§
None
Nothing happened. Happens on timeouts or sporadic wakeups.
Shutdown
Happens when the player quits. The player enters a state where it tries to disconnect all clients.
LogMessage(LogMessage)
See Handle::request_log_messages
.
See also LogMessage
.
GetPropertyReply(Result<()>, u64, Property)
Reply to a Handle::get_property_async
request.
See also Property
.
SetPropertyReply(Result<()>, u64)
Reply to a Handle::set_property_async
request.
(Unlike GetPropertyReply
, Property
is not used.)
CommandReply(Result<()>, u64)
Reply to a Handle::command_async
or mpv_command_node_async() request.
See also Command
.
StartFile(StartFile)
Notification before playback start of a file (before the file is loaded).
See also StartFile
.
EndFile(EndFile)
Notification after playback end (after the file was unloaded).
See also EndFile
.
FileLoaded
Notification when the file has been loaded (headers were read etc.), and decoding starts.
ClientMessage(ClientMessage)
Triggered by the script-message input command. The command uses the
first argument of the command as client name (see Handle::client_name
) to
dispatch the message, and passes along all arguments starting from the
second argument as strings.
See also ClientMessage
.
VideoReconfig
Happens after video changed in some way. This can happen on resolution changes, pixel format changes, or video filter changes. The event is sent after the video filters and the VO are reconfigured. Applications embedding a mpv window should listen to this event in order to resize the window if needed. Note that this event can happen sporadically, and you should check yourself whether the video parameters really changed before doing something expensive.
AudioReconfig
Similar to VideoReconfig
. This is relatively uninteresting,
because there is no such thing as audio output embedding.
Seek
Happens when a seek was initiated. Playback stops. Usually it will
resume with PlaybackRestart
as soon as the seek is finished.
PlaybackRestart
There was a discontinuity of some sort (like a seek), and playback was reinitialized. Usually happens on start of playback and after seeking. The main purpose is allowing the client to detect when a seek request is finished.
PropertyChange(u64, Property)
Event sent due to mpv_observe_property()
.
See also Property
.
QueueOverflow
Happens if the internal per-mpv_handle ringbuffer overflows, and at
least 1 event had to be dropped. This can happen if the client doesn’t
read the event queue quickly enough with Handle::wait_event
, or if the
client makes a very large number of asynchronous calls at once.
Event delivery will continue normally once this event was returned (this forces the client to empty the queue completely).
Hook(u64, Hook)
Triggered if a hook handler was registered with Handle::hook_add
, and the
hook is invoked. If you receive this, you must handle it, and continue
the hook with Handle::hook_continue
.
See also Hook
.