Esempio n. 1
0
 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')
Esempio n. 2
0
 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')
Esempio n. 3
0
 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')
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 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")
Esempio n. 9
0
 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")
Esempio n. 10
0
 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')
Esempio n. 11
0
 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')
Esempio n. 12
0
 def load(self, track):
     if track.id == Type.RADIOS:
         RadioPlayer.load(self, track)
     else:
         BinPlayer.load(self, track)