Started pubsub implementation in all player related functions
This commit is contained in:
parent
6d6daa60b6
commit
9cb1f9647c
@ -340,13 +340,13 @@ class Controller(object):
|
||||
if "url" in audio_object and audio_object["url"] =="":
|
||||
self.notify(message=_("This file could not be played because it is not allowed in your country"))
|
||||
return
|
||||
call_threaded(player.player.play, audio_object, fresh=True)
|
||||
pub.sendMessage("play", object=audio_object, fresh=True)
|
||||
|
||||
def play_audios(self, audios):
|
||||
""" Play all audios passed in alist, putting the audio in a queue of the media player.
|
||||
@audios list: A list of Vk audio objects.
|
||||
"""
|
||||
player.player.play_all(audios, shuffle=self.window.player_shuffle.IsChecked())
|
||||
pub.sendMessage("play_all", list_of_songs=audios, shuffle=self.window.player_shuffle.IsChecked())
|
||||
|
||||
def view_post(self, post_object, controller_):
|
||||
""" Display the passed post in the passed post presenter.
|
||||
|
@ -45,6 +45,12 @@ class audioPlayer(object):
|
||||
bassconfig = BassConfig()
|
||||
# Set timeout connection to 30 seconds.
|
||||
bassconfig["net_timeout"] = 30000
|
||||
pub.subscribe(self.play, "play")
|
||||
pub.subscribe(self.play_all, "play_all")
|
||||
pub.subscribe(self.pause, "pause")
|
||||
pub.subscribe(self.stop, "stop")
|
||||
pub.subscribe(self.play_next, "play_next")
|
||||
pub.subscribe(self.play_previous, "play_previous")
|
||||
|
||||
def play(self, object, set_info=True, fresh=False):
|
||||
""" Play an URl Stream.
|
||||
|
Loading…
Reference in New Issue
Block a user