forked from Wobbl/Wobuzz
Added command_line.py to control the player via command line.
This commit is contained in:
parent
94269fdae4
commit
10c36b37a1
5 changed files with 32 additions and 16 deletions
|
@ -27,17 +27,6 @@ class Player:
|
|||
self.current_sound = None
|
||||
self.current_sound_duration = 0
|
||||
|
||||
def load_tracks_from_paths(self, track_paths: list[str]):
|
||||
"""
|
||||
Load tracks from list of paths.
|
||||
"""
|
||||
|
||||
self.current_playlist = Playlist(self.app)
|
||||
self.current_playlist.load_from_paths(track_paths)
|
||||
|
||||
self.current_sound = self.current_playlist.current_track.sound
|
||||
self.current_sound_duration = self.current_playlist.current_track.duration
|
||||
|
||||
def play(self):
|
||||
self.music_channel.play(self.current_sound)
|
||||
|
||||
|
@ -61,6 +50,7 @@ class Player:
|
|||
|
||||
self.play()
|
||||
self.track_progress.start()
|
||||
self.app.gui_communication.on_track_start()
|
||||
|
||||
def pause(self):
|
||||
self.music_channel.pause()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue