forked from Wobbl/Wobuzz
Got it working, but it's not better than before...
This commit is contained in:
parent
6134c21ce4
commit
22ffd211df
7 changed files with 48 additions and 18 deletions
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import time
|
||||
import threading
|
||||
import pygame.mixer
|
||||
import pygame.event
|
||||
|
@ -174,6 +175,15 @@ class Player:
|
|||
def start_playlist(self, playlist):
|
||||
self.stop()
|
||||
|
||||
if not playlist.loaded:
|
||||
playlist.load()
|
||||
|
||||
while not playlist.has_tracks() and not playlist.loaded: # wait until first track is loaded
|
||||
time.sleep(0.1)
|
||||
|
||||
if not playlist.has_tracks():
|
||||
return
|
||||
|
||||
self.current_sound, self.current_sound_duration = playlist.set_track(0) # first track
|
||||
self.current_playlist = playlist
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue