Commit 4990b1dc authored by Thorfin89's avatar Thorfin89

Synchro portable

parent 5dfcd4e7
https://www.iconfinder.com/search/icons?q=music&style=outline&license=gte__3
51
\ No newline at end of file
43
\ No newline at end of file
......@@ -34,6 +34,9 @@ class Radio(Pupitre):
sauvegarde.write(vol_potar)
sauvegarde.close()
def radio_mute(self):
self.player.audio_set_volume(0)
app = Radio() # instancie l'application
app.boucle()
......@@ -38,17 +38,31 @@ class Pupitre:
lbl_radio = tk.Label(bandeau, text="RADIO")
lbl_radio.pack(padx=20, pady=10)
# images des boutons
self.icon_play = tk.PhotoImage(file="icons/play.png")
self.icon_pause = tk.PhotoImage(file="icons/pause4.png")
self.icon_stop = tk.PhotoImage(file="icons/stop.png")
self.icon_sound = tk.PhotoImage(file="icons/sound.png")
self.icon_mute = tk.PhotoImage(file="icons/mute.png")
# boutons de commande
btn_play = ttk.Button(menu, text="Play", command=self.radio_play)
btn_play.grid(row=1, column=0, padx=10)
btn_pause = ttk.Button(menu, text="Pause", command=self.radio_pause)
btn_pause.grid(row=1, column=1, padx=10)
btn_stop = ttk.Button(menu, text="Stop", command=self.radio_stop)
btn_stop.grid(row=1, column=2, padx=10)
btn_play = ttk.Button(menu, image=self.icon_play, text="Play", command=self.radio_play)
btn_play.grid(row=1, column=0, padx=0)
btn_pause = ttk.Button(menu, image=self.icon_pause, text="Pause", command=self.radio_pause)
btn_pause.grid(row=1, column=1, padx=0)
btn_stop = ttk.Button(menu, image=self.icon_stop, text="Stop", command=self.radio_stop)
btn_stop.grid(row=1, column=2, padx=0)
# potentiomètre de volume
lecture = open("init", "r") # on charge configuration sauvegardée
volume_init = lecture.read()
vol_potar = Scale(menu, from_=0, to=100, tickinterval=20, orient=HORIZONTAL, length=200, label="Volume", command=self.volume)
vol_potar.set(volume_init)
self.volume_init = lecture.read()
vol_potar = Scale(menu, from_=0, to=100, tickinterval=20, orient=HORIZONTAL, length=250, label="Volume",
command=self.volume)
vol_potar.set(self.volume_init)
vol_potar.grid(pady=10, row=2, column=0, columnspan=3)
btn_stop = ttk.Button(menu, image=self.icon_mute, text="Mute", command=radio_mute)
btn_stop.grid(row=3, column=1, padx=0)
btn_stop = ttk.Button(menu, image=self.icon_sound, text="Sound", command=None)
btn_stop.grid(row=3, column=2, padx=0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment