【发布时间】:2011-01-06 22:33:53
【问题描述】:
我想使用 D-Bus 在正在运行的 Totem 实例中找到媒体文件当前暂停(或播放)的确切时间。准确地说,我想要的可以通过以下命令从 Totem python 控制台(如果插件存在并启用)获得:
>>> print totem_object.props.current_time
732616
我理解是毫秒。
到目前为止:
我以前从未使用过 D-Bus,所以我正在阅读 D-Bus 和 python-dbus 文档。我也启动了 D-Feet,发现org.gnome.Totem 总线名称和/Factory 对象我可以使用org.freedesktop.DBus.Properties 接口方法。
我目前处于这一点:
>>> import dbus
>>> seb= dbus.SessionBus()
>>> t= seb.get_object('org.gnome.Totem', '/Factory')
>>> tif= dbus.Interface(t, 'org.freedesktop.DBus.Properties')
>>> tif.GetAll('')
dbus.Dictionary({}, signature=dbus.Signature('sv'))
我什至找不到合适的方法,因此我们将不胜感激。
【问题讨论】:
标签: python linux gnome dbus totem