SwfdecGtkPlayer

SwfdecGtkPlayer — an improved SwfdecPlayer

Functions

Properties

gboolean audio-enabled Read / Write
GdkWindow * missing-plugins-window Read / Write
gboolean playing Read / Write
gdouble speed Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── SwfdecAsContext
        ╰── SwfdecPlayer
            ╰── SwfdecGtkPlayer

Includes

#include <swfdec/swfdec-gtk.h>

Description

The SwfdecGtkPlayer adds common functionality to the rather barebones SwfdecPlayer class, such as automatic playback and audio handling. Note that by default, the player will be paused, so you need to call swfdec_gtk_player_set_playing() on the new player.

see_also : SwfdecPlayer

Functions

SWFDEC_GTK_PRIORITY_ITERATE

#define SWFDEC_GTK_PRIORITY_ITERATE (GDK_PRIORITY_REDRAW + 10)

The priority used for advancing a player that is playing.


SWFDEC_GTK_PRIORITY_REDRAW

#define SWFDEC_GTK_PRIORITY_REDRAW  (GDK_PRIORITY_REDRAW + 20)

The priority used for scheduling repaint operations resulting from advancing a player.


swfdec_gtk_player_new ()

SwfdecPlayer *
swfdec_gtk_player_new (SwfdecAsDebugger *debugger);

Creates a new Swfdec Gtk player. This function calls swfdec_init() for you if it wasn't called before.

Parameters

debugger

NULL or a SwfdecAsDebugger to debug this player

 

Returns

The new player


swfdec_gtk_player_get_playing ()

gboolean
swfdec_gtk_player_get_playing (SwfdecGtkPlayer *player);

Queries if the player is playing.

Parameters

player

a SwfdecGtkPlayer

 

Returns

TRUE if the player is playing


swfdec_gtk_player_set_playing ()

void
swfdec_gtk_player_set_playing (SwfdecGtkPlayer *player,
                               gboolean playing);

Sets if player should be playing or not. If the player is playing, a timer will be attached to the default main loop that periodically calls swfdec_player_advance().

Parameters

player

a SwfdecGtkPlayer

 

playing

if the player should play or not

 

swfdec_gtk_player_get_speed ()

double
swfdec_gtk_player_get_speed (SwfdecGtkPlayer *player);

Queries the current playback speed. If the player is currently paused, it will report the speed that it would use if playing.

Parameters

player

a SwfdecGtkPlayer

 

Returns

the current playback speed.


swfdec_gtk_player_set_speed ()

void
swfdec_gtk_player_set_speed (SwfdecGtkPlayer *player,
                             double speed);

Sets the new playback speed. 1.0 means the default speed, bigger values make playback happen faster. Audio will only play back if the speed is 1.0. Note that if the player is not playing when calling this function, it will not automatically start.

Parameters

player

a SwfdecGtkPlayer

 

speed

the new playback speed

 

swfdec_gtk_player_get_audio_enabled ()

gboolean
swfdec_gtk_player_get_audio_enabled (SwfdecGtkPlayer *player);

Queries if audio playback for player is enabled or not.

Parameters

player

a SwfdecGtkPlayer

 

Returns

TRUE if audio playback is enabled


swfdec_gtk_player_set_audio_enabled ()

void
swfdec_gtk_player_set_audio_enabled (SwfdecGtkPlayer *player,
                                     gboolean enabled);

Enables or disables automatic audio playback.

Parameters

player

a SwfdecGtkPlayer

 

enabled

TRUE to enable audio

 

swfdec_gtk_player_get_missing_plugins_window ()

GdkWindow *
swfdec_gtk_player_get_missing_plugins_window
                               (SwfdecGtkPlayer *player);

Gets the window used for automatic codec install. See swfdec_gtk_player_set_missing_plugins_window() for details.

Parameters

player

a SwfdecPlayer

 

Returns

the GdkWindow used as parent for showing missing plugin dialogs or NULL if automatic codec install is disabled.


swfdec_gtk_player_set_missing_plugins_window ()

void
swfdec_gtk_player_set_missing_plugins_window
                               (SwfdecGtkPlayer *player,
                                GdkWindow *window);

Sets a given GdkWindow to be used as the reference window when popping up automatic codec install dialogs. Automatic codec install happens when Swfdec cannot find a GStreamer plugin to play back a given media file. The player will automaticcaly pause when this happens to allow the plugin install to finish and will resume playback after the codec install has completed. You can use NULL to disable this feature. It is disable by default. Note that this function takes a GdkWindow, not a GtkWindow, as its argument. This makes it slightly more inconvenient to use, as you need to call gtk_widget_show() on your GtkWindow before having access to its GdkWindow, but it allows automatic plugin installatio even when your application does not have a window. You can use gdk_get_default_root_window() to obtain a default window in that case. For details about automatic codec install, see the GStreamer documentation, in particular the function gst_install_plugins_async(). If Swfdec was compiled without GStreamer support, this function will have no effect.

Parameters

player

a SwfdecGtkPlayer

 

window

the window to use for popping up codec install dialogs or NULL

 

Types and Values

struct SwfdecGtkPlayer

struct SwfdecGtkPlayer;

The structure for the Swfdec Gtk player contains no public fields.

Property Details

The “audio-enabled” property

  “audio-enabled”            gboolean

TRUE if automatic audio handling is enabled.

Flags: Read / Write

Default value: TRUE


The “missing-plugins-window” property

  “missing-plugins-window”   GdkWindow *

window on which to do autmatic missing plugins installation.

Flags: Read / Write


The “playing” property

  “playing”                  gboolean

TRUE if the player is playing (d'oh).

Flags: Read / Write

Default value: FALSE


The “speed” property

  “speed”                    gdouble

desired playback speed.

Flags: Read / Write

Allowed values: >= G_MINDOUBLE

Default value: 1