Skip to content

Commit

Permalink
develop #comment rename continue to autoplay
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc Sinet committed Jan 11, 2019
1 parent 7e1114a commit 000417f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions RaspberryCast/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, default_volume):
self._volume = default_volume

self._player = None
self._continue = True
self._autoplay = True
self._playerMutex = threading.RLock()

self._cv = threading.Condition()
Expand All @@ -45,10 +45,8 @@ def __del__(self):

def play(self, video=None):
with self._cv:
self._continue = True
self._autoplay = True
if video is not None:
# Cancel next() done in at_exit()
self._history.prev()
self._history.stop_browsing()
self.queue(video, first=True)
return
Expand All @@ -67,7 +65,7 @@ def queue(self, video, first=False):
break
self._queue.insert(index, video)
logger.debug("[player] queue contains: {}".format(self._queue))
if self._continue:
if self._autoplay:
self._cv.notify()

def list_queue(self):
Expand All @@ -80,7 +78,7 @@ def stop(self):
return

logger.info("[player] stopping ...")
self._continue = False
self._autoplay = False
self._exec_command('stop')

def is_stopped():
Expand Down Expand Up @@ -226,7 +224,7 @@ def _on_exit(self, player, code):
self._reset_player()

with self._cv:
if not self._continue:
if not self._autoplay:
return
self._cv.notify()

Expand Down

0 comments on commit 000417f

Please sign in to comment.