[rhythmbox] finish converting plugins to use introspection for everything



commit a81c24a048dea3ee7bf1436542bbdaffe30a150f
Author: Jonathan Matthew <jonathan d14n org>
Date:   Fri Aug 19 23:21:20 2011 +1000

    finish converting plugins to use introspection for everything
    
    embedded cover art search requires improvements to GStreamer
    introspection and/or pygobject, so it's currently disabled.

 plugins/artdisplay/CoverArtDatabase.py       |   10 +++---
 plugins/artdisplay/EmbeddedCoverArtSearch.py |   34 +++++++++---------
 plugins/artdisplay/LocalCoverArtSearch.py    |    3 +-
 plugins/artdisplay/artdisplay.py             |   47 +++++++++++++------------
 plugins/context/AlbumTab.py                  |   21 +++++------
 plugins/context/ArtistTab.py                 |   27 +++++++--------
 plugins/context/ContextView.py               |   11 +++---
 plugins/context/LinksTab.py                  |   19 +++++-----
 plugins/context/LyricsTab.py                 |   21 +++++------
 plugins/jamendo/JamendoSource.py             |   15 ++++----
 plugins/jamendo/jamendo.py                   |   10 ++---
 plugins/lyrics/LyricsConfigureDialog.py      |    3 +-
 plugins/lyrics/LyricsParse.py                |    5 +--
 plugins/magnatune/MagnatuneSource.py         |   19 +++++-----
 plugins/magnatune/magnatune.py               |   18 ++++-----
 plugins/rb/Loader.py                         |   17 ++++-----
 plugins/replaygain/player.py                 |   38 +++++++--------------
 17 files changed, 146 insertions(+), 172 deletions(-)
---
diff --git a/plugins/artdisplay/CoverArtDatabase.py b/plugins/artdisplay/CoverArtDatabase.py
index 894b23a..bd04c0d 100644
--- a/plugins/artdisplay/CoverArtDatabase.py
+++ b/plugins/artdisplay/CoverArtDatabase.py
@@ -27,22 +27,22 @@
 
 import os
 import itertools
-import gobject
 import gi
 
 import rb
-from gi.repository import GdkPixbuf
+from gi.repository import GObject, GdkPixbuf
 from gi.repository import RB
 
 from PodcastCoverArtSearch import PodcastCoverArtSearch
 from MusicBrainzCoverArtSearch import MusicBrainzCoverArtSearch
 from LastFMCoverArtSearch import LastFMCoverArtSearch
-from EmbeddedCoverArtSearch import EmbeddedCoverArtSearch
+# temporarily disabled, needs GStreamer introspection improvements
+# from EmbeddedCoverArtSearch import EmbeddedCoverArtSearch
 from LocalCoverArtSearch import LocalCoverArtSearch
 
 from urllib import unquote, pathname2url
 
-ART_SEARCHES_LOCAL = [LocalCoverArtSearch, EmbeddedCoverArtSearch]
+ART_SEARCHES_LOCAL = [LocalCoverArtSearch] # , EmbeddedCoverArtSearch]
 ART_SEARCHES_REMOTE = [PodcastCoverArtSearch, LastFMCoverArtSearch, MusicBrainzCoverArtSearch]
 
 ART_FOLDER = os.path.join(RB.user_cache_dir(), 'covers')
@@ -355,7 +355,7 @@ class CoverArtDatabase (object):
 				l.write(data)
 				l.close()
 				return l.get_pixbuf()
-			except gobject.GError, e:
+			except GObject.GError, e:
 				print "error reading image: %s" % str(e)
 				import sys
 				sys.excepthook(*sys.exc_info())
diff --git a/plugins/artdisplay/EmbeddedCoverArtSearch.py b/plugins/artdisplay/EmbeddedCoverArtSearch.py
index c6b52cb..179d579 100644
--- a/plugins/artdisplay/EmbeddedCoverArtSearch.py
+++ b/plugins/artdisplay/EmbeddedCoverArtSearch.py
@@ -24,11 +24,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gst
-import gobject
-
 import rb
-from gi.repository import GdkPixbuf
+from gi.repository import GObject, GdkPixbuf, Gst
 from gi.repository import RB
 
 class EmbeddedCoverArtSearch (object):
@@ -37,19 +34,20 @@ class EmbeddedCoverArtSearch (object):
 
 	def _tag_cb (self, bus, message):
 		taglist = message.parse_tag()
-		for tag in (gst.TAG_IMAGE, gst.TAG_PREVIEW_IMAGE):
+		for tag in (Gst.TAG_IMAGE, Gst.TAG_PREVIEW_IMAGE):
 			if tag not in taglist.keys():
 				continue
 
 			print "got image tag %s" % tag
 			try:
+				buf = taglist.get_buffer_index(tag, 0)
 				loader = GdkPixbuf.PixbufLoader()
-				if loader.write(taglist[tag]) and loader.close():
+				if loader.write(buf.data) and loader.close():
 					print "successfully extracted pixbuf"
 					self.got_pixbuf = True
 					self.callback(self, self.entry, loader.get_pixbuf(), *self.args)
 					return
-			except gobject.GError:
+			except GObject.GError:
 				continue
 
 	def _state_changed_cb (self, bus, message):
@@ -57,16 +55,16 @@ class EmbeddedCoverArtSearch (object):
 			return
 
 		old, new, pending = message.parse_state_changed()
-		if ((new, pending) == (gst.STATE_PAUSED, gst.STATE_VOID_PENDING)):
+		if ((new, pending) == (Gst.State.PAUSED, Gst.State.VOID_PENDING)):
 			print "pipeline has gone to PAUSED"
-			self.pipeline.set_state(gst.STATE_NULL)
+			self.pipeline.set_state(Gst.State.NULL)
 			if self.got_pixbuf is False:
 				self.callback(self, self.entry, None, *self.args)
 
 	def _error_cb (self, bus, message):
 		error = message.parse_error()
 		print "got error: %s" % error[1]
