New keystroke: ctrl+shift+return for stopping audio playback
This commit is contained in:
parent
4acf363f3e
commit
64c8b7c3dc
@ -59,6 +59,7 @@ class baseBuffer(object):
|
||||
widgetUtils.connect_event(self.tab.list.list, widgetUtils.KEYPRESS, self.get_event)
|
||||
|
||||
def get_event(self, ev):
|
||||
if ev.GetKeyCode() == wx.WXK_RETURN and ev.ControlDown() and ev.ShiftDown(): event = "pause_audio"
|
||||
if ev.GetKeyCode() == wx.WXK_RETURN and ev.ControlDown(): event = "play_audio"
|
||||
elif ev.GetKeyCode() == wx.WXK_RETURN: event = "open_post"
|
||||
elif ev.GetKeyCode() == wx.WXK_F5: event = "volume_down"
|
||||
@ -93,6 +94,9 @@ class baseBuffer(object):
|
||||
else:
|
||||
pub.sendMessage("open-post", post_object=post, controller_="postController")
|
||||
|
||||
def pause_audio(self, *args, **kwargs):
|
||||
player.player.pause()
|
||||
|
||||
class feedBuffer(baseBuffer):
|
||||
|
||||
def get_items(self, no_next=True):
|
||||
|
@ -35,8 +35,11 @@ class audioPlayer(object):
|
||||
self.stream.stop()
|
||||
|
||||
def pause(self):
|
||||
if self.stream != None and self.stream.is_playing == True:
|
||||
if self.stream != None:
|
||||
if self.stream.is_playing == True:
|
||||
self.stream.pause()
|
||||
else:
|
||||
self.stream.play()
|
||||
|
||||
@property
|
||||
def volume(self):
|
||||
|
Loading…
Reference in New Issue
Block a user