Commit 1bf66809 authored by Philip Withnall's avatar Philip Withnall Committed by Philip Withnall

Added a D-Bus Service plugin by Lucky <lucky1.data@gmail.com>. (Closes:

2009-04-01  Philip Withnall  <philip@tecnocode.co.uk>

	* configure.in:
	* src/plugins/dbus-service/Makefile.am:
	* src/plugins/dbus-service/dbus-service.py:
	* src/plugins/dbus-service/dbus-service.totem-plugin.in: Added a
	D-Bus Service plugin by Lucky <lucky1.data@gmail.com>.
	(Closes: #576016)

2009-04-01  Philip Withnall  <philip@tecnocode.co.uk>

	* C/totem.xml: Added documentation for the new D-Bus Service plugin.


svn path=/trunk/; revision=6221
parent 36505644
2009-04-01 Philip Withnall <philip@tecnocode.co.uk>
* configure.in:
* src/plugins/dbus-service/Makefile.am:
* src/plugins/dbus-service/dbus-service.py:
* src/plugins/dbus-service/dbus-service.totem-plugin.in: Added a
D-Bus Service plugin by Lucky <lucky1.data@gmail.com>.
(Closes: #576016)
2009-04-01 Philip Withnall <philip@tecnocode.co.uk>
* src/plugins/youtube/totem-youtube.c (new_from_stream_thread),
......
......@@ -50,7 +50,7 @@ AC_SUBST(TOTEM_VERSION_MINOR)
AC_SUBST(TOTEM_VERSION_MICRO)
# The full list of plugins
allowed_plugins="thumbnail screensaver ontop galago gromit lirc media-player-keys mythtv properties sidebar-test skipto sample-python sample-vala bemused youtube publish tracker pythonconsole jamendo opensubtitles screenshot brasero-disc-recorder coherence_upnp"
allowed_plugins="thumbnail screensaver ontop galago gromit lirc media-player-keys mythtv properties sidebar-test skipto sample-python sample-vala bemused youtube publish tracker pythonconsole jamendo opensubtitles screenshot brasero-disc-recorder coherence_upnp dbus-service"
PLUGINDIR='${libdir}/totem/plugins'
AC_SUBST(PLUGINDIR)
......@@ -862,6 +862,7 @@ src/Makefile
src/plugins/Makefile
src/plugins/bemused/Makefile
src/plugins/coherence_upnp/Makefile
src/plugins/dbus-service/Makefile
src/plugins/screensaver/Makefile
src/plugins/screenshot/Makefile
src/plugins/ontop/Makefile
......
......@@ -935,6 +935,13 @@ subtitles, and more.</para>
<para>YouTube videos can be opened in a web browser by choosing <menuchoice><guimenuitem>Open in Web Browser</guimenuitem></menuchoice> from
their context menu. This will open the video in its original location on the YouTube website.</para>
</sect2>
<sect2 id="totem-plugins-dbus-service">
<title>D-Bus Service</title>
<para>The <guilabel>D-Bus Service</guilabel> plugin broadcasts notifications of which track is playing in <application>&app;</application>
on the D-Bus session bus. Applications such as <application>Gajim</application> can listen for such notifications and respond accordingly by,
for example, updating your instant messaging status message to display the video currently being played in
<application>&app;</application>.</para>
</sect2>
</sect1>
<!-- =========== Usage ======================================= -->
......
2009-04-01 Philip Withnall <philip@tecnocode.co.uk>
* C/totem.xml: Added documentation for the new D-Bus Service plugin.
2009-03-31 Philip Withnall <philip@tecnocode.co.uk>
* C/totem.xml:
......
2009-04-01 Philip Withnall <philip@tecnocode.co.uk>
* POTFILES.in:
2009-04-01 Philip Withnall <philip@tecnocode.co.uk>
* POTFILES.in: Ported the YouTube plugin to C.
......
......@@ -44,6 +44,7 @@ src/plugins/brasero-disc-recorder/totem-disc-recorder.c
[type: gettext/ini]src/plugins/brasero-disc-recorder/brasero-disc-recorder.totem-plugin.in
src/plugins/coherence_upnp/coherence_upnp.py
[type: gettext/ini]src/plugins/coherence_upnp/coherence_upnp.totem-plugin.in
[type: gettext/ini]src/plugins/dbus-service/dbus-service.totem-plugin.in
[type: gettext/ini]src/plugins/galago/galago.totem-plugin.in
src/plugins/galago/totem-galago.c
[type: gettext/ini]src/plugins/gromit/gromit.totem-plugin.in
......
plugindir = $(PLUGINDIR)/dbus
uidir = $(plugindir)
plugin_PYTHON = dbus-service.py
plugin_in_files = dbus-service.totem-plugin.in
%.totem-plugin: %.totem-plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.totem-plugin.in=.totem-plugin)
EXTRA_DIST = $(plugin_in_files) dbus-service.py
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
plugindir = $(PLUGINDIR)/dbus
uidir = $(plugindir)
plugin_PYTHON = dbus-service.py
plugin_in_files = dbus-service.totem-plugin.in
%.totem-plugin: %.totem-plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.totem-plugin.in=.totem-plugin)
EXTRA_DIST = $(plugin_in_files) dbus-service.py
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
plugindir = $(PLUGINDIR)/dbus
uidir = $(plugindir)
plugin_PYTHON = dbus-service.py
plugin_in_files = dbus-service.totem-plugin.in
%.totem-plugin: %.totem-plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.totem-plugin.in=.totem-plugin)
EXTRA_DIST = $(plugin_in_files) dbus-service.py
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
## Totem D-Bus plugin
## Copyright (C) 2009 Lucky <lucky1.data@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## Sunday 13th May 2007: Bastien Nocera: Add exception clause.
## See license_change file for details.
import totem
import gobject, gtk
import dbus, dbus.service
from dbus.mainloop.glib import DBusGMainLoop
class dbusservice(totem.Plugin):
def __init__(self):
totem.Plugin.__init__(self)
def activate(self, totem):
DBusGMainLoop(set_as_default=True)
self.notification = Notification("/org/gnome/Totem")
self.title = ""
self.artist = ""
self.album = ""
self.duration = 0 # may be usable in future
totem.connect("metadata-updated", self.do_update_metadata)
totem.connect("notify::playing", self.do_notify)
def deactivate(self, totem):
self.notification.playingStopped()
self.notification.disconnect() # ensure we don't leak our path on the bus
def do_update_metadata(self, totem, title, artist, album, num):
self.title = title
self.artist = artist
self.album = album
if not self.title:
self.title = ""
if not self.artist:
self.artist = ""
if not self.album:
self.album = ""
def do_notify(self, totem, status):
if totem.is_playing():
self.notification.playingStarted(self.title, self.album, self.artist, self.duration)
else:
self.notification.playingStopped()
class Notification(dbus.service.Object):
def __init__(self, path):
dbus.service.Object.__init__(self, dbus.SessionBus(), path)
def disconnect(self):
self.remove_from_connection(None, None)
@dbus.service.signal(dbus_interface="org.gnome.Totem", signature="sssu")
def playingStarted(self, title, album, artist, duration):
pass
@dbus.service.signal(dbus_interface="org.gnome.Totem", signature="")
def playingStopped(self):
pass
## Totem D-Bus plugin
## Copyright (C) 2009 Lucky <lucky1.data@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## Sunday 13th May 2007: Bastien Nocera: Add exception clause.
## See license_change file for details.
import totem
import gobject, gtk
import dbus, dbus.service
from dbus.mainloop.glib import DBusGMainLoop
class dbusservice(totem.Plugin):
def __init__(self):
totem.Plugin.__init__(self)
def activate(self, totem):
DBusGMainLoop(set_as_default=True)
self.notification = Notification("/org/gnome/Totem")
self.title = ""
self.artist = ""
self.album = ""
self.duration = 0 # may be usable in future
totem.connect("metadata-updated", self.do_update_metadata)
totem.connect("notify::playing", self.do_notify)
def deactivate(self, totem):
self.notification.playingStopped()
self.notification.disconnect() # ensure we don't leak our path on the bus
def do_update_metadata(self, totem, title, artist, album, num):
self.title = title
self.artist = artist
self.album = album
if not self.title:
self.title = ""
if not self.artist:
self.artist = ""
if not self.album:
self.album = ""
def do_notify(self, totem, status):
if totem.is_playing():
self.notification.playingStarted(self.title, self.album, self.artist, self.duration)
else:
self.notification.playingStopped()
class Notification(dbus.service.Object):
def __init__(self, path):
dbus.service.Object.__init__(self, dbus.SessionBus(), path)
def disconnect(self):
self.remove_from_connection(None, None)
@dbus.service.signal(dbus_interface="org.gnome.Totem", signature="sssu")
def playingStarted(self, title, album, artist, duration):
pass
@dbus.service.signal(dbus_interface="org.gnome.Totem", signature="")
def playingStopped(self):
pass
## Totem D-Bus plugin
## Copyright (C) 2009 Lucky <lucky1.data@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## Sunday 13th May 2007: Bastien Nocera: Add exception clause.
## See license_change file for details.
import totem
import gobject, gtk
import dbus, dbus.service
from dbus.mainloop.glib import DBusGMainLoop
class dbusservice(totem.Plugin):
def __init__(self):
totem.Plugin.__init__(self)
def activate(self, totem):
DBusGMainLoop(set_as_default=True)
self.notification = Notification("/org/gnome/Totem")
self.title = ""
self.artist = ""
self.album = ""
self.duration = 0 # may be usable in future
totem.connect("metadata-updated", self.do_update_metadata)
totem.connect("notify::playing", self.do_notify)
def deactivate(self, totem):
self.notification.playingStopped()
self.notification.disconnect() # ensure we don't leak our path on the bus
def do_update_metadata(self, totem, title, artist, album, num):
self.title = title
self.artist = artist
self.album = album
if not self.title:
self.title = ""
if not self.artist:
self.artist = ""
if not self.album:
self.album = ""
def do_notify(self, totem, status):
if totem.is_playing():
self.notification.playingStarted(self.title, self.album, self.artist, self.duration)
else:
self.notification.playingStopped()
class Notification(dbus.service.Object):
def __init__(self, path):
dbus.service.Object.__init__(self, dbus.SessionBus(), path)
def disconnect(self):
self.remove_from_connection(None, None)
@dbus.service.signal(dbus_interface="org.gnome.Totem", signature="sssu")
def playingStarted(self, title, album, artist, duration):
pass
@dbus.service.signal(dbus_interface="org.gnome.Totem", signature="")
def playingStopped(self):
pass
[Totem Plugin]
Loader=python
Module=dbus-service
IAge=1
_Name=D-Bus Service
_Description=Plugin for sending notifications of currently-playing movies to the D-Bus subsystem.
Authors=Lucky <lucky1.data@gmail.com>
Copyright=Copyright © 2009 Lucky
Website=http://projects.gnome.org/totem/
[Totem Plugin]
Loader=python
Module=dbus-service
IAge=1
_Name=D-Bus Service
_Description=Plugin for sending notifications of currently-playing movies to the D-Bus subsystem.
Authors=Lucky <lucky1.data@gmail.com>
Copyright=Copyright © 2009 Lucky
Website=http://projects.gnome.org/totem/
[Totem Plugin]
Loader=python
Module=dbus-service
IAge=1
_Name=D-Bus Service
_Description=Plugin for sending notifications of currently-playing movies to the D-Bus subsystem.
Authors=Lucky <lucky1.data@gmail.com>
Copyright=Copyright © 2009 Lucky
Website=http://projects.gnome.org/totem/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment