Play control functions

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

Functions
Play control functions
Emotion » API available for manipulating Emotion object.

## Functions
EAPI void | emotion_object_play_set (Evas_Object *obj, Eina_Bool play)
| Set play/pause state of the media file. More...
EAPI Eina_Bool | emotion_object_play_get (const Evas_Object *obj)
| Get play/pause state of the media file. More...
EAPI void | emotion_object_position_set (Evas_Object *obj, double sec)
| Set the position in the media file. More...
EAPI double | emotion_object_position_get (const Evas_Object *obj)
| Get the position in the media file. More...
EAPI double | emotion_object_buffer_size_get (const Evas_Object *obj)
| Get the percentual size of the buffering cache. More...
EAPI Eina_Bool | emotion_object_seekable_get (const Evas_Object *obj)
| Get whether the media file is seekable. More...
EAPI double | emotion_object_play_length_get (const Evas_Object *obj)
| Get the length of play for the media file. More...
EAPI void | emotion_object_play_speed_set (Evas_Object *obj, double speed)
| Set the play speed of the media file. More...
EAPI double | emotion_object_play_speed_get (const Evas_Object *obj)
| Get the play speed of the media file. More...
EAPI const char * | emotion_object_progress_info_get (const Evas_Object *obj)
| Get how much of the file has been played. More...
EAPI double | emotion_object_progress_status_get (const Evas_Object *obj)
| Get how much of the file has been played. More...

## Detailed Description

## Function Documentation

EAPI void emotion_object_play_set | ( | Evas_Object * | obj,
|  | Eina_Bool | play
| ) |  |

Set play/pause state of the media file.

Parameters

  obj | The emotion object whose state will be changed.
  play | EINA_TRUE to play, EINA_FALSE to pause.

This functions sets the currently playing status of the video. Using this function to play or pause the video doesn't alter it's current position.

Examples:
  emotion_basic_example.c, and emotion_signals_example.c.

EAPI Eina_Bool emotion_object_play_get | ( | const Evas_Object * | obj | ) |

Get play/pause state of the media file.

Parameters

  obj | The emotion object from which the state will be retrieved.

Returns
  EINA_TRUE if playing. EINA_FALSE if not playing.

Examples:
  emotion_signals_example.c.

EAPI void emotion_object_position_set | ( | Evas_Object * | obj,
|  | double | sec
| ) |  |

Set the position in the media file.

Parameters

  obj | The emotion object whose position will be changed.
  sec | The position(in seconds) to which the media file will be set.

This functions sets the current position of the media file to `sec`, this only works on seekable streams. Setting the position doesn't change the playing state of the media file.

See also
  emotion_object_seekable_get

Referenced by emotion_object_last_position_load().

EAPI double emotion_object_position_get | ( | const Evas_Object * | obj | ) |

Get the position in the media file.

Parameters

  obj | The emotion object from which the position will be retrieved.

Returns
  The position of the media file.

The position is returned as the number of seconds since the beginning of the media file.

Examples:
  emotion_signals_example.c.

Referenced by emotion_object_last_position_save().

EAPI double emotion_object_buffer_size_get | ( | const Evas_Object * | obj | ) |

Get the percentual size of the buffering cache.

Parameters

  obj | The emotion object from which the buffer size will be retrieved.

Returns
  The buffer percent size, ranging from 0.0 to 1.0

The buffer size is returned as a number between 0.0 and 1.0, 0.0 means the buffer if empty, 1.0 means full. If no buffering is in progress 1.0 is returned. In all other cases (maybe the backend don't support buffering) 1.0 is returned, thus you can always check for buffer_size < 1.0 to know if buffering is in progress.

Warning
  Generic backend don't implement this (will return 1.0).

EAPI Eina_Bool emotion_object_seekable_get | ( | const Evas_Object * | obj | ) |

Get whether the media file is seekable.

Parameters

  obj | The emotion object from which the seekable status will be retrieved.

Returns
  EINA_TRUE if the media file is seekable, EINA_FALSE otherwise.

Examples:
  emotion_signals_example.c.

EAPI double emotion_object_play_length_get | ( | const Evas_Object * | obj | ) |

Get the length of play for the media file.

Parameters

  obj | The emotion object from which the length will be retrieved.

Returns
  The length of the media file in seconds.

This function returns the length of the media file in seconds.

Warning
  This will return 0 if called before the "length_change" signal has, been emitted.

Examples:
  emotion_signals_example.c.

EAPI void emotion_object_play_speed_set | ( | Evas_Object * | obj,
|  | double | speed
| ) |  |

Set the play speed of the media file.

Parameters

  obj | The emotion object whose speed will be set.
  speed | The speed to be set in the range [0,infinity)

This function sets the speed with which the media file will be played. 1.0 represents the normal speed, 2 double speed, 0.5 half speed and so on.

Warning
  The only backend that implements this is the experimental VLC backend.

References DBG.

EAPI double emotion_object_play_speed_get | ( | const Evas_Object * | obj | ) |

Get the play speed of the media file.

Parameters

  obj | The emotion object from which the filename will be retrieved.

Returns
  The current speed of the media file.

See also
  emotion_object_play_speed_set

EAPI const char* emotion_object_progress_info_get | ( | const Evas_Object * | obj | ) |

Get how much of the file has been played.

Parameters

  obj | The emotion object from which the filename will be retrieved.

Returns
  The progress of the media file.

Warning
  Don't change of free the returned string.
  gstreamer xine backends don't implement this(will return NULL).

EAPI double emotion_object_progress_status_get | ( | const Evas_Object * | obj | ) |

Get how much of the file has been played.

Parameters

  obj | The emotion object from which the filename will be retrieved

Returns
  The progress of the media file.

This function gets the progress in playing the file, the return value is in the [0, 1] range.

Warning
  gstreamer xine backends don't implement this(will return 0).