Started pubsub implementation in all player related functions

This commit is contained in:
2019-04-10 17:49:23 -05:00
parent 6d6daa60b6
commit 9cb1f9647c
2 changed files with 8 additions and 2 deletions

View File

@@ -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.