Package ch.bailu.gtk.gtk
Class MediaFile
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.MediaStream
ch.bailu.gtk.gtk.MediaFile
- All Implemented Interfaces:
PointerInterface
`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.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfacePaintable
.void
clear()
Resets the media file to be empty.static ClassHandler
getFile()
Returns the file that @self is currently playing from.Returns the stream that @self is currently playing from.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static MediaFile
newForFileMediaFile
(File file) Creates a new media file to play @file.static MediaFile
newForFilenameMediaFile
(Str filename) Creates a new media file for the given filename.static MediaFile
newForFilenameMediaFile
(String filename) Creates a new media file for the given filename.static MediaFile
Creates a new media file to play @stream.static MediaFile
newForResourceMediaFile
(Str resource_path) Creates a new new media file for the given resource.static MediaFile
newForResourceMediaFile
(String resource_path) Creates a new new media file for the given resource.void
Sets the `GtkMediaFile` to play the given file.void
setFilename
(Str filename) Sets the `GtkMediaFile to play the given file.void
setFilename
(String filename) Sets the `GtkMediaFile to play the given file.void
setInputStream
(InputStream stream) Sets the `GtkMediaFile` to play the given stream.void
setResource
(Str resource_path) Sets the `GtkMediaFile to play the given resource.void
setResource
(String resource_path) Sets the `GtkMediaFile to play the given resource.Methods inherited from class ch.bailu.gtk.gtk.MediaStream
error, error, gerror, getDuration, getEnded, getError, getLoop, getMuted, getPlaying, getTimestamp, getVolume, hasAudio, hasVideo, isPrepared, isSeekable, isSeeking, pause, play, realize, seek, seekFailed, seekSuccess, setLoop, setMuted, setPlaying, setVolume, streamEnded, streamPrepared, streamUnprepared, unrealize, update
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
MediaFile
-
MediaFile
public MediaFile()Creates a new empty media file.
-
-
Method Details
-
getClassHandler
-
newForFileMediaFile
Creates a new media file to play @file.- Parameters:
file
- The file to play- Returns:
- a new `GtkMediaFile` playing @file
-
newForFilenameMediaFile
Creates a new media file for the given filename.
This is a utility function that converts the given @filename
to a `GFile` and calls [ctor@Gtk.MediaFile.new_for_file].- Parameters:
filename
- filename to open- Returns:
- a new `GtkMediaFile` playing @filename
-
newForFilenameMediaFile
Creates a new media file for the given filename.
This is a utility function that converts the given @filename
to a `GFile` and calls [ctor@Gtk.MediaFile.new_for_file].- Parameters:
filename
- filename to open- Returns:
- a new `GtkMediaFile` playing @filename
-
newForInputStreamMediaFile
Creates a new media file to play @stream.
If you want the resulting media to be seekable,
the stream should implement the `GSeekable` interface.- Parameters:
stream
- The stream to play- Returns:
- a new `GtkMediaFile`
-
newForResourceMediaFile
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 [ctor@Gtk.MediaFile.new_for_file].- Parameters:
resource_path
- resource path to open- Returns:
- a new `GtkMediaFile` playing @resource_path
-
newForResourceMediaFile
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 [ctor@Gtk.MediaFile.new_for_file].- Parameters:
resource_path
- resource path to open- Returns:
- a new `GtkMediaFile` playing @resource_path
-
clear
public void clear()Resets the media file to be empty. -
getFile
Returns the file that @self is currently playing from.
When @self is not playing or not playing from a file,
%NULL is returned.- Returns:
- The currently playing file
-
getInputStream
Returns the stream that @self is currently playing from.
When @self is not playing or not playing from a stream,
%NULL is returned.- Returns:
- The currently playing stream
-
setFile
Sets the `GtkMediaFile` to play the given file.
If any file is still playing, stop playing it.- Parameters:
file
- the file to play
-
setFilename
Sets the `GtkMediaFile to play the given file.
This is a utility function that converts the given @filename
to a `GFile` and calls [method@Gtk.MediaFile.set_file].- Parameters:
filename
- name of file to play
-
setFilename
Sets the `GtkMediaFile to play the given file.
This is a utility function that converts the given @filename
to a `GFile` and calls [method@Gtk.MediaFile.set_file].- Parameters:
filename
- name of file to play
-
setInputStream
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.- Parameters:
stream
- the stream to play from
-
setResource
Sets the `GtkMediaFile to play the given resource.
This is a utility function that converts the given @resource_path
to a `GFile` and calls [method@Gtk.MediaFile.set_file].- Parameters:
resource_path
- path to resource to play
-
setResource
Sets the `GtkMediaFile to play the given resource.
This is a utility function that converts the given @resource_path
to a `GFile` and calls [method@Gtk.MediaFile.set_file].- Parameters:
resource_path
- path to resource to play
-
asPaintable
Implements interfacePaintable
. Call this to get access to interface functions.- Overrides:
asPaintable
in classMediaStream
- Returns:
Paintable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-