SwfdecGtkPlayer

SwfdecGtkPlayer — an improved SwfdecPlayer

Synopsis




                    SwfdecGtkPlayer;
SwfdecPlayer*       swfdec_gtk_player_new               (void);
SwfdecPlayer*       swfdec_gtk_player_new_from_uri      (const char *uri);
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);

Object Hierarchy


  GObject
   +----SwfdecAsContext
         +----SwfdecPlayer
               +----SwfdecGtkPlayer

Properties


  "audio-enabled"            gboolean              : Read / Write
  "playing"                  gboolean              : Read / Write
  "speed"                    gdouble               : Read / Write

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

Details

SwfdecGtkPlayer

typedef struct _SwfdecGtkPlayer SwfdecGtkPlayer;

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


swfdec_gtk_player_new ()

SwfdecPlayer*       swfdec_gtk_player_new               (void);

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

Returns : The new player

swfdec_gtk_player_new_from_uri ()

SwfdecPlayer*       swfdec_gtk_player_new_from_uri      (const char *uri);

Create a player to play back the given URI. If compiled with gnome-vfs support, it will use gnome-vfs to resolve the given URI. Note that there is no way to figure out if the referenced URI really references a file that Swfdec can play back. If you need this, you should use SwfdecGtkLoader directly and use its error property. This function calls swfdec_init() for you if it wasn't called before.

uri : URI to play
Returns : a new player.

swfdec_gtk_player_get_playing ()

gboolean            swfdec_gtk_player_get_playing       (SwfdecGtkPlayer *player);

Queries if the player is playing.

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().

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.

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.

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.

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.

player : a SwfdecGtkPlayer
enabled : TRUE to enable audio

Property Details

The "audio-enabled" property

  "audio-enabled"            gboolean              : Read / Write

TRUE if automatic audio handling is enabled.

Default value: TRUE


The "playing" property

  "playing"                  gboolean              : Read / Write

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

Default value: FALSE


The "speed" property

  "speed"                    gdouble               : Read / Write

desired playback speed.

Allowed values: >= G_MINDOUBLE

Default value: 1