-
Notifications
You must be signed in to change notification settings - Fork 0
/
lyrics.py
123 lines (101 loc) · 4.2 KB
/
lyrics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.13
# In conjunction with Tcl version 8.6
# May 26, 2018 06:06:13 PM
import sys
import Spotify
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
import lyrics_support
def vp_start_gui():
'''Starting point when module is the main routine.'''
global val, w, root
root = Tk()
top = Get_Lyrics (root)
lyrics_support.init(root, top)
root.mainloop()
w = None
def create_Get_Lyrics(root, *args, **kwargs):
'''Starting point when module is imported by another program.'''
global w, w_win, rt
rt = root
w = Toplevel (root)
top = Get_Lyrics (w)
lyrics_support.init(w, top, *args, **kwargs)
return (w, top)
def destroy_Get_Lyrics():
global w
w.destroy()
w = None
class Get_Lyrics:
def __init__(self, top=None):
'''This class configures and populates the toplevel window.
top is the toplevel containing window.'''
_bgcolor = '#d9d9d9' # X11 color: 'gray85'
_fgcolor = '#000000' # X11 color: 'black'
_compcolor = '#d9d9d9' # X11 color: 'gray85'
_ana1color = '#d9d9d9' # X11 color: 'gray85'
_ana2color = '#d9d9d9' # X11 color: 'gray85'
top.geometry("404x200+775+335")
top.title("Get Lyrics")
top.configure(background="#212121")
top.configure(highlightcolor="black")
self.btnGo = Button(top)
self.btnGo.place(relx=0.77, rely=0.25, height=49, width=79)
self.btnGo.configure(activebackground="#d9d9d9")
self.btnGo.configure(background="#212121")
self.btnGo.configure(borderwidth="0")
self.btnGo.configure(foreground="#ffffff")
self.btnGo.configure(text='''Vai!''')
self.btnGo.bind('<Button-1>',lambda e:lyrics_support.btnGoClick(e, self.txtTitle, self.txtArtist))
self.txtArtist = Entry(top)
self.txtArtist.place(relx=0.1, rely=0.2,height=21, relwidth=0.53)
self.txtArtist.configure(background="#424242")
self.txtArtist.configure(borderwidth="0")
self.txtArtist.configure(font="TkFixedFont")
self.txtArtist.configure(foreground="#ffffff")
self.txtArtist.configure(selectbackground="#c4c4c4")
self.labelArtist = Label(top)
self.labelArtist.place(relx=0.07, rely=0.05, height=21, width=39)
self.labelArtist.configure(activebackground="#424242")
self.labelArtist.configure(activeforeground="white")
self.labelArtist.configure(activeforeground="#ffffff")
self.labelArtist.configure(background="#212121")
self.labelArtist.configure(foreground="#ffffff")
self.labelArtist.configure(text='''Artist''')
self.txtTitle = Entry(top)
self.txtTitle.place(relx=0.1, rely=0.45,height=21, relwidth=0.53)
self.txtTitle.configure(background="#424242")
self.txtTitle.configure(borderwidth="0")
self.txtTitle.configure(font="TkFixedFont")
self.txtTitle.configure(foreground="#ffffff")
self.txtTitle.configure(selectbackground="#c4c4c4")
self.labelTitle = Label(top)
self.labelTitle.place(relx=0.07, rely=0.35, height=19, width=31)
self.labelTitle.configure(activebackground="#f9f9f9")
self.labelTitle.configure(background="#212121")
self.labelTitle.configure(borderwidth="0")
self.labelTitle.configure(foreground="#ffffff")
self.labelTitle.configure(text='''Title''')
self.labelSpotify = Label(top)
self.labelSpotify.place(relx=0.02, rely=0.7, height=60, width=379)
self.labelSpotify.configure(activebackground="#f9f9f9")
self.labelSpotify.configure(background="#212121")
self.labelSpotify.configure(foreground="#ffffff")
self.labelSpotify.bind('<Button-1>',lambda e:lyrics_support.spotifyLabelClick(e))
if Spotify.Spotify().isSpotifyPlaying:
s = Spotify.Spotify().currentSong
output=f"Stai ascoltando:\n{s.title} di {s.artist}.\nClicca qui per avere il testo"
self.labelSpotify.configure(text=output)
if __name__ == '__main__':
vp_start_gui()