Don't allow cart click while that cart is playing.
This commit is contained in:
parent
9ccff3db20
commit
2f13099bda
@ -188,7 +188,10 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
"""Handle cart click"""
|
"""Handle cart click"""
|
||||||
|
|
||||||
btn = self.sender()
|
btn = self.sender()
|
||||||
|
|
||||||
if helpers.file_is_readable(btn.path):
|
if helpers.file_is_readable(btn.path):
|
||||||
|
# Don't allow clicks while we're playing
|
||||||
|
btn.setEnabled(False)
|
||||||
btn.player.play()
|
btn.player.play()
|
||||||
btn.is_playing = True
|
btn.is_playing = True
|
||||||
colour = Config.COLOUR_CART_PLAYING
|
colour = Config.COLOUR_CART_PLAYING
|
||||||
@ -272,6 +275,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
if not btn.player.is_playing():
|
if not btn.player.is_playing():
|
||||||
# Cart has finished playing
|
# Cart has finished playing
|
||||||
btn.is_playing = False
|
btn.is_playing = False
|
||||||
|
btn.setEnabled(True)
|
||||||
# Setting to position 0 doesn't seem to work
|
# Setting to position 0 doesn't seem to work
|
||||||
btn.player = self.music.VLC.media_player_new(btn.path)
|
btn.player = self.music.VLC.media_player_new(btn.path)
|
||||||
btn.player.audio_set_volume(Config.VOLUME_VLC_DEFAULT)
|
btn.player.audio_set_volume(Config.VOLUME_VLC_DEFAULT)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user