yes.
This commit is contained in:
parent
6e7af85276
commit
225a04a4fd
1 changed files with 15 additions and 4 deletions
19
main.py
19
main.py
|
@ -42,6 +42,9 @@ is_scrolling_art = False
|
|||
cover_art_offset_x = 0
|
||||
cover_art_offset_y = 96
|
||||
|
||||
last_cover_art = Image.new('RGB',(32,32),color='white')
|
||||
las_song = ''
|
||||
|
||||
token = None #oauth2.SpotifyOAuth(username, scope, client_id, client_secret, redirect_uri)
|
||||
|
||||
#token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
|
||||
|
@ -99,11 +102,19 @@ def showImage(image, offset_x = 0, offset_y = 0):
|
|||
|
||||
def drawCanvas():
|
||||
canvas = Image.new('RGB', (192, 128), color = 'black')
|
||||
global last_song
|
||||
|
||||
was_playing = is_playing
|
||||
|
||||
cover_art = get_track()
|
||||
|
||||
global is_scrolling_art
|
||||
if (cover_art is None):
|
||||
return
|
||||
if not (last_song == song_name):
|
||||
|
||||
|
||||
last_cover_art = cover_art
|
||||
if(was_playing and not is_playing):
|
||||
is_scrolling_art = True
|
||||
scroll = threading.Thread(target=scrollDownSongInfo)
|
||||
|
@ -135,9 +146,9 @@ def drawCanvas():
|
|||
|
||||
showImage(canvas)
|
||||
|
||||
def scrollDownSongInfo(offset_x=0,offset_y=96):
|
||||
def scrollDownSongInfo(offset_x=0,offset_y=96, song_name=song_name, artist_name=artist_name, cover_art=get_track()):
|
||||
global is_scrolling_art
|
||||
cover_art = get_track()
|
||||
#cover_art = get_track()
|
||||
if (cover_art is None):
|
||||
return
|
||||
for i in range(33):
|
||||
|
@ -151,9 +162,9 @@ def scrollDownSongInfo(offset_x=0,offset_y=96):
|
|||
time.sleep(0.001)
|
||||
is_scrolling_art = False
|
||||
|
||||
def scrollUpSongInfo(offset_x=0, offset_y=96):
|
||||
def scrollUpSongInfo(offset_x=0, offset_y=96, song_name=song_name, artist_name=artist_name, cover_art=get_track()):
|
||||
global is_scrolling_art
|
||||
cover_art = get_track()
|
||||
#cover_art = get_track()
|
||||
if (cover_art is None):
|
||||
return
|
||||
for i in range(33):
|
||||
|
|
Loading…
Reference in a new issue