totem r5926 - in trunk: . po src/plugins/coherence_upnp
- From: hadess svn gnome org
- To: svn-commits-list gnome org
- Subject: totem r5926 - in trunk: . po src/plugins/coherence_upnp
- Date: Tue, 20 Jan 2009 14:03:04 +0000 (UTC)
Author: hadess
Date: Tue Jan 20 14:03:04 2009
New Revision: 5926
URL: http://svn.gnome.org/viewvc/totem?rev=5926&view=rev
Log:
2009-01-20 Bastien Nocera <hadess hadess net>
* configure.in:
* src/plugins/coherence_upnp/Makefile.am:
* src/plugins/coherence_upnp/coherence_upnp.py:
* src/plugins/coherence_upnp/coherence_upnp.totem-plugin.in:
Add Coherence UPNP plugin from Frank Scholz
2009-01-20 Bastien Nocera <hadess hadess net>
* POTFILES.in: Add Coherence UPNP plugin
Added:
trunk/src/plugins/coherence_upnp/
trunk/src/plugins/coherence_upnp/Makefile.am
trunk/src/plugins/coherence_upnp/coherence_upnp.py
trunk/src/plugins/coherence_upnp/coherence_upnp.totem-plugin.in
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/po/ChangeLog
trunk/po/POTFILES.in
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Tue Jan 20 14:03:04 2009
@@ -50,7 +50,7 @@
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"
+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"
PLUGINDIR='${libdir}/totem/plugins'
AC_SUBST(PLUGINDIR)
@@ -852,6 +852,7 @@
src/Makefile
src/plugins/Makefile
src/plugins/bemused/Makefile
+src/plugins/coherence_upnp/Makefile
src/plugins/screensaver/Makefile
src/plugins/screenshot/Makefile
src/plugins/ontop/Makefile
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Tue Jan 20 14:03:04 2009
@@ -41,6 +41,8 @@
src/plugins/bemused/totem-bemused.c
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/galago/galago.totem-plugin.in
src/plugins/galago/totem-galago.c
[type: gettext/ini]src/plugins/gromit/gromit.totem-plugin.in
Added: trunk/src/plugins/coherence_upnp/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/plugins/coherence_upnp/Makefile.am Tue Jan 20 14:03:04 2009
@@ -0,0 +1,14 @@
+plugindir = $(PLUGINDIR)/coherence_upnp
+uidir = $(plugindir)
+plugin_PYTHON = coherence_upnp.py
+
+plugin_in_files = coherence_upnp.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) coherence_upnp.py
+
+CLEANFILES = $(plugin_DATA)
+DISTCLEANFILES = $(plugin_DATA)
Added: trunk/src/plugins/coherence_upnp/coherence_upnp.py
==============================================================================
--- (empty file)
+++ trunk/src/plugins/coherence_upnp/coherence_upnp.py Tue Jan 20 14:03:04 2009
@@ -0,0 +1,113 @@
+# Licensed under the MIT license
+# http://opensource.org/licenses/mit-license.php
+
+# Copyright 2008, Frank Scholz <coherence beebits net>
+
+import pygtk
+pygtk.require("2.0")
+import gtk
+
+from coherence.ui.av_widgets import TreeWidget
+from coherence.ui.av_widgets import UDN_COLUMN,UPNP_CLASS_COLUMN,SERVICE_COLUMN
+
+
+import totem
+
+class UPnPClient(totem.Plugin):
+
+ def __init__ (self):
+ totem.Plugin.__init__(self)
+ self.ui = TreeWidget()
+ self.ui.cb_item_right_click = self.button_pressed
+ self.ui.window.show_all()
+ selection = self.ui.treeview.get_selection()
+ selection.set_mode(gtk.SELECTION_MULTIPLE)
+
+ def button_pressed(self, widget, event):
+ if event.button == 3:
+ x = int(event.x)
+ y = int(event.y)
+ try:
+ row_path,column,_,_ = self.ui.treeview.get_path_at_pos(x, y)
+ selection = self.ui.treeview.get_selection()
+ if not selection.path_is_selected(row_path):
+ self.ui.treeview.set_cursor(row_path,column,False)
+ print "button_pressed", row_path, (row_path[0],)
+ iter = self.ui.store.get_iter((row_path[0],))
+ udn, = self.ui.store.get(iter,UDN_COLUMN)
+ iter = self.ui.store.get_iter(row_path)
+ upnp_class,url = self.ui.store.get(iter,UPNP_CLASS_COLUMN,SERVICE_COLUMN)
+ print udn, upnp_class, url
+ if(not upnp_class.startswith('object.container') and
+ not upnp_class == 'root'):
+ self.create_item_context(has_delete=self.ui.device_has_action(udn,'ContentDirectory','DestroyObject'))
+ self.context.popup(None,None,None,event.button,event.time)
+ return 1
+ except TypeError:
+ pass
+ return 1
+
+ def create_item_context(self,has_delete=False):
+ """ create context menu for right click in treeview item"""
+
+ def action(menu, text):
+ selection = self.ui.treeview.get_selection()
+ model, selected_rows = selection.get_selected_rows()
+ if text == 'item.delete':
+ for row_path in selected_rows:
+ self.ui.destroy_object(row_path)
+ return
+ if(len(selected_rows) > 0 and
+ text ==' item.play'):
+ row_path = selected_rows.pop(0)
+ iter = self.ui.store.get_iter(row_path)
+ url, = self.ui.store.get(iter,SERVICE_COLUMN)
+ self.totem_object.action_remote(totem.REMOTE_COMMAND_REPLACE,url)
+ self.totem_object.action_remote(totem.REMOTE_COMMAND_PLAY,url)
+ for row_path in selected_rows:
+ iter = self.ui.store.get_iter(row_path)
+ url, = self.ui.store.get(iter,SERVICE_COLUMN)
+ self.totem_object.action_remote(totem.REMOTE_COMMAND_ENQUEUE,url)
+ self.totem_object.action_remote(totem.REMOTE_COMMAND_PLAY,url)
+
+ if not hasattr(self, 'context_no_delete'):
+ self.context_no_delete = gtk.Menu()
+ play_menu = gtk.MenuItem("Play")
+ play_menu.connect("activate", action, 'item.play')
+ enqueue_menu = gtk.MenuItem("Enqueue")
+ enqueue_menu.connect("activate", action, 'item.enqueue')
+ self.context_no_delete.append(play_menu)
+ self.context_no_delete.append(enqueue_menu)
+ self.context_no_delete.show_all()
+
+ if not hasattr(self, 'context_with_delete'):
+ self.context_with_delete = gtk.Menu()
+ play_menu = gtk.MenuItem("Play")
+ play_menu.connect("activate", action, 'item.play')
+ enqueue_menu = gtk.MenuItem("Enqueue")
+ enqueue_menu.connect("activate", action, 'item.enqueue')
+ self.context_with_delete.append(play_menu)
+ self.context_with_delete.append(enqueue_menu)
+ self.context_with_delete.append(gtk.SeparatorMenuItem())
+ menu = gtk.MenuItem("Delete")
+ menu.connect("activate", action, 'item.delete')
+ self.context_with_delete.append(menu)
+ self.context_with_delete.show_all()
+
+ if has_delete:
+ self.context = self.context_with_delete
+ else:
+ self.context = self.context_no_delete
+
+ def activate (self, totem_object):
+ totem_object.add_sidebar_page ("upnp-coherence", _("Coherence DLNA/UPnP Client"), self.ui.window)
+ self.totem_object = totem_object
+
+ def load_and_play(url):
+ totem_object.action_remote(totem.REMOTE_COMMAND_REPLACE,url)
+ totem_object.action_remote(totem.REMOTE_COMMAND_PLAY,url)
+
+ self.ui.cb_item_dbl_click = load_and_play
+
+ def deactivate (self, totem_object):
+ totem_object.remove_sidebar_page ("upnp-coherence")
\ No newline at end of file
Added: trunk/src/plugins/coherence_upnp/coherence_upnp.totem-plugin.in
==============================================================================
--- (empty file)
+++ trunk/src/plugins/coherence_upnp/coherence_upnp.totem-plugin.in Tue Jan 20 14:03:04 2009
@@ -0,0 +1,9 @@
+[Totem Plugin]
+Loader=python
+Module=coherence_upnp
+IAge=1
+_Name=Coherence DLNA/UPnP Client
+_Description=A DLNA/UPnP client for Totem powered by Coherence
+Authors=Frank Scholz <coherence beebits net>
+Copyright=Copyright  2008 Frank Scholz
+Website=http://coherence.beebits.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]