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.

Trait Implementations§

source§

impl Display for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl !Send for Event

§

impl !Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.