Playlist next()
The playlist can play the next song in the playlist.
This commit is contained in:
parent
2c4d42920e
commit
ed2e5b882b
|
@ -67,12 +67,12 @@ def change_score():
|
||||||
|
|
||||||
def plist_next():
|
def plist_next():
|
||||||
change_score()
|
change_score()
|
||||||
choose_next()
|
playlist.next()
|
||||||
|
|
||||||
def catch_eos(*args):
|
def catch_eos(*args):
|
||||||
inc_count(cur_lib_id)
|
inc_count(cur_lib_id)
|
||||||
inc_score(cur_lib_id)
|
inc_score(cur_lib_id)
|
||||||
choose_next()
|
playlist.next()
|
||||||
libsaria.event.invite("POSTEOS", catch_eos)
|
libsaria.event.invite("POSTEOS", catch_eos)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,14 @@
|
||||||
|
|
||||||
import libsaria
|
import libsaria
|
||||||
from libsaria.collection import library
|
from libsaria.collection import library
|
||||||
|
call = libsaria.event.call
|
||||||
|
|
||||||
song_list = None
|
song_list = None
|
||||||
song_set = None
|
song_set = None
|
||||||
|
|
||||||
filtered = False
|
filtered = False
|
||||||
visible = None
|
visible = None
|
||||||
|
cur_index = -1
|
||||||
|
|
||||||
def add_id(id):
|
def add_id(id):
|
||||||
global song_list
|
global song_list
|
||||||
|
@ -56,3 +58,16 @@ def is_visible(id):
|
||||||
if filtered == True:
|
if filtered == True:
|
||||||
return id in visible
|
return id in visible
|
||||||
return True
|
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue