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
3a7b9032
Commit
3a7b9032
authored
Jan 29, 2023
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incrémentation pages ok - pb sur radio suivante ou précédente
parent
42f33525
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
53 deletions
+47
-53
radios.csv
data/radios.csv
+30
-39
pupitre.py
pupitre.py
+17
-14
No files found.
data/radios.csv
View file @
3a7b9032
...
...
@@ -19,42 +19,33 @@ Highlander Radio,DE,Celtic,https://jenny.torontocast.com:2000/stream/highlanderr
Virgin Rock 70,DE,Rock,http://icy.unitedradio.it/VirginRock70.mp3,virginrock70.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Celtic Folk Punk,DE,Celtic-Folk-Punk,https://streamingp.shoutcast.com/JamendoLounge,celtik-folk-punk.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
\ No newline at end of file
Radio21,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio22,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio23,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio24,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio25,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio26,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio27,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio28,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio29,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio30,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio31,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio32,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio33,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio34,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio35,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio36,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio37,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio38,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio39,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio40,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio41,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio42,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
Radio43,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio44,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio45,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio46,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio47,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio48,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio49,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
Radio50,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,
\ No newline at end of file
pupitre.py
View file @
3a7b9032
...
...
@@ -26,7 +26,7 @@ class Pupitre:
def
__init__
(
self
):
# calcul du nombre de radios contenues dans le fichier CSV
self
.
nb_radios
=
len
(
radios_list
)
self
.
nb_pages
=
self
.
nb_radios
//
20
# partie entière de la division + 1
self
.
nb_pages
=
self
.
nb_radios
//
20
# partie entière de la division + 1
self
.
current_page
=
0
# déclaration de la fenêtre principale
...
...
@@ -73,8 +73,6 @@ class Pupitre:
# affiche du logo de la radio sélectionnée >>> placer ici l'icone de la radio en 200x200
self
.
lbl_radio_selected
=
ttk
.
Label
(
self
.
menu
)
# self.lbl_radio_selected.config(bg="lightgray", fg="black")
self
.
lbl_radio_selected
.
place
(
width
=
225
,
height
=
225
,
x
=
38
,
y
=
38
)
# Position d'origine de la barre de boutons
...
...
@@ -127,27 +125,30 @@ class Pupitre:
for
y_logo
in
range
(
4
):
# 4 lignes
for
x_logo
in
range
(
5
):
# 5 colonnes
num_radio
=
y_logo
*
5
+
x_logo
# indexation du numéro de radio
num_case
=
y_logo
*
5
+
x_logo
# indexation des cases de la mosaique de 0 à 19
num_radio
=
(
20
*
self
.
current_page
)
+
num_case
# indexation du numéro de radio
if
num_radio
<
self
.
nb_radios
:
# si on a bien une radio
try
:
if
radios_list
[
num_radio
][
'Logo'
]
!=
""
:
# si un logo est associé à la radio
if
radios_list
[
num_radio
][
'Logo'
]
!=
""
:
# si un logo est associé à ce flux
img
=
Image
.
open
(
"./images/"
+
radios_list
[
num_radio
][
'Logo'
])
else
:
# s'il n'y a pas de logo pour la radio
img
=
Image
.
open
(
"./images/radio.png"
)
# on redimensionne le logo
img
=
img
.
resize
((
logo_size
,
logo_size
),
Image
.
ANTIALIAS
)
self
.
logo
[
num_
radio
]
=
ImageTk
.
PhotoImage
(
img
)
self
.
logo
[
num_
case
]
=
ImageTk
.
PhotoImage
(
img
)
# création du bouton avec le logo de la radio
btn_logo
=
tk
.
Button
(
self
.
zone_mosaique
,
image
=
self
.
logo
[
num_
radio
])
btn_logo
=
tk
.
Button
(
self
.
zone_mosaique
,
image
=
self
.
logo
[
num_
case
])
# utilisation d'une fonction 'lambda' indexée sur la position du logo
btn_logo
.
config
(
command
=
lambda
flux
=
radios_list
[
num_radio
][
'Url'
],
num_radio
=
num_radio
:
self
.
radio_selected
(
num_radio
))
btn_logo
.
config
(
command
=
lambda
flux
=
radios_list
[
num_radio
][
'Url'
],
num_radio
=
num_radio
:
self
.
radio_selected
(
num_radio
))
btn_logo
.
place
(
width
=
100
,
height
=
100
,
x
=
x_logo
*
100
,
y
=
y_logo
*
100
)
e
xcept
:
# quand le nombre de radios est < 20 on ne crée pas de bouton
e
lse
:
pass
def
radio_stop
(
self
):
...
...
@@ -209,13 +210,15 @@ class Pupitre:
self
.
current_page
-=
1
if
self
.
current_page
<
0
:
self
.
current_page
=
self
.
nb_pages
print
(
self
.
current_page
)
self
.
mosaique
()
def
page_forward
(
self
):
self
.
current_page
+=
1
if
self
.
current_page
>
self
.
nb_pages
:
self
.
current_page
=
0
print
(
self
.
current_page
)
self
.
mosaique
()
def
boucle
(
self
):
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