def load(self, track, play=True): """ Stop current track, load track id and play it @param track as Track @param play as bool, ignored for radios """ if track.id == Type.RADIOS: if not Lp().scanner.is_locked(): Lp().window.pulse(False) Lp().window.pulse(True) RadioPlayer.load(self, track) else: if play: if track.is_web and\ not Gio.NetworkMonitor.get_default( ).get_network_available(): self._current_track = track self.set_next() GLib.idle_add(self.next) return # Do not update next if user clicked on a track if self.is_party and track != self._next_track: self.__do_not_update_next = True BinPlayer.load(self, track) else: BinPlayer._load_track(self, track) self.emit('current-changed')
def load(self, track, play=True): """ Stop current track, load track id and play it @param track as Track @param play as bool, ignored for radios """ if track.id == Type.RADIOS: if not Lp().scanner.is_locked(): Lp().window.pulse(False) Lp().window.pulse(True) RadioPlayer.load(self, track) else: if play: if track.is_youtube and\ not Gio.NetworkMonitor.get_default( ).get_network_available(): Lp().notify.send( _("No network available," " can't play this track"), track.uri) # Force widgets to update (spinners) self.emit('current-changed') return # Do not update next if user clicked on a track if self.is_party and track != self._next_track: self.__do_not_update_next = True BinPlayer.load(self, track) else: BinPlayer._load_track(self, track) self.emit('current-changed')
def load(self, track): """ Stop current track, load track id and play it @param track as Track """ if track.id == Type.RADIOS: RadioPlayer.load(self, track) else: BinPlayer.load(self, track)
def load(self, track, notify=True): """ Stop current track, load track id and play it @param track as Track @param notify as bool """ if track.id == Type.RADIOS: if not Lp().scanner.is_locked(): Lp().window.pulse(False) Lp().window.pulse(True) RadioPlayer.load(self, track) else: BinPlayer.load(self, track, notify)
def load(self, track, play=True): """ Stop current track, load track id and play it @param track as Track @param play as bool, ignored for radios """ if track.id == Type.RADIOS: RadioPlayer.load(self, track, play) else: if play: BinPlayer.load(self, track) else: BinPlayer._load_track(self, track) self.emit("current-changed")
def load(self, track, play=True): """ Stop current track, load track id and play it @param track as Track @param play as bool, ignored for radios """ if track.id == Type.RADIOS: RadioPlayer.load(self, track) else: if play: # Do not update next if user clicked on a track if self.is_party and track != self._next_track: self.__do_not_update_next = True BinPlayer.load(self, track) else: BinPlayer._load_track(self, track) self.emit("current-changed")
def load(self, track, play=True): """ Stop current track, load track id and play it @param track as Track @param play as bool, ignored for radios """ if track.id == Type.RADIOS: if not Lp().scanner.is_locked(): Lp().window.pulse(False) Lp().window.pulse(True) RadioPlayer.load(self, track) else: if play: BinPlayer.load(self, track) else: BinPlayer._load_track(self, track) self.emit('current-changed')
def load(self, track): if track.id == Type.RADIOS: RadioPlayer.load(self, track) else: BinPlayer.load(self, track)