This commit is contained in:
Bill Dengler 2015-05-16 14:25:38 -04:00
parent ebe3ab2c14
commit 1d7b2c5712
2 changed files with 14 additions and 1 deletions

View File

@ -418,6 +418,8 @@ class baseBufferController(bufferController):
self.session.db[str(self.name+"_pos")]=self.buffer.list.get_selected() self.session.db[str(self.name+"_pos")]=self.buffer.list.get_selected()
@_tweets_exist @_tweets_exist
def audio(self,url=''): def audio(self,url=''):
if hasattr(sound.URLPlayer,'stream'):
return sound.URLPlayer.stop_audio(delete=True)
tweet = self.get_tweet() tweet = self.get_tweet()
if tweet == None: return if tweet == None: return
urls = utils.find_urls(tweet) urls = utils.find_urls(tweet)
@ -437,11 +439,13 @@ class baseBufferController(bufferController):
@_tweets_exist @_tweets_exist
def interact(self): def interact(self):
"Select the best action for the currently focused tweet (audio, geocode, URL, etc)." "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) return sound.URLPlayer.stop_audio(delete=True)
tweet = self.get_tweet() tweet = self.get_tweet()
url=None url=None
urls = utils.find_urls(tweet) 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: if len(urls) == 1:
url=urls[0] url=urls[0]
elif len(urls) > 1: elif len(urls) > 1:
@ -460,6 +464,11 @@ class baseBufferController(bufferController):
output.speak("Not actionable.",True) output.speak("Not actionable.",True)
self.session.sound.play("error.ogg") 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): def url(self,url='',announce=True):
if url == '': if url == '':
tweet = self.get_tweet() tweet = self.get_tweet()

View File

@ -1018,6 +1018,10 @@ class Controller(object):
buffer = self.get_current_buffer() buffer = self.get_current_buffer()
buffer.url() buffer.url()
def secondary_interact(self, *args, **kwargs):
buffer = self.get_current_buffer()
buffer.secondary_interact()
def audio(self, *args, **kwargs): def audio(self, *args, **kwargs):
self.get_current_buffer().audio() self.get_current_buffer().audio()