Updated player

This commit is contained in:
Manuel Cortez 2019-05-06 12:09:53 -05:00
parent c3ab0406e4
commit f81d302c9a

View File

@ -625,13 +625,17 @@ class audioBuffer(feedBuffer):
self.tab.post.Enable(True) self.tab.post.Enable(True)
def get_event(self, ev): def get_event(self, ev):
if ev.GetKeyCode() == wx.WXK_RETURN: event = "play_audio" if ev.GetKeyCode() == wx.WXK_RETURN:
if len(self.tab.list.get_multiple_selection()) < 2:
event = "play_all"
else:
event = "play_audio"
else: else:
event = None event = None
ev.Skip() ev.Skip()
if event != None: if event != None:
try: try:
getattr(self, event)() getattr(self, event)(skip_pause=True)
except AttributeError: except AttributeError:
pass pass
@ -642,7 +646,7 @@ class audioBuffer(feedBuffer):
super(audioBuffer, self).connect_events() super(audioBuffer, self).connect_events()
def play_audio(self, *args, **kwargs): def play_audio(self, *args, **kwargs):
if player.player.check_is_playing(): if player.player.check_is_playing() and not "skip_pause" in kwargs:
return pub.sendMessage("pause") return pub.sendMessage("pause")
selected = self.tab.list.get_multiple_selection() selected = self.tab.list.get_multiple_selection()
if len(selected) == 0: if len(selected) == 0: