Exemplo 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')
Exemplo n.º 2
0
 def __init__(self):
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     TagReader.__init__(self)
Exemplo 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_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')
Exemplo n.º 4
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')
Exemplo n.º 5
0
 def __init__(self):
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
Exemplo n.º 6
0
 def _on_bus_error(self, bus, message):
     """
         Pass error to Bin/Radio
         @param bus as Gst.Bus
         @param message as Gst.Message
     """
     BinPlayer._on_bus_error(self, bus, message)
     RadioPlayer._on_bus_error(self, bus, message)
Exemplo n.º 7
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)
Exemplo n.º 8
0
 def load(self, track):
     """
         Stop current track, load track id and play it
         @param track as Track
     """
     if TransitionsPlayer.load(self, track):
         pass
     else:
         BinPlayer.load(self, track)
Exemplo n.º 9
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)
Exemplo n.º 10
0
 def __init__(self):
     """
         Create all objects
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
Exemplo n.º 11
0
 def __init__(self):
     """
         Create all objects
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
Exemplo n.º 12
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if not Lp().scanner.is_locked():
         Lp().window.pulse(False)
     if self._current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     self.set_next()
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 13
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if self.is_in_queue(self._current_track.id):
         self.remove_from_queue(self._current_track.id)
     ShufflePlayer._on_stream_start(self, bus, message)
     BinPlayer._on_stream_start(self, bus, message)
     AutoSimilarPlayer._on_stream_start(self, bus, message)
     self.set_next()
     self.set_prev()
Exemplo n.º 14
0
 def __init__(self):
     """
         Init player
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
     self.update_crossfading()
Exemplo n.º 15
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if self.track_in_queue(self._current_track):
         self.remove_from_queue(self._current_track.id)
     else:
         self._current_playback_track = self._current_track
     ShufflePlayer._on_stream_start(self, bus, message)
     BinPlayer._on_stream_start(self, bus, message)
     self.set_prev()
     self.set_next()
Exemplo n.º 16
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if self.current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if self._queue and self.current_track.id == self._queue[0]:
         self._queue.pop(0)
         self.emit("queue-changed")
     self.set_next()
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 17
0
 def __init__(self):
     """
         Init player
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
     self.update_crossfading()
Exemplo n.º 18
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if self.current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if self._queue and self.current_track.id == self._queue[0]:
         self._queue.pop(0)
         self.emit("queue-changed")
     self.set_next()
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 19
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)
Exemplo n.º 20
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)
Exemplo n.º 21
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if not Lp().scanner.is_locked():
         Lp().window.pulse(False)
     if self._current_track.id is not None and self._current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if not self.__do_not_update_next:
         self.set_next()
     self.__do_not_update_next = False
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 22
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if not Lp().scanner.is_locked():
         Lp().window.pulse(False)
     if self.current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if self._queue and self.current_track.id == self._queue[0]:
         self._queue.pop(0)
         self.emit("queue-changed")
     self.set_next()
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 23
0
 def __init__(self):
     """
         Init player
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
     self.update_crossfading()
     self.__do_not_update_next = False
     Lp().settings.connect('changed::playback', self.__on_playback_changed)
Exemplo n.º 24
0
 def __init__(self):
     """
         Init player
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     UserPlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     ExternalsPlayer.__init__(self)
     self.update_crossfading()
     self.__do_not_update_next = False
     Lp().settings.connect("changed::playback", self.__on_playback_changed)
Exemplo n.º 25
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")
Exemplo n.º 26
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if not Lp().scanner.is_locked():
         Lp().window.pulse(False)
     if self.current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if self._queue and self.current_track.id == self._queue[0]:
         self._queue.pop(0)
         self.emit("queue-changed")
     self.set_next()
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 27
0
 def __init__(self):
     """
         Init player
     """
     GObject.GObject.__init__(self)
     AlbumsPlayer.__init__(self)
     AutoRandomPlayer.__init__(self)
     AutoSimilarPlayer.__init__(self)
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     TransitionsPlayer.__init__(self)
     self.__stop_after_track_id = None
     App().settings.connect("changed::repeat", self.update_next_prev)
Exemplo n.º 28
0
 def __init__(self):
     """
         Init player
     """
     BinPlayer.__init__(self)
     QueuePlayer.__init__(self)
     LinearPlayer.__init__(self)
     ShufflePlayer.__init__(self)
     PlaylistPlayer.__init__(self)
     RadioPlayer.__init__(self)
     SimilarsPlayer.__init__(self)
     self.__stop_after_track_id = None
     self.update_crossfading()
     App().settings.connect("changed::repeat", self.__on_repeat_changed)
     self._albums_backup = []
Exemplo n.º 29
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if not App().scanner.is_locked():
         App().window.container.pulse(False)
     if self._current_track.id is not None and self._current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if self.track_in_queue(self._current_track):
         self.remove_from_queue(self._current_track.id)
     else:
         if self.shuffle_has_next or not self.__do_not_update_next:
             self.set_next()
         self.__do_not_update_next = False
         self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 30
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')
Exemplo n.º 31
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')
Exemplo n.º 32
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")
Exemplo n.º 33
0
 def _on_stream_start(self, bus, message):
     """
         On stream start, set next and previous track
     """
     if not Lp().scanner.is_locked():
         Lp().window.pulse(False)
     if self.current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     if self._queue and self.current_track.id == self._queue[0]:
         self._queue.pop(0)
         self.emit("queue-changed")
     # Only set next if needed, not when user load a track in shuffle mode
     if (not self._is_party and self._shuffle != Shuffle.TRACKS_ARTIST and
         self._shuffle != Shuffle.TRACKS) or\
             self.current_track == self.next_track or\
             self.current_track.id == Type.RADIOS or\
             self.next_track.id is None:
         self.set_next()
     self.set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 34
0
 def _on_stream_start(self, bus, message):
     if self.current_track.id >= 0:
         ShufflePlayer._on_stream_start(self, bus, message)
     self._set_next()
     self._set_prev()
     BinPlayer._on_stream_start(self, bus, message)
Exemplo n.º 35
0
 def _on_stream_start(self, bus, message):
     BinPlayer._on_stream_start(self, bus, message)
     ShufflePlayer._on_stream_start(self, bus, message)
Exemplo n.º 36
0
 def load(self, track):
     if track.id == Type.RADIOS:
         RadioPlayer.load(self, track)
     else:
         BinPlayer.load(self, track)