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
8e9a2c37
Commit
8e9a2c37
authored
Jan 08, 2023
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout des commandes Pause et Stop
parent
0bbbd265
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
main.py
main.py
+8
-9
rw_pupitre.py
rw_pupitre.py
+1
-1
No files found.
main.py
View file @
8e9a2c37
...
@@ -9,26 +9,25 @@
...
@@ -9,26 +9,25 @@
# import ----------------------------------
# import ----------------------------------
from
rw_pupitre
import
Pupitre
from
rw_pupitre
import
Pupitre
import
vlc
# sudo pip3 install python-vlc
import
vlc
# sudo pip3 install python-vlc
import
time
# 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
=
vlc
.
Instance
()
self
.
player
=
self
.
instance
.
media_player_new
()
media
=
self
.
instance
.
media_new
(
"http://live.leanstream.co/CJOTFM-MP3"
)
self
.
player
.
set_media
(
media
)
def
radio_play
(
self
):
def
radio_play
(
self
):
player
=
self
.
instance
.
media_player_new
()
self
.
player
.
play
()
media
=
self
.
instance
.
media_new
(
"http://live.leanstream.co/CJOTFM-MP3"
)
player
.
set_media
(
media
)
player
.
play
()
time
.
sleep
(
10
)
player
.
stop
()
def
radio_pause
(
self
):
self
.
player
.
pause
()
def
radio_stop
(
self
):
def
radio_stop
(
self
):
pass
self
.
player
.
stop
()
app
=
Radio
()
# instancie l'application
app
=
Radio
()
# instancie l'application
...
...
rw_pupitre.py
View file @
8e9a2c37
...
@@ -42,7 +42,7 @@ class Pupitre:
...
@@ -42,7 +42,7 @@ class Pupitre:
# 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
()
btn_pause
=
ttk
.
Button
(
menu
,
text
=
"Pause"
,
command
=
Non
e
)
btn_pause
=
ttk
.
Button
(
menu
,
text
=
"Pause"
,
command
=
self
.
radio_paus
e
)
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
()
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