## ClutterMedia

ClutterMedia — An interface for controlling playback of media data

## Synopsis

                        ClutterMedia;
                        ClutterMediaIface;
    void                clutter_media_set_uri               (ClutterMedia *media,
                                                             const gchar *uri);
    gchar *             clutter_media_get_uri               (ClutterMedia *media);
    void                clutter_media_set_playing           (ClutterMedia *media,
                                                             gboolean playing);
    gboolean            clutter_media_get_playing           (ClutterMedia *media);
    void                clutter_media_set_progress          (ClutterMedia *media,
                                                             gdouble progress);
    gdouble             clutter_media_get_progress          (ClutterMedia *media);
    void                clutter_media_set_audio_volume      (ClutterMedia *media,
                                                             gdouble volume);
    gdouble             clutter_media_get_audio_volume      (ClutterMedia *media);
    gboolean            clutter_media_get_can_seek          (ClutterMedia *media);
    gdouble             clutter_media_get_buffer_fill       (ClutterMedia *media);
    gdouble             clutter_media_get_duration          (ClutterMedia *media);
    void                clutter_media_set_filename          (ClutterMedia *media,
                                                             const gchar *filename);

## Object Hierarchy

      GInterface
       +----ClutterMedia

## Properties

      "audio-volume"             gdouble               : Read / Write
      "buffer-fill"              gdouble               : Read
      "can-seek"                 gboolean              : Read
      "duration"                 gdouble               : Read
      "playing"                  gboolean              : Read / Write
      "progress"                 gdouble               : Read / Write
      "uri"                      gchar*                : Read / Write

## Signals

      "eos"                                            : Run Last
      "error"                                          : Run Last

## Description

ClutterMedia is an interface for controlling playback of media sources.

Clutter core does not provide an implementation of this interface, but other integration libraries like Clutter-GStreamer implement it to offer a uniform API for applications.

ClutterMedia is available since Clutter 0.2

## Details

### ClutterMedia

    typedef struct _ClutterMedia ClutterMedia;

### ClutterMediaIface

    typedef struct {
    } ClutterMediaIface;

Interface vtable for ClutterMedia implementations

Since 0.2

### clutter_media_set_uri ()

    void                clutter_media_set_uri               (ClutterMedia *media,
                                                             const gchar *uri);

Sets the URI of `media` to `uri`.

`media` : | a ClutterMedia
`uri` : | the URI of the media stream

Since 0.2

### clutter_media_get_uri ()

    gchar *             clutter_media_get_uri               (ClutterMedia *media);

Retrieves the URI from `media`.

`media` : | a ClutterMedia
Returns : | the URI of the media stream. Use `g_free()` to free the returned string

Since 0.2

### clutter_media_set_playing ()

    void                clutter_media_set_playing           (ClutterMedia *media,
                                                             gboolean playing);

Starts or stops playing of `media`.

`media` : | a ClutterMedia
`playing` : | `TRUE` to start playing

Since 0.2

### clutter_media_get_playing ()

    gboolean            clutter_media_get_playing           (ClutterMedia *media);

Retrieves the playing status of `media`.

`media` : | A ClutterMedia object
Returns : | `TRUE` if playing, `FALSE` if stopped.

Since 0.2

### clutter_media_set_progress ()

    void                clutter_media_set_progress          (ClutterMedia *media,
                                                             gdouble progress);

Sets the playback progress of `media`. The `progress` is a normalized value between 0.0 (begin) and 1.0 (end).

`media` : | a ClutterMedia
`progress` : | the progress of the playback, between 0.0 and 1.0

Since 1.0

### clutter_media_get_progress ()

    gdouble             clutter_media_get_progress          (ClutterMedia *media);

Retrieves the playback progress of `media`.

`media` : | a ClutterMedia
Returns : | the playback progress, between 0.0 and 1.0

Since 1.0

### clutter_media_set_audio_volume ()

    void                clutter_media_set_audio_volume      (ClutterMedia *media,
                                                             gdouble volume);

Sets the playback volume of `media` to `volume`.

`media` : | a ClutterMedia
`volume` : | the volume as a double between 0.0 and 1.0

Since 1.0

### clutter_media_get_audio_volume ()

    gdouble             clutter_media_get_audio_volume      (ClutterMedia *media);

Retrieves the playback volume of `media`.

`media` : | a ClutterMedia
Returns : | The playback volume between 0.0 and 1.0

Since 1.0

### clutter_media_get_can_seek ()

    gboolean            clutter_media_get_can_seek          (ClutterMedia *media);

Retrieves whether `media` is seekable or not.

`media` : | a ClutterMedia
Returns : | `TRUE` if `media` can seek, `FALSE` otherwise.

Since 0.2

### clutter_media_get_buffer_fill ()

    gdouble             clutter_media_get_buffer_fill       (ClutterMedia *media);

Retrieves the amount of the stream that is buffered.

`media` : | a ClutterMedia
Returns : | the fill level, between 0.0 and 1.0

Since 1.0

### clutter_media_get_duration ()

    gdouble             clutter_media_get_duration          (ClutterMedia *media);

Retrieves the duration of the media stream that `media` represents.

`media` : | a ClutterMedia
Returns : | the duration of the media stream, in seconds

Since 0.2

### clutter_media_set_filename ()

    void                clutter_media_set_filename          (ClutterMedia *media,
                                                             const gchar *filename);

Sets the source of `media` using a file path.

`media` : | a ClutterMedia
`filename` : | A filename

Since 0.2

## Property Details

### The `"audio-volume"` property

      "audio-volume"             gdouble               : Read / Write

The volume of the audio, as a normalized value between 0.0 and 1.0.

Allowed values: [0,1]

Default value: 0.5

Since 1.0

### The `"buffer-fill"` property

      "buffer-fill"              gdouble               : Read

The fill level of the buffer for the current stream, as a value between 0.0 and 1.0.

Allowed values: [0,1]

Default value: 0

Since 1.0

### The `"can-seek"` property

      "can-seek"                 gboolean              : Read

Whether the current stream is seekable.

Default value: FALSE

Since 0.2

### The `"duration"` property

      "duration"                 gdouble               : Read

The duration of the current stream, in seconds

Allowed values: >= 0

Default value: 0

Since 0.2

### The `"playing"` property

      "playing"                  gboolean              : Read / Write

Whether the ClutterMedia actor is playing.

Default value: FALSE

Since 0.2

### The `"progress"` property

      "progress"                 gdouble               : Read / Write

The current progress of the playback, as a normalized value between 0.0 and 1.0.

Allowed values: [0,1]

Default value: 0

Since 1.0

### The `"uri"` property

      "uri"                      gchar*                : Read / Write

The location of a media file, expressed as a valid URI.

Default value: NULL

Since 0.2

## Signal Details

### The `"eos"` signal

    void                user_function                      (ClutterMedia *media,
                                                            gpointer      user_data)      : Run Last

The ::eos signal is emitted each time the media stream ends.

`media` : | the ClutterMedia instance that received the signal
`user_data` : | user data set when the signal handler was connected.

Since 0.2

### The `"error"` signal

    void                user_function                      (ClutterMedia *media,
                                                            gpointer      error,
                                                            gpointer      user_data)      : Run Last

The ::error signal is emitted each time an error occurred.

`media` : | the ClutterMedia instance that received the signal
`error` : | the GError
`user_data` : | user data set when the signal handler was connected.

Since 0.2