1. 29 May, 2019 3 commits
    • Jean Felder's avatar
      mpris: Make the trackid truly unique · ec529590
      Jean Felder authored
      Playlists can have the same song several times. Therefore, the song id
      is not enough to have a unique identifer.
      Use the song position as a suffix to trackid to handle duplicate
      A current_song_index property is introduced to have the equivalent of
      the current_song property.
      Related: #100
    • Jean Felder's avatar
      player: Define a current_song_index property for the playlist · 0f5a63bd
      Jean Felder authored
      Switch from a getter to a GObject property. This allows to have the
      equivalent of the current_song property.
      This property will be used by the player in the next commit to
      uniquify the list of songs returned to MPRIS.
    • Jean Felder's avatar
      mpris: Do not send the Stopped signal when a song ends · 7f67eeed
      Jean Felder authored
      MPRIS specifications are not explicit whether the "Stopped" signal
      should be sent at the end of a song. It seems logical not to emit this
      signal if the playlist is not finished because a new song is gonna
      start. Besides, this is the behavior of all the usual audio players.
      This is fixed by returning the "Playing" PlaybackStatus if the player
      is in the LOADING (which happens at the end of all songs) or PLAYING
      Related: #282
  2. 27 May, 2019 6 commits
  3. 20 May, 2019 1 commit
  4. 19 May, 2019 1 commit
  5. 15 May, 2019 1 commit
  6. 14 May, 2019 2 commits
    • Jean Felder's avatar
      playlists: Rename StaticPlaylists to SmartPlaylists · 1fde8b0b
      Jean Felder authored
      Favorites, RecentlyAdded, RecentlyPlayed, NeverPlayed and MostPlayed
      playlists are supposed to be call SmartPlaylists in GNOME Music
      In summary, it exists two types of playlists:
      - SmartPlaylists: playlists are auto generated
      - user playlists: playlists created by the user
    • Jean Felder's avatar
      playlistview: Simplify protected playlists check · 35ec8ee5
      Jean Felder authored
      A playlist is protected if and only if it is a static one. Therefore,
      the "is_static_playlist" method from Playlists can be used to check if
      a playlist is protected.
      This allows to remove the "_current_playlist_is_protected" method from
  7. 13 May, 2019 2 commits
  8. 12 May, 2019 1 commit
    • Jean Felder's avatar
      player: Correctly handle load and play logic · 3db22df4
      Jean Felder authored
      The play method can be called in 4 cases:
      * At the beginning of a playlist to start the player (set_playlist +
        play calls)
      * To resume a song when in pause (play_pause)
      * To go to next or previous song (next and previous calls)
      * At the end of song to play the next song (via _on_eos which itself
        relies on a next call)
      The main difficulty inside the play method is to be able to detect if
      the current song has changed or if the player is just paused. In the
      first case, the _load method needs to be called in order to update the
      GstPlayer url.
      Initially, the test to distinguish these two cases was to check if the
      Player was on pause. This worked reliably expect in one case: it was
      impossible to change the current song while an other song was on
      pause (see #256).
      This issue was solved by checking if the song url had changed
      instead. This solved the previous issue but created an other one: the
      repeat-song mode did not work anymore. Indeed, when a song is
      repeated, the playlist url does not change at the end of the song
      (see #278).
      So, an additionnal check was added to test the repeat mode of the
      player. It also fixed the previous indeed the previous issue but
      introduced a new one. In repeat-song mode, the song restarts every
      time the player has been paused (see #280).
      All these issues can be solved by adding a song_changed bool parameter
      to the play method with a default value of True. The only case where
      it needs to be set to False is in the play_pause method.
      Related: #256, #278
      Closes: #280
  9. 11 May, 2019 1 commit
  10. 08 May, 2019 2 commits
    • Jean Felder's avatar
      player: Remove volume logic · 2bd7fb6b
      Jean Felder authored
      All the volume logic is unnecessary as Music does not expose a volume
      Update MPRIS code accordingly to remove the volume property. According
      to MPRIS specifications, players should not expose the Volume
      property as read/write if getting or setting the volume is not supported.
      Related: #100
    • Aron Xu's avatar
      Update Chinese (China) translation · a6aa399b
      Aron Xu authored
  11. 02 May, 2019 4 commits
    • Marinus Schraal's avatar
      playlistview: Correct idle_add use · 1d4631a8
      Marinus Schraal authored
      Using GLib.idle_add comes with constraints, which were not cleanly followed
      in the current code.
      Remove one unneeded use of idle_add and explicitly return
      GLib.SOURCE_REMOVE in another instance.
    • Marinus Schraal's avatar
      playertoolbar: Remove clock-tick signal handling · 7bad9df1
      Marinus Schraal authored
      The clock-tick signal in Player is 1-on-1 passed on from GstPlayer and only
      used in PlayerToolbar for updating the progression time label.
      PlayerToolbar also listens to SmoothScale for updating the time label,
      duplicating functionality.
      Remove clock-tick handling and only use SmoothScale progress indication, as
      clock-tick used to be unreliable anyway (see previous commit) and does not
      actually update with seeking.
    • Marinus Schraal's avatar
      grilo: Use idle_add for writeback functions · c61964a5
      Marinus Schraal authored
      The GStreamer clock stops ticking as soon as a Grilo writeback is
      triggered. This does not pose as an immediate problem, as it is currently
      only relied upon for scrobbling, triggering Tracker writeback and passing
      on the clock-tick. However, the former two are one-time events per song and
      the latter is also provided by other means.
      It will be a problem as soon as the pipeline and clock do not reset between
      songs when gapless playback is introduced. The exact core of the problem is
      unknown, but might be related to Grilo async handling: grilo#81.
      Calling the Grilo writeback function in an idle_add seems to resolve the
      issue until it is fixed upstream.
    • Jean Felder's avatar
      player: Simplify _on_eos method · 2657b0ca
      Jean Felder authored
      on_glib_idle function does exactly the same thing as the next
      method. So, it can be directly replaced by a call to the next
      method. The idle_add call can also be removed as it serves no
  12. 29 Apr, 2019 1 commit
    • Jean Felder's avatar
      mpris: Do not send PlaybackStatus property if unchanged · f0b0b914
      Jean Felder authored
      GstPlayer state changes can be redundant because of its asynchronous
      nature. For example, when launching a new song, the playing state is
      sent two times. This results in the PlaybackStatus "Playing" property
      being sent two times.
      Checking that the status has really changed to avoid sending two times
      the same signal.
      Related: #43
  13. 26 Apr, 2019 4 commits
  14. 24 Apr, 2019 11 commits