Commit 0d97eb9f authored by Thorfin89's avatar Thorfin89

Ajout du potentiomètre de volume

parent 8e9a2c37
......@@ -29,6 +29,11 @@ class Radio(Pupitre):
def radio_stop(self):
self.player.stop()
def volume(self, vol):
# on récupère la valeur du potentiomètre de volume
vol_audio = int(vol)
self.player.audio_set_volume(vol_audio)
app = Radio() # instancie l'application
app.boucle()
......@@ -10,6 +10,8 @@
# import ----------------------------------
import tkinter as tk
from tkinter import ttk
from tkinter import Tk, RIGHT, LEFT, SOLID, VERTICAL
from tkinter import Frame, Label, Button, messagebox, Scale
# classes ---------------------------------
......@@ -39,6 +41,7 @@ class Pupitre:
# affichage de la radio en cours de lecture
lbl_radio = tk.Label(bandeau, text="RADIO")
lbl_radio.pack(padx=20, pady=10)
# boutons de commande
btn_play = ttk.Button(menu, text="Play", command=self.radio_play)
btn_play.pack()
......@@ -46,3 +49,8 @@ class Pupitre:
btn_pause.pack()
btn_stop = ttk.Button(menu, text="Stop", command=self.radio_stop)
btn_stop.pack()
# potar volume
potar = Scale(menu, from_=100, to=0, orient=VERTICAL, length=200, command=self.volume)
potar.pack(padx=10, pady=5)
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