diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2021-12-29 10:44:01 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2021-12-29 10:44:01 +0100 |
commit | 4474abcfbaf0bbc39de68dae2f8572e271b775bc (patch) | |
tree | cc311c573c75e5d69439f19f11aa1320f264d26d /player_vlc.py | |
parent | e44d87a86bd57664e14991257a1a70f1d4f5ba0b (diff) |
Refactored players, moved player mock to separate file
Diffstat (limited to 'player_vlc.py')
-rw-r--r-- | player_vlc.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/player_vlc.py b/player_vlc.py index 9c8362a..1418dd0 100644 --- a/player_vlc.py +++ b/player_vlc.py @@ -2,35 +2,35 @@ import vlc class Player: def __init__(self): - self.player = vlc.MediaPlayer() + self._player = vlc.MediaPlayer() def play(self): - self.player.play() + self._player.play() def stop(self): - self.player.stop() + self._player.stop() def pause(self): - self.player.pause() + self._player.pause() def setPlaybackRate(self, rate): - self.player.set_rate(rate) + self._player.set_rate(rate) def getPlaybackRate(self): - return self.player.get_rate() + return self._player.get_rate() def setPlaybackPosition(self, position): - self.player.set_position(position) + self._player.set_position(position) def getPlaybackPosition(self): - return self.player.get_position() + return self._player.get_position() def setPlaybackVolume(self, volume): - self.player.audio_set_volume(int(volume * 100)) + self._player.audio_set_volume(int(volume * 100)) def getPlaybackVolume(self): - return self.player.audio_get_volume() / 100.0 + return self._player.audio_get_volume() / 100.0 def setCurrentSong(self, path): media = vlc.Media(path) - self.player.set_media(media) + self._player.set_media(media) |