libsaria: Sources play song id

I find the filepath using the new library, rather than having the
library play the song.  I only really want the library for managing
collected music.  It shouldn't touch music playback at all.
This commit is contained in:
Bryan Schumaker 2011-05-21 16:14:08 -04:00
parent c357a35313
commit 297775896e
2 changed files with 5 additions and 4 deletions

View File

@ -38,7 +38,7 @@ class Source:
def get_attrs(*attrs):
# I should probably get a lock here...
if cur_id:
return oldlibrary.get_attrs(cur_id, *attrs)
return library.get_attrs(cur_id, *attrs)
return -1
def set_attr(attr, value):
@ -64,8 +64,10 @@ def make_library(path):
def play_id(id):
global cur_id
cur_id = id
oldlibrary.play_id(id)
file = get_attrs("filepath")[0]
queue.rm_ids([id])
controls.load(file)
controls.play()
def next():
global cur_id

View File

@ -55,8 +55,7 @@ def get_attrs(id, *attrs):
track = find_id(id)
if track == None:
unlock_library()
from libsaria.sources import oldlibrary
return oldlibrary.get_attrs(id, *attrs)
return None
get = track.__dict__.get
res = []