Playlist next()

The playlist can play the next song in the playlist.
This commit is contained in:
Bryan Schumaker 2010-11-12 08:04:26 -05:00
parent 2c4d42920e
commit ed2e5b882b
2 changed files with 19 additions and 4 deletions

View File

@ -67,12 +67,12 @@ def change_score():
def plist_next():
change_score()
choose_next()
playlist.next()
def catch_eos(*args):
inc_count(cur_lib_id)
inc_score(cur_lib_id)
choose_next()
playlist.next()
libsaria.event.invite("POSTEOS", catch_eos)

View File

@ -2,12 +2,14 @@
import libsaria
from libsaria.collection import library
call = libsaria.event.call
song_list = None
song_set = None
filtered = False
visible = None
filtered = False
visible = None
cur_index = -1
def add_id(id):
global song_list
@ -56,3 +58,16 @@ def is_visible(id):
if filtered == True:
return id in visible
return True
def seq_next():
global cur_index
global song_list
cur_index += 1
while is_visible(song_list[cur_index]) == False:
cur_index += 1
return song_list[cur_index]
def next():
id = seq_next()
return call("NEXT", library.play_id, id)