pub trait MediaFileExt: 'static {
    // Required methods
    fn clear(&self);
    fn file(&self) -> Option<File>;
    fn input_stream(&self) -> Option<InputStream>;
    fn set_file(&self, file: Option<&impl IsA<File>>);
    fn set_filename(&self, filename: Option<impl AsRef<Path>>);
    fn set_input_stream(&self, stream: Option<&impl IsA<InputStream>>);
    fn set_resource(&self, resource_path: Option<&str>);
    fn connect_file_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
    fn connect_input_stream_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all MediaFile methods.

Implementors

MediaFile

Required Methods§

source

fn clear(&self)

Resets the media file to be empty.

source

fn file(&self) -> Option<File>

Returns the file that @self is currently playing from.

When @self is not playing or not playing from a file, None is returned.

Returns

The currently playing file

source

fn input_stream(&self) -> Option<InputStream>

Returns the stream that @self is currently playing from.

When @self is not playing or not playing from a stream, None is returned.

Returns

The currently playing stream

source

fn set_file(&self, file: Option<&impl IsA<File>>)

Sets the MediaFile to play the given file.

If any file is still playing, stop playing it.

file

the file to play

source

fn set_filename(&self, filename: Option<impl AsRef<Path>>)

Sets the `GtkMediaFile to play the given file.

This is a utility function that converts the given @filename to a GFile and calls set_file().

filename

name of file to play

source

fn set_input_stream(&self, stream: Option<&impl IsA<InputStream>>)

Sets the MediaFile to play the given stream.

If anything is still playing, stop playing it.

Full control about the @stream is assumed for the duration of playback. The stream will not be closed.

stream

the stream to play from

source

fn set_resource(&self, resource_path: Option<&str>)

Sets the `GtkMediaFile to play the given resource.

This is a utility function that converts the given @resource_path to a GFile and calls set_file().

resource_path

path to resource to play

source

fn connect_file_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_input_stream_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Implementors§