[totem] main: Add "file-has-played" signal
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Add "file-has-played" signal
- Date: Sat, 14 Jul 2012 23:26:02 +0000 (UTC)
commit 93c43126b163ae1c013f1abfd2e1e0bfca90a9f2
Author: Bastien Nocera <hadess hadess net>
Date: Sat Jul 14 22:16:32 2012 +0100
main: Add "file-has-played" signal
src/totem-object.c | 32 ++++++++++++++++++++++++++++++++
src/totem.h | 3 +++
2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 6149aad..1db9e8f 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -119,6 +119,7 @@ enum {
enum {
FILE_OPENED,
FILE_CLOSED,
+ FILE_HAS_PLAYED,
METADATA_UPDATED,
GET_USER_AGENT,
GET_TEXT_SUBTITLE,
@@ -309,6 +310,22 @@ totem_object_class_init (TotemObjectClass *klass)
G_TYPE_NONE, 1, G_TYPE_STRING);
/**
+ * TotemObject::file-has-played:
+ * @totem: the #TotemObject which received the signal
+ * @mrl: the MRL of the opened stream
+ *
+ * The #TotemObject::file-has-played signal is emitted when a new stream has started playing in Totem.
+ */
+ totem_table_signals[FILE_HAS_PLAYED] =
+ g_signal_new ("file-has-played",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (TotemObjectClass, file_has_played),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ /**
* TotemObject::file-closed:
* @totem: the #TotemObject which received the signal
*
@@ -796,6 +813,21 @@ totem_file_closed (TotemObject *totem)
}
/**
+ * totem_file_has_played:
+ * @totem: a #TotemObject
+ *
+ * Emits the #TotemObject::file-played signal on @totem.
+ **/
+void
+totem_file_has_played (TotemObject *totem,
+ const char *mrl)
+{
+ g_signal_emit (G_OBJECT (totem),
+ totem_table_signals[FILE_HAS_PLAYED],
+ 0, mrl);
+}
+
+/**
* totem_metadata_updated:
* @totem: a #TotemObject
* @artist: the stream's artist, or %NULL
diff --git a/src/totem.h b/src/totem.h
index d2755a7..c0c25c3 100644
--- a/src/totem.h
+++ b/src/totem.h
@@ -154,6 +154,7 @@ typedef struct {
void (*file_opened) (TotemObject *totem, const char *mrl);
void (*file_closed) (TotemObject *totem);
+ void (*file_has_played) (TotemObject *totem, const char *mrl);
void (*metadata_updated) (TotemObject *totem,
const char *artist,
const char *title,
@@ -170,6 +171,8 @@ void totem_object_plugins_init (TotemObject *totem);
void totem_object_plugins_shutdown (TotemObject *totem);
void totem_file_opened (TotemObject *totem,
const char *mrl);
+void totem_file_has_played (TotemObject *totem,
+ const char *mrl);
void totem_file_closed (TotemObject *totem);
void totem_metadata_updated (TotemObject *totem,
const char *artist,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]