[totem/wip/hadess/mpris-can-go-next: 1/4] main: Add can_seek_{previous, next} API
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/mpris-can-go-next: 1/4] main: Add can_seek_{previous, next} API
- Date: Thu, 14 Feb 2019 02:49:50 +0000 (UTC)
commit dc4d409f90fc55a32fd4e252f4fb3c22e98c0a5c
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 14 03:34:59 2019 +0100
main: Add can_seek_{previous,next} API
src/totem-object.c | 28 ++++++++++++++++++++++++++++
src/totem.h | 2 ++
2 files changed, 30 insertions(+)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 46d9d79e1..78ca07845 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1939,6 +1939,20 @@ totem_object_direction (TotemObject *totem, TotemPlaylistDirection dir)
}
}
+/**
+ * totem_object_can_seek_previous:
+ * @totem: a #TotemObject
+ *
+ * Returns true if totem_object_seek_previous() would have an effect.
+ */
+gboolean
+totem_object_can_seek_previous (TotemObject *totem)
+{
+ return bacon_video_widget_has_previous_track (totem->bvw) ||
+ totem_playlist_has_previous_mrl (totem->playlist) ||
+ totem_playlist_get_repeat (totem->playlist);
+}
+
/**
* totem_object_seek_previous:
* @totem: a #TotemObject
@@ -1953,6 +1967,20 @@ totem_object_seek_previous (TotemObject *totem)
totem_object_direction (totem, TOTEM_PLAYLIST_DIRECTION_PREVIOUS);
}
+/**
+ * totem_object_can_seek_next:
+ * @totem: a #TotemObject
+ *
+ * Returns true if totem_object_seek_next() would have an effect.
+ */
+gboolean
+totem_object_can_seek_next (TotemObject *totem)
+{
+ return bacon_video_widget_has_next_track (totem->bvw) ||
+ totem_playlist_has_next_mrl (totem->playlist) ||
+ totem_playlist_get_repeat (totem->playlist);
+}
+
/**
* totem_object_seek_next:
* @totem: a #TotemObject
diff --git a/src/totem.h b/src/totem.h
index 926e8bfe5..69649e0ef 100644
--- a/src/totem.h
+++ b/src/totem.h
@@ -168,7 +168,9 @@ void totem_object_play (TotemObject *totem);
void totem_object_stop (TotemObject *totem);
void totem_object_play_pause (TotemObject *totem);
void totem_object_pause (TotemObject *totem);
+gboolean totem_object_can_seek_next (TotemObject *totem);
void totem_object_seek_next (TotemObject *totem);
+gboolean totem_object_can_seek_previous (TotemObject *totem);
void totem_object_seek_previous (TotemObject *totem);
void totem_object_seek_time (TotemObject *totem, gint64 msec, gboolean accurate);
void totem_object_seek_relative (TotemObject *totem, gint64 offset, gboolean accurate);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]