gi-gtk-4.0.6: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.MediaFile

Description

GtkMediaFile implements GtkMediaStream for files.

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

GTK provides a GIO extension point for GtkMediaFile 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.

Constructors

MediaFile (ManagedPtr MediaFile) 

Instances

Instances details
Eq MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

GObject MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

ManagedPtrNewtype MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

Methods

toManagedPtr :: MediaFile -> ManagedPtr MediaFile

TypedObject MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

Methods

glibType :: IO GType

HasParentTypes MediaFile Source # 
Instance details

Defined in GI.Gtk.Objects.MediaFile

IsGValue (Maybe MediaFile) Source #

Convert MediaFile to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.MediaFile

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe MediaFile -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe 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

clear

mediaFileClear Source #

Arguments

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

self: a GtkMediaFile

-> m () 

Resets the media file to be empty.

getFile

mediaFileGetFile Source #

Arguments

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

self: a GtkMediaFile

-> m (Maybe File)

Returns: The currently playing 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 GtkMediaFile

-> m (Maybe InputStream)

Returns: The currently playing 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 GtkMediaFile

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 GtkMediaFile playing file

Creates a new media file to play file.

newForFilename

mediaFileNewForFilename Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [Char]

filename: filename to open

-> m MediaFile

Returns: a new GtkMediaFile playing filename

Creates a new media file for the given filename.

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

newForInputStream

mediaFileNewForInputStream Source #

Arguments

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

stream: The stream to play

-> m MediaFile

Returns: a new GtkMediaFile

Creates a new media file to play stream.

If you want the resulting media to be seekable, the stream should implement the GSeekable interface.

newForResource

mediaFileNewForResource Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

resourcePath: resource path to open

-> m MediaFile

Returns: a new GtkMediaFile playing resourcePath

Creates a new new media file for the given resource.

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

setFile

mediaFileSetFile Source #

Arguments

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

self: a GtkMediaFile

-> Maybe b

file: the file to play

-> m () 

Sets the GtkMediaFile to play the given file.

If any file is still playing, stop playing it.

setFilename

mediaFileSetFilename Source #

Arguments

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

self: a GtkMediaFile

-> Maybe [Char]

filename: name of file to play

-> m () 

Sets the @GtkMediaFile to play the given file.

This is a utility function that converts the given @filename to a @GFile` and calls mediaFileSetFile.

setInputStream

mediaFileSetInputStream Source #

Arguments

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

self: a GtkMediaFile

-> Maybe b

stream: the stream to play from

-> m () 

Sets the GtkMediaFile 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.

setResource

mediaFileSetResource Source #

Arguments

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

self: a GtkMediaFile

-> Maybe Text

resourcePath: path to resource to play

-> m () 

Sets the @GtkMediaFile to play the given resource.

This is a utility function that converts the given @resource_path to a @GFile` 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.

This is Nothing 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 ]