This is

as days pass by, by Stuart Langridge

. Here I write about many things. In the past I wrote about other things but the past is past. I write code for people to play with, I write about my life on Twitter, and I write here.

On I wrote Controlling Banshee over D-Bus, on the subject of Web.

I needed to be able to control Banshee from another application, and it turns out it has a lovely D-Bus API. Skip to the next song*:
import dbus
bus = dbus.SessionBus()
banshee = bus.get_object("org.bansheeproject.Banshee", 
  "/org/bansheeproject/Banshee/PlaybackController")
banshee.Next(False) # use banshee.Previous(False) to skip back one song
Start Banshee playing (this works even if Banshee isn't running; D-Bus starts it up!):
import dbus
bus = dbus.SessionBus()
banshee = bus.get_object("org.bansheeproject.Banshee", 
  "/org/bansheeproject/Banshee/PlayerEngine") # note PlayerEngine, not PlaybackController
banshee.Play() # use banshee.Pause() to pause playback
I found these commands using D-Feet*, J5's D-Bus browser thing, which is great. The program I'm using to call this stuff is open source Enso from the Humanized team, which is also pretty darn useful.
Anders Rune Jensen

Thanks for the hint on enso. I didn't know they released the source under a BSD license. Very cool, I remember seeing it a while ago and thinking that it would be really cool if it was open as people would extend it with all kinds of useful features. I can see that you're already doing exactly that :)

Roger / oojah

D-Feet. Nyom. Thanks for that.

Kalle

Sweet! I'm also discovering the wonders of dbus. Pretty amazing stuff.

banshee

[...] = dbus.SessionBus banshee = bus.get_object&quotorg.bansheeproject.Banshee&quot, &quot/org/bansheephttp://www.kryogenix.org/days/2008/07/02/controlling-banshee-over-d-busA&E Calendar The Fremont ArgusMUSIC FREMONTThe Central Park summer concert series, presented by The [...]

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.