aboutsummaryrefslogtreecommitdiffstats
path: root/player_vlc.py
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2024-11-09 20:35:56 +0100
committerEddy Pedroni <epedroni@pm.me>2024-11-09 20:35:56 +0100
commitcda8197669409689be291660f93cb288ab2d31b3 (patch)
tree81db9b0c7c0491e0737cbffb39af6b935c0dfeb8 /player_vlc.py
parenta2257a900d4fffd6f94b73f1c48c62370ed1d684 (diff)
Migrate to project-based structure
Diffstat (limited to 'player_vlc.py')
-rw-r--r--player_vlc.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/player_vlc.py b/player_vlc.py
deleted file mode 100644
index 283102e..0000000
--- a/player_vlc.py
+++ /dev/null
@@ -1,55 +0,0 @@
-import vlc
-
-class Player:
- def __init__(self):
- self._player = vlc.MediaPlayer()
-
- def play(self):
- self._player.play()
-
- def stop(self):
- self._player.stop()
-
- def pause(self):
- self._player.pause()
-
- def isPlaying(self):
- playing = self._player.is_playing() == 1
- return playing
-
- def setPlaybackRate(self, rate):
- self._player.set_rate(rate)
-
- def getPlaybackRate(self):
- return self._player.get_rate()
-
- def setPlaybackPosition(self, position):
- self._player.set_position(position)
-
- def getPlaybackPosition(self):
- return self._player.get_position()
-
- def setPlaybackVolume(self, volume):
- self._player.audio_set_volume(int(volume * 100))
-
- def getPlaybackVolume(self):
- return self._player.audio_get_volume() / 100.0
-
- def setCurrentSong(self, path):
- self._player.stop()
- media = vlc.Media(path)
- self._player.set_media(media)
-
- def setPlayingStateChangedCallback(self, callback):
- events = [
- vlc.EventType.MediaPlayerStopped,
- vlc.EventType.MediaPlayerPlaying,
- vlc.EventType.MediaPlayerPaused
- ]
- manager = self._player.event_manager()
- for e in events:
- manager.event_attach(e, callback)
-
- def setPlaybackVolumeChangedCallback(self, callback):
- manager = self._player.event_manager()
- manager.event_attach(vlc.EventType.MediaPlayerAudioVolume, callback)