Commit 56417da9 authored by Thorfin89's avatar Thorfin89

Etude sur l'affichage des info de la radio

parent 48cd4c31
...@@ -13,6 +13,9 @@ Pour toute information : thorfin89@free.fr ...@@ -13,6 +13,9 @@ Pour toute information : thorfin89@free.fr
- https://www.youtube.com/watch?v=DMpq0Cot8YU - https://www.youtube.com/watch?v=DMpq0Cot8YU
- https://www.youtube.com/watch?v=n1ucrkly2nc - https://www.youtube.com/watch?v=n1ucrkly2nc
#### Afficher les informations sur la radio
https://github.com/oaubert/python-vlc/issues/72
#### Doc tkinter : #### Doc tkinter :
- http://tkinter.fdex.eu/index.html - http://tkinter.fdex.eu/index.html
- http://pascal.ortiz.free.fr/contents/tkinter/tkinter/ - http://pascal.ortiz.free.fr/contents/tkinter/tkinter/
...@@ -2,17 +2,19 @@ ...@@ -2,17 +2,19 @@
# Fichier : main.py # Fichier : main.py
# Auteur : Daniel SAZERAT (thorfin89@free.fr) # Auteur : Daniel SAZERAT (thorfin89@free.fr)
# import vlc > sudo pip3 install python-vlc
# import ---------------------------------- # import ----------------------------------
from rw_pupitre import Pupitre from rw_pupitre import Pupitre
import vlc # sudo pip3 install python-vlc
from vlc import Instance
# classes --------------------------------- # classes ---------------------------------
class Radio(Pupitre): class Radio(Pupitre):
def __init__(self): def __init__(self):
super().__init__() # constructeur de la classe parente super().__init__() # constructeur de la classe parente
self.instance = vlc.Instance() self.instance = Instance()
self.player = self.instance.media_player_new() self.player = self.instance.media_player_new()
media = self.instance.media_new("http://live.leanstream.co/CJOTFM-MP3") media = self.instance.media_new("http://live.leanstream.co/CJOTFM-MP3")
self.player.set_media(media) self.player.set_media(media)
...@@ -31,10 +33,10 @@ class Radio(Pupitre): ...@@ -31,10 +33,10 @@ class Radio(Pupitre):
vol_audio = int(vol_potar) vol_audio = int(vol_potar)
self.player.audio_set_volume(vol_audio) self.player.audio_set_volume(vol_audio)
sauvegarde = open("webradiopi.cfg", "w") sauvegarde = open("webradiopi.cfg", "w")
sauvegarde.write(vol_potar) # le niveau du volume est enregistré sauvegarde.write(vol_potar) # le niveau du volume est enregistré
sauvegarde.close() sauvegarde.close()
def radio_mute(self): # coupure du son def radio_mute(self): # coupure du son
self.player.audio_set_volume(0) self.player.audio_set_volume(0)
def radio_sound(self): # rétablissement du son def radio_sound(self): # rétablissement du son
......
68 43
\ No newline at end of file \ No newline at end of file
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