From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 6/6] tools: Emit Seeked signal if Position changes
Date: Mon, 21 Jan 2013 17:21:58 +0200 [thread overview]
Message-ID: <1358781718-386-6-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1358781718-386-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
MPRIS spec says PropertiesChanged is not emitted for Position, which is
probably to make clear that progress is done using the rate, so instead
Seeked should be emitted.
---
tools/mpris-player.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tools/mpris-player.c b/tools/mpris-player.c
index 448050d..b8de9a1 100644
--- a/tools/mpris-player.c
+++ b/tools/mpris-player.c
@@ -1646,6 +1646,8 @@ static void player_property_changed(GDBusProxy *proxy, const char *name,
{
struct player *player;
const char *property;
+ uint32_t position;
+ uint64_t value;
player = find_player(proxy);
if (player == NULL)
@@ -1658,6 +1660,18 @@ static void player_property_changed(GDBusProxy *proxy, const char *name,
g_dbus_emit_property_changed(player->conn, MPRIS_PLAYER_PATH,
MPRIS_PLAYER_INTERFACE,
property);
+
+ if (strcasecmp(name, "Position") != 0)
+ return;
+
+ dbus_message_iter_get_basic(iter, &position);
+
+ value = position * 1000;
+
+ g_dbus_emit_signal(player->conn, MPRIS_PLAYER_PATH,
+ MPRIS_PLAYER_INTERFACE, "Seeked",
+ DBUS_TYPE_INT64, &value,
+ DBUS_TYPE_INVALID);
}
static void transport_property_changed(GDBusProxy *proxy, const char *name,
--
1.8.0.2
prev parent reply other threads:[~2013-01-21 15:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 15:21 [PATCH BlueZ 1/6] tools: Make mpris-player to export players using MPRIS interface Luiz Augusto von Dentz
2013-01-21 15:21 ` [PATCH BlueZ 2/6] tools: Add support for setting Shuffle and LoopStatus to mpris-player Luiz Augusto von Dentz
2013-01-21 15:21 ` [PATCH BlueZ 3/6] tools: Convert player's properties changed signals to MPRIS Luiz Augusto von Dentz
2013-01-24 13:55 ` Query regarding LE encryption failure Jaganath Kanakkassery
2013-01-24 14:32 ` Anderson Lizardo
2013-01-21 15:21 ` [PATCH BlueZ 4/6] tools: Make mpris-player to export org.mpris.MediaPlayer2 Luiz Augusto von Dentz
2013-01-21 15:21 ` [PATCH BlueZ 5/6] tools: Add volume support for mpris-player Luiz Augusto von Dentz
2013-01-21 15:21 ` Luiz Augusto von Dentz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358781718-386-6-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox