From 1d7b2c5712072a96cbe60510da5e1aaf0d5d3cdb Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Sat, 16 May 2015 14:25:38 -0400 Subject: [PATCH] Closed #39. --- src/controller/buffersController.py | 11 ++++++++++- src/controller/mainController.py | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index 8f4e570a..72b8d039 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -418,6 +418,8 @@ class baseBufferController(bufferController): self.session.db[str(self.name+"_pos")]=self.buffer.list.get_selected() @_tweets_exist def audio(self,url=''): + if hasattr(sound.URLPlayer,'stream'): + return sound.URLPlayer.stop_audio(delete=True) tweet = self.get_tweet() if tweet == None: return urls = utils.find_urls(tweet) @@ -437,11 +439,13 @@ class baseBufferController(bufferController): @_tweets_exist def interact(self): "Select the best action for the currently focused tweet (audio, geocode, URL, etc)." - if hasattr(sound.URLPlayer,'stream'): + if hasattr(sound.URLPlayer,'stream') and config.app['app-settings']['use_Codeofdusk_audio_handlers']: return sound.URLPlayer.stop_audio(delete=True) tweet = self.get_tweet() url=None urls = utils.find_urls(tweet) + if len(urls) > 0 and config.app['app-settings']['use_Codeofdusk_audio_handlers']==False: + return self.url() if len(urls) == 1: url=urls[0] elif len(urls) > 1: @@ -460,6 +464,11 @@ class baseBufferController(bufferController): output.speak("Not actionable.",True) self.session.sound.play("error.ogg") + def secondary_interact(self): + if config.app['app-settings']['use_Codeofdusk_audio_handlers']: + return self.url() + else: + return self.audio() def url(self,url='',announce=True): if url == '': tweet = self.get_tweet() diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 060004ee..483cff0d 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -1018,6 +1018,10 @@ class Controller(object): buffer = self.get_current_buffer() buffer.url() + def secondary_interact(self, *args, **kwargs): + buffer = self.get_current_buffer() + buffer.secondary_interact() + def audio(self, *args, **kwargs): self.get_current_buffer().audio()