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
1419c387
Commit
1419c387
authored
Feb 06, 2023
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 1.3
parent
146fda0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
sources.md
docs/sources.md
+10
-1
main.py
main.py
+0
-2
pupitre.py
pupitre.py
+11
-2
No files found.
docs/sources.md
View file @
1419c387
...
@@ -18,5 +18,14 @@
...
@@ -18,5 +18,14 @@
#### Problème de path
#### Problème de path
https://openclassrooms.com/forum/sujet/probleme-python-path-et-fichier
-
https://openclassrooms.com/forum/sujet/probleme-python-path-et-fichier
#### Info sur les radios :
class Meta de vlc
-
https://www.olivieraubert.net/vlc/python-ctypes/doc/vlc.Meta-class.html
Class Media
-
https://www.olivieraubert.net/vlc/python-ctypes/doc/vlc.Media-class.html
Code source :
-
https://www.olivieraubert.net/vlc/python-ctypes/doc/vlc-pysrc.html
\ No newline at end of file
main.py
View file @
1419c387
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
# import ----------------------------------
# import ----------------------------------
from
vlc
import
Instance
from
vlc
import
Instance
from
vlc
import
Media
,
MediaPlayer
,
Meta
''' installer le paquet python-vlc :
''' installer le paquet python-vlc :
$ sudo pip3 install python-vlc
$ sudo pip3 install python-vlc
installer aussi l'application VLC '''
installer aussi l'application VLC '''
...
...
pupitre.py
View file @
1419c387
...
@@ -119,7 +119,7 @@ class Pupitre:
...
@@ -119,7 +119,7 @@ class Pupitre:
# affiche les infos sur le titre en cours d'écoute
# affiche les infos sur le titre en cours d'écoute
self
.
lbl_radio_info
=
tk
.
Label
(
self
.
menu
,
background
=
bg_color_light
)
self
.
lbl_radio_info
=
tk
.
Label
(
self
.
menu
,
background
=
bg_color_light
)
self
.
lbl_radio_info
.
place
(
width
=
250
,
height
=
90
,
x
=
20
,
y
=
300
)
self
.
lbl_radio_info
.
place
(
width
=
250
,
height
=
80
,
x
=
20
,
y
=
305
)
self
.
lbl_radio_info
.
config
(
font
=
(
'Helvetica'
,
10
),
anchor
=
"n"
,
bg
=
bg_color
,
fg
=
"white"
,
wraplength
=
240
)
self
.
lbl_radio_info
.
config
(
font
=
(
'Helvetica'
,
10
),
anchor
=
"n"
,
bg
=
bg_color
,
fg
=
"white"
,
wraplength
=
240
)
# potentiomètre de volume
# potentiomètre de volume
...
@@ -235,10 +235,19 @@ class Pupitre:
...
@@ -235,10 +235,19 @@ class Pupitre:
if
self
.
radio_on
:
# si on a une radio en cours d'écoute
if
self
.
radio_on
:
# si on a une radio en cours d'écoute
flux_info
=
self
.
media
.
get_meta
(
Meta
.
NowPlaying
)
# on récupère l'info sur le titre actuel
flux_info
=
self
.
media
.
get_meta
(
Meta
.
NowPlaying
)
# on récupère l'info sur le titre actuel
if
flux_info
:
# si on a bien une information sur le titre
if
flux_info
:
# si on a bien une information sur le titre
longueur
=
len
(
flux_info
)
if
flux_info
[
0
:
4
]
==
". - "
:
# nettoyage boom 99.7
flux_info
=
flux_info
[
4
:
longueur
-
3
]
flux_info
=
flux_info
.
replace
(
"~"
,
" "
)
# nettoyage des tildes
flux_info
=
flux_info
.
replace
(
" - "
,
"
\n
"
)
# remplacer par des retours à la ligne
self
.
lbl_radio_info
.
config
(
text
=
flux_info
)
# afficher les infos sous le titre de la radio
self
.
lbl_radio_info
.
config
(
text
=
flux_info
)
# afficher les infos sous le titre de la radio
self
.
root
.
after
(
2000
,
self
.
radio_info
)
# relance la fonction 'now_playing_info' toutes les 2
s
self
.
root
.
after
(
1000
,
self
.
radio_info
)
# relance la fonction 'now_playing_info' toutes les 1
s
def
boucle
(
self
):
# boucle principale de tkinter
def
boucle
(
self
):
# boucle principale de tkinter
self
.
root
.
mainloop
()
self
.
root
.
mainloop
()
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