-		self.pipeline.set_state(gst.STATE_NULL)
+		self.pipeline.set_state(Gst.State.NULL)
 		self.callback(self, self.entry, None, *self.args)
 
 	def _decoded_pad_cb (self, decodebin, pad, last):
@@ -74,7 +72,7 @@ class EmbeddedCoverArtSearch (object):
 			return
 
 		caps = pad.get_caps()
-		if caps[0].get_name() in ('audio/x-raw-float', 'audio/x-raw-int'):
+		if caps.get_structure(0).get_name() in ('audio/x-raw-float', 'audio/x-raw-int'):
 			print "linking decoded audio pad to fakesink"
 			pad.link(self.sinkpad)
 
@@ -100,7 +98,7 @@ class EmbeddedCoverArtSearch (object):
 		self.got_pixbuf = False
 
 		# set up pipeline and bus callbacks
-		self.pipeline = gst.Pipeline()
+		self.pipeline = Gst.Pipeline()
 		bus = self.pipeline.get_bus()
 		bus.add_signal_watch()
 		bus.connect("message::tag", self._tag_cb)
@@ -108,17 +106,19 @@ class EmbeddedCoverArtSearch (object):
 		bus.connect("message::error", self._error_cb)
 
 		# create elements
-		self.src = gst.element_make_from_uri(gst.URI_SRC, uri)
-		self.decodebin = gst.element_factory_make("decodebin2")
-		self.sink = gst.element_factory_make("fakesink")
+		self.src = Gst.Element.make_from_uri(Gst.URIType.SRC, uri, None)
+		self.decodebin = Gst.ElementFactory.make("decodebin2", None)
+		self.sink = Gst.ElementFactory.make("fakesink", None)
 		self.decodebin.connect('new-decoded-pad', self._decoded_pad_cb)
 
-		self.pipeline.add(self.src, self.decodebin, self.sink)
+		self.pipeline.add(self.src)
+		self.pipeline.add(self.decodebin)
+		self.pipeline.add(self.sink)
 		self.src.link(self.decodebin)
 
 		self.sinkpad = self.sink.get_pad('sink')
 
-		self.pipeline.set_state(gst.STATE_PAUSED)
+		self.pipeline.set_state(Gst.State.PAUSED)
 
 
 	def search_next (self):
diff --git a/plugins/artdisplay/LocalCoverArtSearch.py b/plugins/artdisplay/LocalCoverArtSearch.py
index 921f5d0..b840e23 100644
--- a/plugins/artdisplay/LocalCoverArtSearch.py
+++ b/plugins/artdisplay/LocalCoverArtSearch.py
@@ -26,12 +26,11 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
 import os
-import gobject
 import glib
 import gi
 
 from gi.repository import RB
-from gi.repository import Gio
+from gi.repository import GObject, Gio
 
 IMAGE_NAMES = ["cover", "album", "albumart", ".folder", "folder"]
 ITEMS_PER_NOTIFICATION = 10
diff --git a/plugins/artdisplay/artdisplay.py b/plugins/artdisplay/artdisplay.py
index 9263e6b..5fadaa8 100644
--- a/plugins/artdisplay/artdisplay.py
+++ b/plugins/artdisplay/artdisplay.py
@@ -24,7 +24,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
 import gi
 
 from warnings import warn
@@ -32,7 +31,7 @@ from warnings import warn
 from CoverArtDatabase import CoverArtDatabase
 
 import rb
-from gi.repository import Gtk, Gdk, GdkPixbuf, Gio, Peas
+from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, Gio, Peas
 from gi.repository import RB
 
 FADE_STEPS = 10
@@ -88,7 +87,7 @@ def merge_with_background (pixbuf, bgcolor, pad_if_not_near_square):
 
 class FadingImage (Gtk.Misc):
 	__gsignals__ = {
-		'get-max-size' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_INT, ())
+		'get-max-size' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_INT, ())
 	}
 	def __init__ (self, missing_image):
 		Gtk.Misc.__init__(self)
@@ -109,7 +108,7 @@ class FadingImage (Gtk.Misc):
 		self.icon_theme.disconnect(self.tc_id)
 		for id in self.resize_id, self.fade_id, self.anim_id:
 			if id != 0:
-				gobject.source_remove (id)
+				GObject.source_remove (id)
 
 	def screen_changed (self, widget, old_screen):
 		if old_screen:
@@ -152,7 +151,7 @@ class FadingImage (Gtk.Misc):
 
 	def size_allocate_cb (self, widget, allocation):
 		if self.resize_id == 0:
-			self.resize_id = gobject.idle_add (self.after_resize)
+			self.resize_id = GObject.idle_add (self.after_resize)
 
 		max_size = self.emit ('get-max-size')
 		self.size = min (self.get_allocated_width (), max_size)
@@ -235,7 +234,7 @@ class FadingImage (Gtk.Misc):
 			self.fade_id = 0
 		self.merged_pixbuf = None
 		if first_time:
-			self.fade_id = gobject.timeout_add ((FADE_TOTAL_TIME / FADE_STEPS), self.fade_art, False)
+			self.fade_id = GObject.timeout_add ((FADE_TOTAL_TIME / FADE_STEPS), self.fade_art, False)
 			return False
 		self.queue_resize ()
 		return (self.fade_step <= 0.999)
@@ -246,7 +245,7 @@ class FadingImage (Gtk.Misc):
 		x, y, w, h = self.anim_rect ()
 		self.queue_draw_area (max (x, 0), max (y, 0), w, h)
 		if first_time:
-			self.anim_id = gobject.timeout_add (int (1000 / THROBBER_RATE), self.animation_advance, counter, False)
+			self.anim_id = GObject.timeout_add (int (1000 / THROBBER_RATE), self.animation_advance, counter, False)
 			return False
 		return True
 
@@ -262,24 +261,24 @@ class FadingImage (Gtk.Misc):
 		self.fade_step = 0.0
 		self.anim = None
 		if self.fade_id != 0:
-			gobject.source_remove (self.fade_id)
+			GObject.source_remove (self.fade_id)
 			self.fade_id = 0
 		if self.old_pixbuf is not None:
-			self.fade_id = gobject.timeout_add (working and WORKING_DELAY or (FADE_TOTAL_TIME / FADE_STEPS), self.fade_art, working)
+			self.fade_id = GObject.timeout_add (working and WORKING_DELAY or (FADE_TOTAL_TIME / FADE_STEPS), self.fade_art, working)
 		if working and self.anim_id == 0 and self.anim_frames:
-			self.anim_id = gobject.timeout_add (WORKING_DELAY, self.animation_advance, [0], True)
+			self.anim_id = GObject.timeout_add (WORKING_DELAY, self.animation_advance, [0], True)
 		if not working and self.anim_id != 0:
-			gobject.source_remove (self.anim_id)
+			GObject.source_remove (self.anim_id)
 			self.anim_id = 0
 		self.queue_resize ()
 
-gobject.type_register (FadingImage)
+GObject.type_register (FadingImage)
 
 
 class ArtDisplayWidget (FadingImage):
 	__gsignals__ = {
-			'pixbuf-dropped' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (RB.RhythmDBEntry, GdkPixbuf.Pixbuf)),
-			'uri-dropped' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (RB.RhythmDBEntry, gobject.TYPE_STRING))
+			'pixbuf-dropped' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (RB.RhythmDBEntry, GdkPixbuf.Pixbuf)),
+			'uri-dropped' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (RB.RhythmDBEntry, GObject.TYPE_STRING))
 			}
 
 	def __init__ (self, missing_image):
@@ -365,15 +364,15 @@ class ArtDisplayWidget (FadingImage):
 			self.emit ('uri-dropped', entry, uris[0])
 		elif text:
 			self.emit ('uri-dropped', entry, text)
-gobject.type_register (ArtDisplayWidget)
+GObject.type_register (ArtDisplayWidget)
 
 
-class ArtDisplayPlugin (gobject.GObject, Peas.Activatable):
+class ArtDisplayPlugin (GObject.GObject, Peas.Activatable):
 	__gtype_name__ = 'ArtDisplayPlugin'
-	object = gobject.property(type=gobject.GObject)
+	object = GObject.property(type=GObject.GObject)
 
 	def __init__ (self):
-		gobject.GObject.__init__ (self)
+		GObject.GObject.__init__ (self)
 
 	def do_activate (self):
 		shell = self.object
@@ -445,7 +444,8 @@ class ArtDisplayPlugin (gobject.GObject, Peas.Activatable):
 	def on_get_pixbuf_completed(self, entry, pixbuf, uri, tooltip_image, tooltip_text):
 		# Set the pixbuf for the entry returned from the art db
 		if rb.entry_equal(entry, self.current_entry):
-			self.current_pixbuf = pixbuf
+			if self.current_pixbuf is None or pixbuf is not None:
+				self.current_pixbuf = pixbuf
 
 			if tooltip_image is None:
 				pb = None
@@ -454,7 +454,7 @@ class ArtDisplayPlugin (gobject.GObject, Peas.Activatable):
 			else:
 				f = rb.find_plugin_file (self, tooltip_image)
 				pb = GdkPixbuf.Pixbuf.new_from_file(f)
-			self.art_widget.set (entry, pixbuf, uri, pb, tooltip_text, False)
+			self.art_widget.set (entry, self.current_pixbuf, uri, pb, tooltip_text, False)
 
 		if pixbuf:
 			# This might be from a playing-changed signal,
@@ -468,7 +468,7 @@ class ArtDisplayPlugin (gobject.GObject, Peas.Activatable):
 					db.emit_entry_extra_metadata_notify (entry, "rb:coverArt-uri", uri)
 					self.emitting_uri_notify = False
 				return False
-			gobject.idle_add(idle_emit_art)
+			GObject.idle_add(idle_emit_art)
 
 	def cover_art_request (self, db, entry):
 		a = [None]
@@ -483,13 +483,14 @@ class ArtDisplayPlugin (gobject.GObject, Peas.Activatable):
 		return a[0]
 
 	def cover_art_notify (self, db, entry, field, metadata):
-		if entry != self.current_entry:
+		if rb.entry_equal(entry, self.current_entry) is False:
 			return
 		if not isinstance (metadata, GdkPixbuf.Pixbuf):
 			return
 		self.art_db.cancel_get_pixbuf (entry)
 		if self.current_pixbuf == metadata:
 			return
+		self.current_pixbuf = metadata
 
 		# cache the pixbuf so we can provide a url
 		uri = self.art_db.cache_pixbuf (db, entry, metadata)
@@ -499,7 +500,7 @@ class ArtDisplayPlugin (gobject.GObject, Peas.Activatable):
 		self.emitting_uri_notify = False
 
 	def cover_art_uri_notify (self, db, entry, field, metadata):
-		if entry != self.current_entry:
+		if rb.entry_equal(entry, self.current_entry) is False:
 			return
 
 		if self.emitting_uri_notify:
diff --git a/plugins/context/AlbumTab.py b/plugins/context/AlbumTab.py
index 9323ba1..20426fc 100644
--- a/plugins/context/AlbumTab.py
+++ b/plugins/context/AlbumTab.py
@@ -24,7 +24,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
 import os
 import cgi
 import urllib
@@ -35,18 +34,18 @@ import LastFM
 
 import rb
 from gi.repository import RB
-from gi.repository import Gtk
+from gi.repository import GObject, Gtk
 from gi.repository import WebKit
 
-class AlbumTab (gobject.GObject):
+class AlbumTab (GObject.GObject):
 
     __gsignals__ = {
-        'switch-tab' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
-                                (gobject.TYPE_STRING,))
+        'switch-tab' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+                                (GObject.TYPE_STRING,))
     }
     
     def __init__ (self, shell, buttons, ds, view):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.shell      = shell
         self.sp         = shell.props.shell_player
         self.db         = shell.props.db
@@ -89,10 +88,10 @@ class AlbumTab (gobject.GObject):
 
         self.artist = artist
 
-class AlbumView (gobject.GObject):
+class AlbumView (GObject.GObject):
 
     def __init__ (self, shell, plugin, webview, ds):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.webview = webview
         self.ds      = ds
         self.shell   = shell
@@ -138,14 +137,14 @@ class AlbumView (gobject.GObject):
         self.load_view ()
 
 
-class AlbumDataSource (gobject.GObject):
+class AlbumDataSource (GObject.GObject):
     
     __gsignals__ = {
-        'albums-ready' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ())
+        'albums-ready' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ())
     }
 
     def __init__ (self, info_cache, ranking_cache):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.albums = None
         self.error = None
         self.artist = None
diff --git a/plugins/context/ArtistTab.py b/plugins/context/ArtistTab.py
index 7453141..cbd229c 100644
--- a/plugins/context/ArtistTab.py
+++ b/plugins/context/ArtistTab.py
@@ -24,7 +24,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
 import re, os
 import cgi
 import urllib
@@ -36,18 +35,18 @@ import rb
 import LastFM
 
 from gi.repository import WebKit
-from gi.repository import Gtk
+from gi.repository import GObject, Gtk
 from gi.repository import RB
     
-class ArtistTab (gobject.GObject):
+class ArtistTab (GObject.GObject):
     
     __gsignals__ = {
-        'switch-tab' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
-                                (gobject.TYPE_STRING,))
+        'switch-tab' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+                                (GObject.TYPE_STRING,))
     }
 
     def __init__ (self, shell, buttons, ds, view):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.shell      = shell
         self.sp         = shell.props.shell_player
         self.db         = shell.props.db
@@ -91,10 +90,10 @@ class ArtistTab (gobject.GObject):
             self.view.load_view()
         self.artist = artist
 
-class ArtistView (gobject.GObject):
+class ArtistView (GObject.GObject):
 
     def __init__ (self, shell, plugin, webview, ds):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.webview  = webview
         self.ds       = ds
         self.shell    = shell
@@ -147,17 +146,17 @@ class ArtistView (gobject.GObject):
             print "Problem in info ready: %s" % e
     
 
-class ArtistDataSource (gobject.GObject):
+class ArtistDataSource (GObject.GObject):
     
     __gsignals__ = {
-        'artist-info-ready'       : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
-        'artist-similar-ready'    : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
-        'artist-top-tracks-ready' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
-        'artist-top-albums-ready' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
+        'artist-info-ready'       : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ()),
+        'artist-similar-ready'    : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ()),
+        'artist-top-tracks-ready' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ()),
+        'artist-top-albums-ready' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ()),
     }
 
     def __init__ (self, info_cache, ranking_cache):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
 
         self.current_artist = None
         self.error = None
diff --git a/plugins/context/ContextView.py b/plugins/context/ContextView.py
index f4004da..a0d8711 100644
--- a/plugins/context/ContextView.py
+++ b/plugins/context/ContextView.py
@@ -24,7 +24,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
 import os
 
 import ArtistTab as at
@@ -33,7 +32,7 @@ import LyricsTab as lt
 import LinksTab as lit
 
 import rb
-from gi.repository import Gtk, Gdk, Pango, Gio
+from gi.repository import GObject, Gtk, Gdk, Pango, Gio
 from gi.repository import RB
 from gi.repository import WebKit
 
@@ -45,10 +44,10 @@ context_ui = """
 </ui>
 """
 
-class ContextView (gobject.GObject):
+class ContextView (GObject.GObject):
 
     def __init__ (self, shell, plugin):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.shell = shell
         self.sp = shell.props.shell_player
         self.db = shell.props.db
@@ -192,7 +191,7 @@ class ContextView (gobject.GObject):
     def playing_changed_cb (self, playing, user_data):
         # this sometimes happens on a streaming thread, so we need to
         # move it to the main thread
-        gobject.idle_add (self.playing_changed_idle_cb)
+        GObject.idle_add (self.playing_changed_idle_cb)
 
     def playing_changed_idle_cb (self):
         if self.sp is None:
@@ -248,7 +247,7 @@ class ContextView (gobject.GObject):
         self.label.set_padding(0,4)
 
         #----- set up top 5 tree view -----#
-        self.top_five_list = Gtk.ListStore (gobject.TYPE_STRING, gobject.TYPE_STRING)
+        self.top_five_list = Gtk.ListStore (GObject.TYPE_STRING, GObject.TYPE_STRING)
         top_five_view = Gtk.TreeView.new_with_model(self.top_five_list)
 
         top_five_tvc1 = Gtk.TreeViewColumn()
diff --git a/plugins/context/LinksTab.py b/plugins/context/LinksTab.py
index 0eac0b0..09e1cc4 100644
--- a/plugins/context/LinksTab.py
+++ b/plugins/context/LinksTab.py
@@ -24,12 +24,11 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
 import os
 import cgi
 import urllib
 
-from gi.repository import Gtk
+from gi.repository import GObject, Gtk
 from gi.repository import RB
 from gi.repository import WebKit
 
@@ -38,15 +37,15 @@ from gettext import gettext as _
 from mako.template import Template
 
 
-class LinksTab (gobject.GObject):
+class LinksTab (GObject.GObject):
 
     __gsignals__ = {
-        'switch-tab' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
-                                (gobject.TYPE_STRING,))
+        'switch-tab' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+                                (GObject.TYPE_STRING,))
     }
 
     def __init__ (self, shell, buttons, ds, view):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.shell      = shell
         self.sp         = shell.props.shell_player
         self.db         = shell.props.db
