cplay-ng

simple curses audio player
git clone https://git.ce9e.org/cplay-ng.git

commit
664cdd102d9fdd9611ed1c71dcb5ee22d2b6536c
parent
d5c5634972c9c4d12b08d6ea8f8c5656805669d4
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-09-05 14:52
add Player.is_playing()

Diffstat

M cplay.py 7 +++++--

1 files changed, 5 insertions, 2 deletions


diff --git a/cplay.py b/cplay.py

@@ -192,9 +192,12 @@ class Player:
  192   192         if self._seek_timeout and time.time() >= self._seek_timeout:
  193   193             self._seek_timeout = None
  194   194             self._seek_step = 0
  195    -1             if self._proc:
   -1   195             if self.is_playing():
  196   196                 self._play()
  197   197 
   -1   198     def is_playing(self):
   -1   199         return self._proc is not None
   -1   200 
  198   201     def is_finished(self):
  199   202         return self._proc is not None and self._proc.poll() is not None
  200   203 
@@ -623,7 +626,7 @@ class Application:
  623   626 
  624   627         if self.input.active:
  625   628             status = self.input.prompt + self.input.str
  626    -1         elif player.path and player._proc:
   -1   629         elif player.is_playing():
  627   630             status = 'Playing %s' % os.path.relpath(player.path)
  628   631         else:
  629   632             status = ''