Swfdec Reference Manual | ||||
---|---|---|---|---|
SwfdecGtkPlayerSwfdecGtkPlayer — an improved SwfdecPlayer |
#include <swfdec/swfdec-gtk.h> SwfdecGtkPlayer; #define SWFDEC_GTK_PRIORITY_ITERATE #define SWFDEC_GTK_PRIORITY_REDRAW SwfdecPlayer* swfdec_gtk_player_new (SwfdecAsDebugger *debugger); gboolean swfdec_gtk_player_get_playing (SwfdecGtkPlayer *player); void swfdec_gtk_player_set_playing (SwfdecGtkPlayer *player, gboolean playing); double swfdec_gtk_player_get_speed (SwfdecGtkPlayer *player); void swfdec_gtk_player_set_speed (SwfdecGtkPlayer *player, double speed); gboolean swfdec_gtk_player_get_audio_enabled (SwfdecGtkPlayer *player); void swfdec_gtk_player_set_audio_enabled (SwfdecGtkPlayer *player, gboolean enabled); GdkWindow* swfdec_gtk_player_get_missing_plugins_window (SwfdecGtkPlayer *player); void swfdec_gtk_player_set_missing_plugins_window (SwfdecGtkPlayer *player, GdkWindow *window);
"audio-enabled" gboolean : Read / Write "missing-plugins-window" GdkWindow* : Read / Write "playing" gboolean : Read / Write "speed" gdouble : Read / Write
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
typedef struct _SwfdecGtkPlayer SwfdecGtkPlayer;
The structure for the Swfdec Gtk player contains no public fields.
#define SWFDEC_GTK_PRIORITY_ITERATE (GDK_PRIORITY_REDRAW + 10)
The priority used for advancing a player that is playing.
#define SWFDEC_GTK_PRIORITY_REDRAW (GDK_PRIORITY_REDRAW + 20)
The priority used for scheduling repaint operations resulting from advancing a player.
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.
|
NULL or a SwfdecAsDebugger to debug this player
|
Returns : |
The new player |
gboolean swfdec_gtk_player_get_playing (SwfdecGtkPlayer *player);
Queries if the player is playing.
|
a SwfdecGtkPlayer |
Returns : |
TRUE if the player is 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()
.
|
a SwfdecGtkPlayer |
|
if the player should play or not |
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.
|
a SwfdecGtkPlayer |
Returns : |
the current playback 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.
|
a SwfdecGtkPlayer |
|
the new playback speed |
gboolean swfdec_gtk_player_get_audio_enabled (SwfdecGtkPlayer *player);
Queries if audio playback for player
is enabled or not.
|
a SwfdecGtkPlayer |
Returns : |
TRUE if audio playback is enabled
|
void swfdec_gtk_player_set_audio_enabled (SwfdecGtkPlayer *player, gboolean enabled);
Enables or disables automatic audio playback.
|
a SwfdecGtkPlayer |
|
TRUE to enable audio
|
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.
|
a SwfdecPlayer |
Returns : |
the GdkWindow used as parent for showing missing plugin dialogs or
NULL if automatic codec install is disabled.
|
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.
|
a SwfdecGtkPlayer |
|
the window to use for popping up codec install dialogs or NULL
|
"audio-enabled"
property"audio-enabled" gboolean : Read / Write
TRUE if automatic audio handling is enabled.
Default value: TRUE
"missing-plugins-window"
property"missing-plugins-window" GdkWindow* : Read / Write
window on which to do autmatic missing plugins installation.
"playing"
property"playing" gboolean : Read / Write
TRUE if the player is playing (d'oh).
Default value: FALSE
"speed"
property"speed" gdouble : Read / Write
desired playback speed.
Allowed values: >= G_MINDOUBLE
Default value: 1