gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.MediaFile

Description

MediaFile is the implementation for media file usage with MediaStream.

This provides a simple way to play back video files with GTK.

GTK+ provides a GIO extension point for MediaFile implementations to allow for external implementations using various media frameworks. GTK+ itself includes implementations using GStreamer and ffmpeg.

Synopsis

Exported types

newtype MediaFile Source #

Memory-managed wrapper type.

Instances

Instances details
Eq MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

IsGValue MediaFile Source #

Convert MediaFile to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.MediaFile

ManagedPtrNewtype MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

TypedObject MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

Methods

glibType :: IO GType #

GObject MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

HasParentTypes MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

type ParentTypes MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

type ParentTypes MediaFile = '[MediaStream, Object, Paintable]

class (GObject o, IsDescendantOf MediaFile o) => IsMediaFile o Source #

Type class for types which can be safely cast to MediaFile, for instance with toMediaFile.

Instances

Instances details
(GObject o, IsDescendantOf MediaFile o) => IsMediaFile o Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

toMediaFile :: (MonadIO m, IsMediaFile o) => o -> m MediaFile Source #

Cast to MediaFile, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

clear

mediaFileClear Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a) 
=> a

self: a MediaFile

-> m () 

Resets the media file to be empty.

getFile

mediaFileGetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a) 
=> a

self: a MediaFile

-> m (Maybe File)

Returns: The currently playing file or Nothing if not playing from a file.

Returns the file that self is currently playing from.

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

getInputStream

mediaFileGetInputStream Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a) 
=> a

self: a MediaFile

-> m (Maybe InputStream)

Returns: The currently playing stream or Nothing if not playing from a stream.

Returns the stream that self is currently playing from.

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

new

mediaFileNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m MediaFile

Returns: a new MediaFile

Creates a new empty media file.

newForFile

mediaFileNewForFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) 
=> a

file: The file to play

-> m MediaFile

Returns: a new MediaFile playing file

Creates a new media file to play file.

newForFilename

mediaFileNewForFilename Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

filename: filename to open

-> m MediaFile

Returns: a new MediaFile playing filename

This is a utility function that converts the given filename to a File and calls mediaFileNewForFile.

newForInputStream

mediaFileNewForInputStream Source #

Arguments

:: (HasCallStack, MonadIO m, IsInputStream a) 
=> a

stream: The stream to play

-> m MediaFile

Returns: a new MediaFile

Creates a new media file to play stream. If you want the resulting media to be seekable, the stream should implement the Seekable interface.

newForResource

mediaFileNewForResource Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

resourcePath: resource path to open

-> m MediaFile

Returns: a new MediaFile playing resourcePath

This is a utility function that converts the given resource to a File and calls mediaFileNewForFile.

setFile

mediaFileSetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a, IsFile b) 
=> a

self: a MediaFile

-> Maybe b

file: the file to play

-> m () 

If any file is still playing, stop playing it.

Then start playing the given file.

setFilename

mediaFileSetFilename Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a) 
=> a

self: a MediaFile

-> Maybe Text

filename: name of file to play

-> m () 

This is a utility function that converts the given filename to a File and calls mediaFileSetFile.

setInputStream

mediaFileSetInputStream Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a, IsInputStream b) 
=> a

self: a MediaFile

-> Maybe b

stream: the stream to play from

-> m () 

If anything is still playing, stop playing it. Then start playing the given stream.

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

setResource

mediaFileSetResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsMediaFile a) 
=> a

self: a MediaFile

-> Maybe Text

resourcePath: path to resource to play

-> m () 

This is a utility function that converts the given resourcePath to a File and calls mediaFileSetFile.

Properties

file

The file being played back or Nothing if not playing a file.

clearMediaFileFile :: (MonadIO m, IsMediaFile o) => o -> m () Source #

Set the value of the “file” property to Nothing. When overloading is enabled, this is equivalent to

clear #file

constructMediaFileFile :: (IsMediaFile o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “file” property. This is rarely needed directly, but it is used by new.

getMediaFileFile :: (MonadIO m, IsMediaFile o) => o -> m (Maybe File) Source #

Get the value of the “file” property. When overloading is enabled, this is equivalent to

get mediaFile #file

setMediaFileFile :: (MonadIO m, IsMediaFile o, IsFile a) => o -> a -> m () Source #

Set the value of the “file” property. When overloading is enabled, this is equivalent to

set mediaFile [ #file := value ]

inputStream

The stream being played back or Nothing if not playing a stream, like when playing a file.

clearMediaFileInputStream :: (MonadIO m, IsMediaFile o) => o -> m () Source #

Set the value of the “input-stream” property to Nothing. When overloading is enabled, this is equivalent to

clear #inputStream

constructMediaFileInputStream :: (IsMediaFile o, MonadIO m, IsInputStream a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “input-stream” property. This is rarely needed directly, but it is used by new.

getMediaFileInputStream :: (MonadIO m, IsMediaFile o) => o -> m (Maybe InputStream) Source #

Get the value of the “input-stream” property. When overloading is enabled, this is equivalent to

get mediaFile #inputStream

setMediaFileInputStream :: (MonadIO m, IsMediaFile o, IsInputStream a) => o -> a -> m () Source #

Set the value of the “input-stream” property. When overloading is enabled, this is equivalent to

set mediaFile [ #inputStream := value ]