Valider 0d97eb9f rédigé par Thorfin89's avatar Thorfin89
Parcourir les fichiers

Ajout du potentiomètre de volume

parent 8e9a2c37
Chargement en cours
Chargement en cours
Chargement en cours
Chargement en cours
+5 −0
Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -29,6 +29,11 @@ class Radio(Pupitre):
    def radio_stop(self):
    def radio_stop(self):
        self.player.stop()
        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 = Radio()  # instancie l'application
app.boucle()
app.boucle()
+8 −0
Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -10,6 +10,8 @@
# import ----------------------------------
# import ----------------------------------
import tkinter as tk
import tkinter as tk
from tkinter import ttk
from tkinter import ttk
from tkinter import Tk, RIGHT, LEFT, SOLID, VERTICAL
from tkinter import Frame, Label, Button, messagebox, Scale




# classes ---------------------------------
# classes ---------------------------------
@@ -39,6 +41,7 @@ class Pupitre:
        # affichage de la radio en cours de lecture
        # affichage de la radio en cours de lecture
        lbl_radio = tk.Label(bandeau, text="RADIO")
        lbl_radio = tk.Label(bandeau, text="RADIO")
        lbl_radio.pack(padx=20, pady=10)
        lbl_radio.pack(padx=20, pady=10)

        # boutons de commande
        # boutons de commande
        btn_play = ttk.Button(menu, text="Play", command=self.radio_play)
        btn_play = ttk.Button(menu, text="Play", command=self.radio_play)
        btn_play.pack()
        btn_play.pack()
@@ -46,3 +49,8 @@ class Pupitre:
        btn_pause.pack()
        btn_pause.pack()
        btn_stop = ttk.Button(menu, text="Stop", command=self.radio_stop)
        btn_stop = ttk.Button(menu, text="Stop", command=self.radio_stop)
        btn_stop.pack()
        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)