diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index d9212ac0..e85a794c 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -47,7 +47,7 @@ class bufferController(object): def get_event(self, ev): - if ev.GetKeyCode() == wx.WXK_RETURN and ev.ControlDown(): event = "interact" + if ev.GetKeyCode() == wx.WXK_RETURN and ev.ControlDown(): event = "audio" elif ev.GetKeyCode() == wx.WXK_RETURN: event = "url" elif ev.GetKeyCode() == wx.WXK_F5: event = "volume_down" elif ev.GetKeyCode() == wx.WXK_F6: event = "volume_up" @@ -82,26 +82,6 @@ class bufferController(object): sound.URLPlayer.stream.volume = self.session.settings["sound"]["volume"] self.session.sound.play("volume_changed.ogg") - def interact(self): - tweet = self.get_tweet() - url=None - urls = utils.find_urls(tweet) - if len(urls) == 1: - url=urls[0] - elif len(urls) > 1: - urls_list = dialogs.urlList.urlList() - urls_list.populate_list(urls) - if urls_list.get_response() == widgetUtils.OK: - url=urls_list.get_string() - if hasattr(urls_list, "destroy"): urls_list.destroy() - if url != None: - output.speak(_(u"Opening media..."), True) - if sound.URLPlayer.is_playable(url=url, play=True, volume=self.session.settings["sound"]["volume"]) == False: - return webbrowser.open_new_tab(url) -# else: -# output.speak(_(u"Not actionable."), True) -# self.session.sound.play("error.ogg") - def start_stream(self): pass diff --git a/src/controller/mainController.py b/src/controller/mainController.py index ced9a261..66bc9de8 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -1023,11 +1023,6 @@ class Controller(object): except: pass - def interact(self): - "Select the best action for the currently focused tweet (audio, geocode, URL, etc)." - buffer = self.get_current_buffer() - buffer.interact() - def url(self, *args, **kwargs): buffer = self.get_current_buffer() buffer.url() diff --git a/src/keymaps/Chicken_Nugget.keymap b/src/keymaps/Chicken_Nugget.keymap index 4d10524a..de7044a6 100644 --- a/src/keymaps/Chicken_Nugget.keymap +++ b/src/keymaps/Chicken_Nugget.keymap @@ -18,7 +18,7 @@ user_details = control+win+shift+u exit = control+win+q open_timeline = control+win+u remove_buffer = control+win+backspace -interact = control+win+return +audio = control+win+return secondary_interact = control+win+b go_home = control+win+home go_end = control+win+end diff --git a/src/keymaps/Qwitter.keymap b/src/keymaps/Qwitter.keymap index 8825f262..4c2c1d61 100644 --- a/src/keymaps/Qwitter.keymap +++ b/src/keymaps/Qwitter.keymap @@ -23,7 +23,7 @@ view_item = control+win+v exit = control+win+f4 open_timeline = control+win+i remove_buffer = "control+win+'" -interact = control+win+return +audio = control+win+return volume_up = control+win+alt+up volume_down = control+win+alt+down go_home = control+win+home diff --git a/src/keymaps/Win10.keymap b/src/keymaps/Win10.keymap index 50c16665..0df08ee3 100644 --- a/src/keymaps/Win10.keymap +++ b/src/keymaps/Win10.keymap @@ -24,7 +24,7 @@ view_item = alt+win+v exit = alt+win+f4 open_timeline = alt+win+i remove_buffer = alt+win+shift+i -interact = alt+win+return +audio = alt+win+return secondary_interact = alt+shift+win+return volume_up = alt+win+shift+up diff --git a/src/keymaps/base.template b/src/keymaps/base.template index ff612fde..706929cf 100644 --- a/src/keymaps/base.template +++ b/src/keymaps/base.template @@ -24,7 +24,7 @@ view_item = string(default="control+win+v") exit = string(default="control+win+f4") open_timeline = string(default="control+win+i") remove_buffer = string(default="control+win+shift+i") -interact = string(default="control+win+return") +audio = string(default="control+win+return") secondary_interact = string(default="control+win+alt+return") volume_up = string(default="control+win+alt+up") volume_down = string(default="control+win+alt+down") diff --git a/src/keymaps/default.keymap b/src/keymaps/default.keymap index b129f98c..fe3d54d0 100644 --- a/src/keymaps/default.keymap +++ b/src/keymaps/default.keymap @@ -24,7 +24,7 @@ view_item = control+win+v exit = control+win+f4 open_timeline = control+win+i remove_buffer = control+win+shift+i -interact = control+alt+win+return +audio = control+alt+win+return url = control+win+return volume_up = control+win+alt+up volume_down = control+win+alt+down @@ -51,3 +51,4 @@ view_reverse_geocode = control+win+shift+g get_trending_topics = control+win+t find = control+win+{ secondary_interact = control+win+alt+return +interact = control+win+return diff --git a/src/sound.py b/src/sound.py index 95fcdfd0..fc41ef8c 100644 --- a/src/sound.py +++ b/src/sound.py @@ -116,23 +116,20 @@ class URLStream(object): self.prepared = True def play(self, url=None, volume=1.0, stream=None,announce=True): - if self.stop_audio(delete=True): - return - else: - if announce: - output.speak(_(u"Playing...")) - log.debug("Attempting to play an URL...") - if url != None: - self.prepare(url) - elif stream != None: - self.stream=stream - if self.prepared == True: - self.stream = sound_lib.stream.URLStream(url=self.url) - if hasattr(self,'stream'): - self.stream.volume = float(volume) - self.stream.play() - log.debug("played") - call_threaded(self.delete_when_done) + if announce: + output.speak(_(u"Playing...")) + log.debug("Attempting to play an URL...") + if url != None: + self.prepare(url) + elif stream != None: + self.stream=stream + if self.prepared == True: + self.stream = sound_lib.stream.URLStream(url=self.url) + if hasattr(self,'stream'): + self.stream.volume = float(volume) + self.stream.play() + log.debug("played") + call_threaded(self.delete_when_done) def is_playable(self, url,play=False,volume=1.0): try: @@ -159,12 +156,13 @@ class URLStream(object): log.debug("Stopped audio stream.") except: log.exception("Exception while stopping stream.") - if delete: - del self.stream +# if delete: +# del self.stream log.debug("Deleted audio stream.") return True else: return False + @staticmethod def delete_old_tempfiles(): for f in glob(os.path.join(tempfile.gettempdir(), 'tmp*.wav')):