@@ -90,10 +89,10 @@ class LinksTab (gobject.GObject):
         self.view.load_links (self.datasource)
 
 
-class LinksView (gobject.GObject):
+class LinksView (GObject.GObject):
 
     def __init__ (self, shell, plugin, webview):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.shell    = shell
         self.plugin   = plugin
         self.webview  = webview
@@ -121,10 +120,10 @@ class LinksView (gobject.GObject):
         self.webview.load_string (self.file, 'text/html', 'utf-8', self.basepath)
 
 
-class LinksDataSource (gobject.GObject):
+class LinksDataSource (GObject.GObject):
 
     def __init__ (self, db):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
 
         self.db = db
         self.entry = None
diff --git a/plugins/context/LyricsTab.py b/plugins/context/LyricsTab.py
index d0cae85..7726dd7 100644
--- a/plugins/context/LyricsTab.py
+++ b/plugins/context/LyricsTab.py
@@ -24,25 +24,24 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
 import urllib
 import re, os
 import cgi
 from mako.template import Template
 
 import rb
-from gi.repository import Gtk
+from gi.repository import GObject, Gtk
 from gi.repository import RB
 
-class LyricsTab (gobject.GObject):
+class LyricsTab (GObject.GObject):
     
     __gsignals__ = {
-        'switch-tab' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
-                                (gobject.TYPE_STRING,))
+        'switch-tab' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+                                (GObject.TYPE_STRING,))
     }
 
     def __init__ (self, shell, toolbar, ds, view):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.shell      = shell
         self.sp         = shell.props.shell_player
         self.db         = shell.props.db
@@ -75,10 +74,10 @@ class LyricsTab (gobject.GObject):
         self.datasource.fetch_lyrics (entry)
         self.view.loading (self.datasource.get_artist(), self.datasource.get_title())
 
-class LyricsView (gobject.GObject):
+class LyricsView (GObject.GObject):
 
     def __init__ (self, shell, plugin, webview, ds):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.webview = webview
         self.ds      = ds
         self.shell   = shell
@@ -131,14 +130,14 @@ class LyricsView (gobject.GObject):
                                           stylesheet = self.styles)
         self.load_view ()
 
-class LyricsDataSource (gobject.GObject):
+class LyricsDataSource (GObject.GObject):
     
     __gsignals__ = {
-        'lyrics-ready' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (RB.RhythmDBEntry, gobject.TYPE_STRING,)),
+        'lyrics-ready' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (RB.RhythmDBEntry, GObject.TYPE_STRING,)),
     }
 
     def __init__ (self, db):
-        gobject.GObject.__init__ (self)
+        GObject.GObject.__init__ (self)
         self.db = db
         self.db.connect ('entry-extra-metadata-notify::rb:lyrics', self.lyrics_notify)
 
diff --git a/plugins/jamendo/JamendoSource.py b/plugins/jamendo/JamendoSource.py
index 0076eed..10650e3 100644
--- a/plugins/jamendo/JamendoSource.py
+++ b/plugins/jamendo/JamendoSource.py
@@ -22,13 +22,12 @@
 #     Copyright (C), 2006 Adam Zimmerman <adam_zimmerman sfu ca>
 
 import os
-import gobject
 import xml
 import gzip
 import datetime
 
 import rb
-from gi.repository import Gtk, Gdk, Gio
+from gi.repository import GObject, Gtk, Gdk, Gio
 from gi.repository import RB
 
 from JamendoSaxHandler import JamendoSaxHandler
@@ -123,17 +122,17 @@ class JamendoSource(RB.BrowserSource):
 			self.__show_loading_screen (True)
 
 			# start our catalogue updates
-			self.__update_id = gobject.timeout_add_seconds(6 * 60 * 60, self.__update_catalogue)
+			self.__update_id = GObject.timeout_add_seconds(6 * 60 * 60, self.__update_catalogue)
 			self.__update_catalogue()
 
 
 	def do_delete_thyself(self):
 		if self.__update_id != 0:
-			gobject.source_remove (self.__update_id)
+			GObject.source_remove (self.__update_id)
 			self.__update_id = 0
 
 		if self.__notify_id != 0:
-			gobject.source_remove (self.__notify_id)
+			GObject.source_remove (self.__notify_id)
 			self.__notify_id = 0
 
 		if self.__catalogue_loader:
@@ -256,7 +255,7 @@ class JamendoSource(RB.BrowserSource):
 			return False
 
 		if self.__notify_id == 0:
-			self.__notify_id = gobject.idle_add(change_idle_cb)
+			self.__notify_id = GObject.idle_add(change_idle_cb)
 
 
 	# Download album
@@ -318,7 +317,7 @@ class JamendoSource(RB.BrowserSource):
 		if entry.get_entry_type() != self.__db.entry_type_get_by_name("JamendoEntryType"):
 			return
 
-		gobject.idle_add(self.emit_cover_art_uri, entry)
+		GObject.idle_add(self.emit_cover_art_uri, entry)
 
 	def emit_cover_art_uri (self, entry):
 		stream = self.__db.entry_get_string (entry, RB.RhythmDBPropType.LOCATION)
@@ -328,4 +327,4 @@ class JamendoSource(RB.BrowserSource):
 		self.__db.emit_entry_extra_metadata_notify (entry, "rb:coverArt-uri", str(url))
 		return False
 
-gobject.type_register(JamendoSource)
+GObject.type_register(JamendoSource)
diff --git a/plugins/jamendo/jamendo.py b/plugins/jamendo/jamendo.py
index dc1a4d2..a63b680 100644
--- a/plugins/jamendo/jamendo.py
+++ b/plugins/jamendo/jamendo.py
@@ -29,13 +29,11 @@
 # Parts from "Magnatune Rhythmbox plugin" (stolen from rhythmbox's __init__.py)
 #     Copyright (C), 2006 Adam Zimmerman <adam_zimmerman sfu ca>
 
