Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WebRadioPi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thorfin89
WebRadioPi
Commits
06cf3cb5
Commit
06cf3cb5
authored
Jan 08, 2023
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout d'un fichier de configuration : init
parent
0d97eb9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
16 deletions
+26
-16
README.md
README.md
+11
-0
init
init
+1
-0
main.py
main.py
+5
-5
rw_pupitre.py
rw_pupitre.py
+9
-11
No files found.
README.md
View file @
06cf3cb5
# WebRadioPi
# WebRadioPi
Lecteur de radios internet
Pour toute information : thorfin89@free.fr
### SOURCES :
#### Doc python-vlc :
-
https://www.olivieraubert.net/vlc/python-ctypes/doc/vlc.MediaPlayer-class.html
-
https://stackoverflow.com/questions/46758360/how-to-play-streaming-audio-from-internet-radio-on-python-3-5-3
#### Doc tkinter :
-
http://tkinter.fdex.eu/index.html
-
http://pascal.ortiz.free.fr/contents/tkinter/tkinter/
init
0 → 100644
View file @
06cf3cb5
72
\ No newline at end of file
main.py
View file @
06cf3cb5
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
# Fichier : main.py
# Fichier : main.py
# Auteur : Daniel SAZERAT (thorfin89@free.fr)
# Auteur : Daniel SAZERAT (thorfin89@free.fr)
# Doc python-vlc
# https://www.olivieraubert.net/vlc/python-ctypes/doc/vlc.MediaPlayer-class.html
# https://stackoverflow.com/questions/46758360/how-to-play-streaming-audio-from-internet-radio-on-python-3-5-3
# import ----------------------------------
# import ----------------------------------
from
rw_pupitre
import
Pupitre
from
rw_pupitre
import
Pupitre
...
@@ -29,10 +26,13 @@ class Radio(Pupitre):
...
@@ -29,10 +26,13 @@ class Radio(Pupitre):
def
radio_stop
(
self
):
def
radio_stop
(
self
):
self
.
player
.
stop
()
self
.
player
.
stop
()
def
volume
(
self
,
vol
):
def
volume
(
self
,
vol
_potar
):
# on récupère la valeur du potentiomètre de volume
# on récupère la valeur du potentiomètre de volume
vol_audio
=
int
(
vol
)
vol_audio
=
int
(
vol
_potar
)
self
.
player
.
audio_set_volume
(
vol_audio
)
self
.
player
.
audio_set_volume
(
vol_audio
)
sauvegarde
=
open
(
"init"
,
"w"
)
sauvegarde
.
write
(
vol_potar
)
sauvegarde
.
close
()
app
=
Radio
()
# instancie l'application
app
=
Radio
()
# instancie l'application
...
...
rw_pupitre.py
View file @
06cf3cb5
...
@@ -2,16 +2,12 @@
...
@@ -2,16 +2,12 @@
# Fichier : rw_pupitre.py
# Fichier : rw_pupitre.py
# Auteur : Daniel SAZERAT (thorfin89@free.fr)
# Auteur : Daniel SAZERAT (thorfin89@free.fr)
# Doc tkinter
# http://tkinter.fdex.eu/index.html
# http://pascal.ortiz.free.fr/contents/tkinter/tkinter/
# import ----------------------------------
# import ----------------------------------
import
os
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
VERTICAL
from
tkinter
import
Frame
,
Label
,
Button
,
messagebox
,
Scale
from
tkinter
import
Scale
,
StringVar
,
DoubleVar
# classes ---------------------------------
# classes ---------------------------------
...
@@ -50,7 +46,9 @@ class Pupitre:
...
@@ -50,7 +46,9 @@ class Pupitre:
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
# potentiomètre de volume
potar
=
Scale
(
menu
,
from_
=
100
,
to
=
0
,
orient
=
VERTICAL
,
length
=
200
,
command
=
self
.
volume
)
lecture
=
open
(
"init"
,
"r"
)
# on charge configuration sauvegardée
potar
.
pack
(
padx
=
10
,
pady
=
5
)
volume_init
=
lecture
.
read
()
vol_potar
=
Scale
(
menu
,
from_
=
100
,
to
=
0
,
orient
=
VERTICAL
,
length
=
200
,
command
=
self
.
volume
)
vol_potar
.
set
(
volume_init
)
vol_potar
.
pack
(
padx
=
10
,
pady
=
5
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment