You are not logged in.

#1 2008-09-03 12:18:18

krims0n
Member
Registered: 2008-08-25
Posts: 17

dbus banshee question

Hi,

Trying to readout the current playing track in Banshee using dbus in Python. This works fine, but, when Banshee is not running and I run my Python script the dbus call causes Banshee to startup (WTF tongue). How can I prevent this from happening ? Is this a problem in Banshee or my code ?

#!/usr/bin/env python

import dbus

bus = dbus.SessionBus()
banshee = bus.get_object("org.bansheeproject.Banshee", "/org/bansheeproject/Banshee/PlayerEngine")

if banshee:
        currentTrack = banshee.GetCurrentTrack()
        state = banshee.GetCurrentState()
        if state == 'playing':
                print(currentTrack['artist'] + " - " + currentTrack['name'])
        else:
                print "Stopped"
else:
        print "Banshee not running"

Offline

Board footer

Powered by FluxBB