-import gobject
-
 from JamendoSource import JamendoSource
 from JamendoConfigureDialog import JamendoConfigureDialog
 
 import rb
-from gi.repository import Gtk, Gio, Peas
+from gi.repository import GObject, Gtk, Gio, Peas
 from gi.repository import RB
 
 popup_ui = """
@@ -64,9 +62,9 @@ class JamendoEntryType(RB.RhythmDBEntryType):
 	def do_sync_metadata(self, entry, changes):
 		return
 
-class Jamendo(gobject.GObject, Peas.Activatable):
+class Jamendo(GObject.GObject, Peas.Activatable):
 	__gtype_name__ = 'Jamendo'
-	object = gobject.property(type=gobject.GObject)
+	object = GObject.property(type=GObject.GObject)
 
 	#
 	# Core methods
@@ -87,7 +85,7 @@ class Jamendo(gobject.GObject, Peas.Activatable):
 
 		group = RB.DisplayPageGroup.get_by_id ("stores")
 		settings = Gio.Settings("org.gnome.rhythmbox.plugins.jamendo")
-		self.source = gobject.new (JamendoSource,
+		self.source = GObject.new (JamendoSource,
 					   shell=shell,
 					   entry_type=self.entry_type,
 					   plugin=self,
diff --git a/plugins/lyrics/LyricsConfigureDialog.py b/plugins/lyrics/LyricsConfigureDialog.py
index f4bc5a7..9a04e99 100644
--- a/plugins/lyrics/LyricsConfigureDialog.py
+++ b/plugins/lyrics/LyricsConfigureDialog.py
@@ -27,7 +27,6 @@
 
 from LyricsSites import lyrics_sites
 
-import gobject
 from os import system, path
 
 import rb
@@ -110,7 +109,7 @@ class LyricsConfigureDialog (GObject.Object, PeasGtk.Configurable):
 	def get_prefs (self):
 		try:
 			sites = self.settings['sites']
-		except gobject.GError, e:
+		except GObject.GError, e:
 			print e
 			engines = []
 		folder = self.settings['folder']
diff --git a/plugins/lyrics/LyricsParse.py b/plugins/lyrics/LyricsParse.py
index 995c986..c7bd9f5 100644
--- a/plugins/lyrics/LyricsParse.py
+++ b/plugins/lyrics/LyricsParse.py
@@ -26,10 +26,9 @@
 
 import urllib
 import re
-import gobject
 
 import rb
-from gi.repository import Gio
+from gi.repository import GObject, Gio
 
 from LyricsSites import lyrics_sites
 
@@ -41,7 +40,7 @@ class Parser (object):
 		try:
 			settings = Gio.Settings("org.gnome.rhythmbox.plugins.lyrics")
 			self.sites = settings['sites']
-		except gobject.GError, e:
+		except GObject.GError, e:
 			print e
 			self.sites = []
 
diff --git a/plugins/magnatune/MagnatuneSource.py b/plugins/magnatune/MagnatuneSource.py
index 6c683c2..db210a2 100644
--- a/plugins/magnatune/MagnatuneSource.py
+++ b/plugins/magnatune/MagnatuneSource.py
@@ -26,7 +26,6 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
 import os
-import gobject
 import xml
 import urllib
 import urlparse
@@ -36,7 +35,7 @@ import gnomekeyring as keyring
 
 import rb
 from gi.repository import RB
-from gi.repository import Gtk, Gio
+from gi.repository import GObject, Gtk, Gio
 # XXX use GnomeKeyring when introspection is available
 
 from TrackListHandler import TrackListHandler
@@ -65,7 +64,7 @@ class MagnatuneSource(RB.BrowserSource):
 		# source state
 		self.__activated = False
 		self.__db = None
-		self.__notify_id = 0 # gobject.idle_add id for status notifications
+		self.__notify_id = 0 # GObject.idle_add id for status notifications
 		self.__info_screen = None # the loading screen
 
 		# track data
@@ -76,7 +75,7 @@ class MagnatuneSource(RB.BrowserSource):
 		# catalogue stuff
 		self.__updating = True # whether we're loading the catalog right now
 		self.__has_loaded = False # whether the catalog has been loaded yet
-		self.__update_id = 0 # gobject.idle_add id for catalog updates
+		self.__update_id = 0 # GObject.idle_add id for catalog updates
 		self.__catalogue_loader = None
 		self.__catalogue_check = None
 		self.__load_progress = (0, 0) # (complete, total)
@@ -134,7 +133,7 @@ class MagnatuneSource(RB.BrowserSource):
 			self.__show_loading_screen(True)
 
 			# start our catalogue updates
-			self.__update_id = gobject.timeout_add_seconds(6 * 60 * 60, self.__update_catalogue)
+			self.__update_id = GObject.timeout_add_seconds(6 * 60 * 60, self.__update_catalogue)
 			self.__update_catalogue()
 
 	def do_impl_can_delete(self):
@@ -148,11 +147,11 @@ class MagnatuneSource(RB.BrowserSource):
 
 	def do_delete_thyself(self):
 		if self.__update_id != 0:
-			gobject.source_remove(self.__update_id)
+			GObject.source_remove(self.__update_id)
 			self.__update_id = 0
 
 		if self.__notify_id != 0:
-			gobject.source_remove(self.__notify_id)
+			GObject.source_remove(self.__notify_id)
 			self.__notify_id = 0
 
 		if self.__catalogue_loader is not None:
@@ -384,7 +383,7 @@ class MagnatuneSource(RB.BrowserSource):
 			return False
 
 		if self.__notify_id == 0:
-			self.__notify_id = gobject.idle_add(change_idle_cb)
+			self.__notify_id = GObject.idle_add(change_idle_cb)
 
 	#
 	# internal purchasing code
@@ -548,7 +547,7 @@ class MagnatuneSource(RB.BrowserSource):
 		if entry.get_entry_type() != self.__db.entry_type_get_by_name("MagnatuneEntryType"):
 			return
 
-		gobject.idle_add(self.emit_cover_art_uri, entry)
+		GObject.idle_add(self.emit_cover_art_uri, entry)
 
 	def emit_cover_art_uri(self, entry):
 		sku = self.__sku_dict[self.__db.entry_get_string(entry, RB.RhythmDBPropType.LOCATION)]
@@ -556,4 +555,4 @@ class MagnatuneSource(RB.BrowserSource):
 		self.__db.emit_entry_extra_metadata_notify(entry, 'rb:coverArt-uri', url)
 		return False
 
-gobject.type_register(MagnatuneSource)
+GObject.type_register(MagnatuneSource)
diff --git a/plugins/magnatune/magnatune.py b/plugins/magnatune/magnatune.py
index f7d03ac..07ac3cb 100644
--- a/plugins/magnatune/magnatune.py
+++ b/plugins/magnatune/magnatune.py
@@ -25,8 +25,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject
-
 import urllib
 import zipfile
 import sys, os.path
@@ -37,7 +35,7 @@ import gnomekeyring as keyring
 
 import rb
 from gi.repository import RB
-from gi.repository import Gtk, Gio, Peas, PeasGtk
+from gi.repository import GObject, Gtk, Gio, Peas, PeasGtk
 # XXX use GnomeKeyring when available
 
 from MagnatuneSource import MagnatuneSource
@@ -69,14 +67,14 @@ class MagnatuneEntryType(RB.RhythmDBEntryType):
 	def sync_metadata(self, entry, changes):
 		return
 
-class Magnatune(gobject.GObject, Peas.Activatable):
+class Magnatune(GObject.GObject, Peas.Activatable):
 	__gtype_name__ = 'Magnatune'
-	object = gobject.property(type=gobject.GObject)
+	object = GObject.property(type=GObject.GObject)
 
 	format_list = ['ogg', 'flac', 'wav', 'mp3-vbr', 'mp3-cbr']
 
 	def __init__(self):
-		gobject.GObject.__init__(self)
+		GObject.GObject.__init__(self)
 
 	def do_activate(self):
 		shell = self.object
@@ -95,7 +93,7 @@ class Magnatune(gobject.GObject, Peas.Activatable):
 
 		group = RB.DisplayPageGroup.get_by_id ("stores")
 		settings = Gio.Settings("org.gnome.rhythmbox.plugins.magnatune")
-		self.source = gobject.new(MagnatuneSource,
+		self.source = GObject.new(MagnatuneSource,
 					  shell=shell,
 					  entry_type=self.entry_type,
 					  pixbuf=icon,
@@ -153,12 +151,12 @@ class Magnatune(gobject.GObject, Peas.Activatable):
 		self.source.playing_entry_changed(entry)
 
 
-class MagnatuneConfig(gobject.GObject, PeasGtk.Configurable):
+class MagnatuneConfig(GObject.GObject, PeasGtk.Configurable):
 	__gtype_name__ = 'MagnatuneConfig'
-	object = gobject.property(type=gobject.GObject)
+	object = GObject.property(type=GObject.GObject)
 
 	def __init__(self):
-		gobject.GObject.__init__(self)
+		GObject.GObject.__init__(self)
 
 	def do_create_configure_widget(self):
 		# We use a dictionary so we can modify these values from within inner functions
diff --git a/plugins/rb/Loader.py b/plugins/rb/Loader.py
index 8276001..42e907a 100644
--- a/plugins/rb/Loader.py
+++ b/plugins/rb/Loader.py
@@ -24,8 +24,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import gobject, glib
-from gi.repository import Gdk, Gio
+from gi.repository import GObject, GLib, Gdk, Gio
 import sys
 
 def callback_with_gdk_lock(callback, data, args):
@@ -98,10 +97,10 @@ class ChunkLoader(object):
 			print "error reading file %s" % (self.uri)
 			sys.excepthook(*sys.exc_info())
 			stream.close()
-			gobject.idle_add(self._error_idle_cb, e)
+			GObject.idle_add(self._error_idle_cb, e)
 
 		if (self._callback_gdk(data) is not False) and data:
-			stream.read_async (self.chunksize, glib.PRIORITY_DEFAULT, self._cancel, self._read_cb, None)
+			stream.read_async (self.chunksize, GLib.PRIORITY_DEFAULT, self._cancel, self._read_cb, None)
 		else:
 			# finished or cancelled by callback
 			stream.close()
@@ -115,14 +114,14 @@ class ChunkLoader(object):
 			sys.excepthook(*sys.exc_info())
 			self._callback_gdk(e)
 
-		stream.read_async(self.chunksize, glib.PRIORITY_DEFAULT, self._cancel, self._read_cb, None)
+		stream.read_async(self.chunksize, GLib.PRIORITY_DEFAULT, self._cancel, self._read_cb, None)
 
 	def _info_cb(self, file, result):
 		try:
 			info = file.query_info_finish(result)
 			self.total = info.get_attribute_uint64(Gio.FILE_ATTRIBUTE_STANDARD_SIZE)
 
-			file.read_async(glib.PRIORITY_DEFAULT, self._cancel, self._open_cb, None)
+			file.read_async(GLib.PRIORITY_DEFAULT, self._cancel, self._open_cb, None)
 		except Exception, e:
 			print "error checking size of source file %s" % (self.uri)
 			sys.excepthook(*sys.exc_info())
@@ -143,9 +142,9 @@ class ChunkLoader(object):
 
 			file = gio.File(uri)
 			if want_size:
-				file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_SIZE, Gio.FileQueryInfoFlags.NONE, glib.PRIORITY_DEFAULT, self._cancel, self._info_cb, None)
+				file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_SIZE, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_DEFAULT, self._cancel, self._info_cb, None)
 			else:
-				file.read_async(glib.PRIORITY_DEFAULT, self._cancel, self._open_cb, None)
+				file.read_async(GLib.PRIORITY_DEFAULT, self._cancel, self._open_cb, None)
 		except Exception, e:
 			print "error reading file %s: %s" % (uri, e.message)
 			self._callback(e)
@@ -179,7 +178,7 @@ class UpdateCheck(object):
 			self.local_mod = lfi.get_attribute_uint64(Gio.FILE_ATTRIBUTE_TIME_MODIFIED)
 
 			rf = Gio.file_new_for_uri(remote)
-			rf.query_info_async(Gio.FILE_ATTRIBUTE_TIME_MODIFIED, Gio.FileQueryInfoFlags.NONE, glib.PRIORITY_DEFAULT, self._cancel, self._file_info_cb, None)
+			rf.query_info_async(Gio.FILE_ATTRIBUTE_TIME_MODIFIED, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_DEFAULT, self._cancel, self._file_info_cb, None)
 		except Exception, e:
 			sys.excepthook(*sys.exc_info())
 			self.callback(True, *self.args)
diff --git a/plugins/replaygain/player.py b/plugins/replaygain/player.py
index 130004d..1959b1f 100644
--- a/plugins/replaygain/player.py
+++ b/plugins/replaygain/player.py
@@ -25,12 +25,9 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 #
 
-import gobject
-import gst
-
 import rb
 from gi.repository import RB
-from gi.repository import Gio
+from gi.repository import GObject, Gio, Gst
 
 import config
 
@@ -42,7 +39,7 @@ class ReplayGainPlayer(object):
 		missing = []
 		required = ("rgvolume", "rglimiter")
 		for e in required:
-			if gst.element_factory_find(e) is None:
+			if Gst.ElementFactory.find(e) is None:
 				missing.append(e)
 
 		if len(missing) > 0:
@@ -62,7 +59,7 @@ class ReplayGainPlayer(object):
 
 		# we use different means to hook into the playback pipeline depending on
 		# the playback backend in use
-		if gobject.signal_lookup("get-stream-filters", self.player):
+		if GObject.signal_lookup("get-stream-filters", self.player):
 			self.setup_xfade_mode()
 			self.deactivate_backend = self.deactivate_xfade_mode
 		else:
@@ -144,8 +141,8 @@ class ReplayGainPlayer(object):
 		print "bouncing rgvolume state to reset tags"
 		# somehow need to decide whether we've already got a gain value for the new track
 		#self.resetting_rgvolume = True
-		rgvolume.set_state(gst.STATE_READY)
-		rgvolume.set_state(gst.STATE_PLAYING)
+		rgvolume.set_state(Gst.State.READY)
+		rgvolume.set_state(Gst.State.PLAYING)
 		#self.resetting_rgvolume = False
 		pad.set_blocked_async(False, self.rgvolume_reset_done, rgvolume)
 
@@ -162,9 +159,9 @@ class ReplayGainPlayer(object):
 
 	def setup_playbin2_mode(self):
 		print "using output filter for rgvolume and rglimiter"
-		self.rgvolume = gst.element_factory_make("rgvolume")
+		self.rgvolume = Gst.ElementFactory.make("rgvolume", None)
 		self.rgvolume.connect("notify::target-gain", self.playbin2_target_gain_cb)
-		self.rglimiter = gst.element_factory_make("rglimiter")
+		self.rglimiter = Gst.ElementFactory.make("rglimiter", None)
 
 		# on track changes, we need to reset the rgvolume state, otherwise it
 		# carries over the tags from the previous track
@@ -177,19 +174,10 @@ class ReplayGainPlayer(object):
 		else:
 			playbin.connect("notify::uri", self.playbin2_uri_notify_cb)
 
-		# try to work around bug #621632
-		if gobject.pygobject_version > (2,21,1):
-			print "working around pygobject/gst-python refcount bug.."
-			self.player.add_filter(self.rgvolume)
-			self.player.add_filter(self.rglimiter)
-			self.rgfilter = None
-		else:
-			self.rgfilter = gst.Bin()
-			self.rgfilter.add(self.rgvolume, self.rglimiter)
-			self.rgvolume.link(self.rglimiter)
-			self.rgfilter.add_pad(gst.GhostPad("sink", self.rgvolume.get_static_pad("sink")))
-			self.rgfilter.add_pad(gst.GhostPad("src", self.rglimiter.get_static_pad("src")))
-			self.player.add_filter(self.rgfilter)
+		# work around bug #621632 by adding these as separate filters
+		self.player.add_filter(self.rgvolume)
+		self.player.add_filter(self.rglimiter)
+		self.rgfilter = None
 
 	def deactivate_playbin2_mode(self):
 		if self.rgfilter == None:
@@ -213,7 +201,7 @@ class ReplayGainPlayer(object):
 
 	def create_stream_filter_cb(self, player, uri):
 		print "creating rgvolume instance for stream %s" % uri
-		rgvolume = gst.element_factory_make("rgvolume")
+		rgvolume = Gst.ElementFactory.make("rgvolume", None)
 		rgvolume.connect("notify::target-gain", self.xfade_target_gain_cb)
 		self.set_rgvolume(rgvolume)
 		return [rgvolume]
@@ -229,7 +217,7 @@ class ReplayGainPlayer(object):
 		self.stream_filter_id = self.player.connect("get-stream-filters", self.create_stream_filter_cb)
 
 		# and add rglimiter as an output filter
-		self.rglimiter = gst.element_factory_make("rglimiter")
+		self.rglimiter = Gst.ElementFactory.make("rglimiter", None)
 		self.player.add_filter(self.rglimiter)
 
 	def deactivate_xfade_mode(self):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]