[totem] main: Make playback rate available to plugins
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Make playback rate available to plugins
- Date: Mon, 21 Mar 2016 16:34:08 +0000 (UTC)
commit c6488190a3127b95121ebbadfaaab3384a5051c4
Author: Bastien Nocera <hadess hadess net>
Date: Wed Mar 9 18:59:06 2016 +0100
main: Make playback rate available to plugins
https://bugzilla.gnome.org/show_bug.cgi?id=417141
docs/reference/totem-sections.txt | 2 ++
src/totem-object.c | 29 +++++++++++++++++++++++++++++
src/totem.h | 3 +++
3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/totem-sections.txt b/docs/reference/totem-sections.txt
index a4c8ca7..53e8ed9 100644
--- a/docs/reference/totem-sections.txt
+++ b/docs/reference/totem-sections.txt
@@ -49,6 +49,8 @@ totem_object_get_volume
totem_object_get_version
totem_object_get_supported_content_types
totem_object_get_supported_uri_schemes
+totem_object_get_rate
+totem_object_set_rate
<SUBSECTION Standard>
TOTEM_OBJECT
TOTEM_IS_OBJECT
diff --git a/src/totem-object.c b/src/totem-object.c
index 1eec6de..b0a1ccf 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2065,6 +2065,35 @@ totem_object_set_volume (TotemObject *totem, double volume)
}
/**
+ * totem_object_get_rate:
+ * @totem: a #TotemObject
+ *
+ * Gets the current playback rate, with `1.0` being the normal playback rate.
+ *
+ * Return value: the volume level
+ **/
+float
+totem_object_get_rate (TotemObject *totem)
+{
+ return bacon_video_widget_get_rate (totem->bvw);
+}
+
+/**
+ * totem_object_set_rate:
+ * @totem: a #TotemObject
+ * @rate: the new absolute playback rate
+ *
+ * Sets the playback rate, with `1.0` being the normal playback rate.
+ *
+ * Return value: %TRUE on success, %FALSE on failure.
+ **/
+gboolean
+totem_object_set_rate (TotemObject *totem, float rate)
+{
+ return bacon_video_widget_set_rate (totem->bvw, rate);
+}
+
+/**
* totem_object_set_volume_relative:
* @totem: a #TotemObject
* @off_pct: the value by which to increase or decrease the volume
diff --git a/src/totem.h b/src/totem.h
index 585e1af..926e8bf 100644
--- a/src/totem.h
+++ b/src/totem.h
@@ -191,6 +191,9 @@ GMenu *totem_object_get_menu_section (TotemObject *totem,
void totem_object_empty_menu_section (TotemObject *totem,
const char *id);
+float totem_object_get_rate (TotemObject *totem);
+gboolean totem_object_set_rate (TotemObject *totem, float rate);
+
GtkWidget *totem_object_get_video_widget (TotemObject *totem);
/* Database handling */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]