[rhythmbox] shell-player: add 'elapsed-nano-changed' signal
- From: Jonathan Matthew <jmatthew src gnome org>
- To: svn-commits-list gnome org
- Subject: [rhythmbox] shell-player: add 'elapsed-nano-changed' signal
- Date: Fri, 5 Jun 2009 09:20:10 -0400 (EDT)
commit 8fb26c089a6d18dceee856b70c492627fa2c9ac4
Author: Jonathan Matthew <jonathan d14n org>
Date: Fri Jun 5 23:15:44 2009 +1000
shell-player: add 'elapsed-nano-changed' signal
This is emitted on every player tick (currently 5Hz), allowing things to
be updated more than once per second and with subsecond precision. The
existing elapsed-changed signal remains as it's useful too, and because
it's part of the dbus interface.
---
lib/rb-marshal.list | 1 +
shell/rb-shell-player.c | 22 ++++++++++++++++++++++
shell/rb-shell-player.h | 1 +
3 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/lib/rb-marshal.list b/lib/rb-marshal.list
index 46e9289..f7a26e9 100644
--- a/lib/rb-marshal.list
+++ b/lib/rb-marshal.list
@@ -22,6 +22,7 @@ VOID:DOUBLE,LONG
VOID:UINT64
VOID:INT,INT
VOID:INT,INT,DOUBLE
+VOID:INT64
VOID:OBJECT,INT,INT
VOID:OBJECT,INT,INT,BOXED,UINT,UINT
VOID:OBJECT,INT,POINTER
diff --git a/shell/rb-shell-player.c b/shell/rb-shell-player.c
index 23d22ab..be7c6ed 100644
--- a/shell/rb-shell-player.c
+++ b/shell/rb-shell-player.c
@@ -300,6 +300,7 @@ enum
PLAYING_URI_CHANGED,
PLAYING_SONG_PROPERTY_CHANGED,
MISSING_PLUGINS,
+ ELAPSED_NANO_CHANGED,
LAST_SIGNAL
};
@@ -601,6 +602,26 @@ rb_shell_player_class_init (RBShellPlayerClass *klass)
3,
G_TYPE_STRV, G_TYPE_STRV, G_TYPE_CLOSURE);
+ /**
+ * RBShellPlayer::elapsed-nano-changed:
+ * @player: the #RBShellPlayer
+ * @elapsed: the new playback position in nanoseconds
+ *
+ * Emitted when the playback position changes. Only use this (as opposed to
+ * elapsed-changed) when you require subsecond precision. This signal will be
+ * emitted multiple times per second.
+ */
+ rb_shell_player_signals[ELAPSED_NANO_CHANGED] =
+ g_signal_new ("elapsed-nano-changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (RBShellPlayerClass, elapsed_nano_changed),
+ NULL, NULL,
+ rb_marshal_VOID__INT64,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_INT64);
+
g_type_class_add_private (klass, sizeof (RBShellPlayerPrivate));
}
@@ -3508,6 +3529,7 @@ tick_cb (RBPlayer *mmplayer,
g_signal_emit (G_OBJECT (player), rb_shell_player_signals[ELAPSED_CHANGED],
0, player->priv->elapsed);
}
+ g_signal_emit (player, rb_shell_player_signals[ELAPSED_NANO_CHANGED], 0, elapsed);
if (duration_from_player) {
/* XXX update duration in various things? */
diff --git a/shell/rb-shell-player.h b/shell/rb-shell-player.h
index e8351b8..105198b 100644
--- a/shell/rb-shell-player.h
+++ b/shell/rb-shell-player.h
@@ -77,6 +77,7 @@ struct _RBShellPlayerClass
void (*window_title_changed) (RBShellPlayer *player, const char *window_title);
void (*elapsed_changed) (RBShellPlayer *player, guint elapsed);
+ void (*elapsed_nano_changed) (RBShellPlayer *player, gint64 elapsed);
void (*playing_changed) (RBShellPlayer *player, gboolean playing);
void (*playing_source_changed) (RBShellPlayer *player, RBSource *source);
void (*playing_uri_changed) (RBShellPlayer *player, const char *uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]