1. 20 May, 2019 1 commit
  2. 19 May, 2019 1 commit
  3. 15 May, 2019 1 commit
  4. 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
      terminology.
      
      In summary, it exists two types of playlists:
      - SmartPlaylists: playlists are auto generated
      - user playlists: playlists created by the user
      1fde8b0b
    • 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
      PlaylistView.
      35ec8ee5
  5. 13 May, 2019 2 commits
  6. 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
      3db22df4
  7. 11 May, 2019 1 commit
  8. 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
      slider.
      
      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
      2bd7fb6b
    • Aron Xu's avatar
      Update Chinese (China) translation · a6aa399b
      Aron Xu authored
      a6aa399b
  9. 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.
      1d4631a8
    • 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.
      7bad9df1
    • 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.
      c61964a5
    • 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
      purpose.
      2657b0ca
  10. 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
      f0b0b914
  11. 26 Apr, 2019 4 commits
  12. 24 Apr, 2019 17 commits
    • Jean Felder's avatar
      playlistview: Scroll to the selected song on play · ad83872e
      Jean Felder authored
      This way, PlaylistView has the same behavior as SongsView.
      ad83872e
    • Jean Felder's avatar
      playlistview: Simplify row-activated signal emissions · 43f3cfde
      Jean Felder authored
      The column parameter is not used. So, it can be None.
      43f3cfde
    • Jean Felder's avatar
      playlistview: Do not automatically select a song on play · 5d478ff5
      Jean Felder authored
      With the previous change, set_playlist method from the PlayerPlaylist
      will now automatically select a song according to the repeat mode if
      none is provided. Therefore, when clicking on the play button it is no
      longer necessary to provide a song to play.
      5d478ff5
    • Jean Felder's avatar
      player: Automatically select a song if none is requested · dd0c277d
      Jean Felder authored
      When clicking on the play button from PlaylistView, no song is
      selected. By default, the first song is automatically selected and
      provided as parameter to the set_playlist method of Player. This
      choice makes sense if the repeat mode is in a linear mode. However, in
      shuffle mode, it is more logic to select a random song.
      
      This commit adds the automatic selection to the set_playlist
      method in PlayerPlaylist. The next one will remove the automatic
      selection of the first song in PlaylistView.
      dd0c277d
    • Jean Felder's avatar
      playlistview: Remove unecessary check · 21d963b7
      Jean Felder authored
      set_playlist method from the PlayerPlaylist also checks if the
      requested song can be played and tries to play the next song if
      necessary.
      21d963b7
    • Jean Felder's avatar
      playlistview: Fix activate_playlist method · 80cf15fe
      Jean Felder authored
      This method is used by MPRIS to start playing a playlist.
      With the multiple refactorings and rewrites of BaseView (mostly the
      populate logic change) and PlaylistView, this method does not work
      anymore.
      
      Fix the method and simplify it (remove the signal logic).
      80cf15fe
    • Jean Felder's avatar
      playlistview: Do not manually emit row-activated signal · fa0311e2
      Jean Felder authored
      "row-activated" of a GtkListBox is not an action signal, it should not
      be emitted manually.
      
      Use "activate" signal from the row instead.
      fa0311e2
    • Jean Felder's avatar
      player: Remove prev-next-invalidated signal · 1249269b
      Jean Felder authored
      With the previous changes to PlayerToolbar and MPRIS, all the previous
      use cases of "prev-next-invalidated" signal are now either covered by
      "playlist-changed" or the repeat-mode changes.
      1249269b
    • Jean Felder's avatar
      player: Emit the correct signal when a song position has changed · 05d55535
      Jean Felder authored
      When a song position in the playlist has changed, it means that the
      whole playlist has changed. Thus, the "playlist-changed" signal needs
      to be sent instead of "prev-next-invalidated".
      05d55535
    • Jean Felder's avatar
      player: Remove prev-next-invalidated emission in set_playlist · 38c8665a
      Jean Felder authored
      If the playback is already in PLAYING mode, a song-changed signal will
      also be emitted by the play method. This signal emission is enough for
      the PlayerToolbar to update its view and for MPRIS server to emit the
      required PropertiesChanged.
      38c8665a
    • Jean Felder's avatar
      player: Do not emit 'prev-next-invalidated' on repeat-change · b2a1819f
      Jean Felder authored
      With the previous changes in PlayerToolbar and MPRIS, all the
      "prev-next-invalidated" emissions on repeat-mode changes are now
      directly handled by listening to repeat-mode changes.
      b2a1819f
    • Jean Felder's avatar
      mpris: Use repeat-mode changes to emit CanGo{previous/next} · 19c67ca3
      Jean Felder authored
      See the previous commit message for the whole explanation. In summary,
      "prev-next-invalidated" and "repeat-mode" changes are redundant.
      19c67ca3
    • Jean Felder's avatar
      playertoolbar: Use repeat-mode changes to update prev/next buttons · 74876e0b
      Jean Felder authored
      With the previous repeat logic changes in player.py (repeat-mode
      property is now set in Player and propagated to PlayerPlaylist), the
      has_next and has_previous methods of PlayerPlaylist can sometimes be
      called before the repeat-mode property has been propagated. Indeed,
      the prev-next-invalidated signal (which results in has_previous and
      has_next calls) is emitted inside the repeat-mode setter of the
      Player.
      This can result in the previous and next buttons being improperly
      updated on repeat-mode changes.
      
      In fact, there are only two cases when the previous and next button
      need to be updated:
      * the current song changes (already covered)
      * the repeat mode changes (not covered)
      
      Thus, this issue is fixed by updating the previous and next button on
      repeat-mode changes and removing the "prev-next-invalidated"
      connection.
      74876e0b
    • Kukuh Syafaat's avatar
      Update Indonesian translation · b9677741
      Kukuh Syafaat authored
      b9677741
    • Jean Felder's avatar
      player: Fix repeat all mode with only one song · de4b72c6
      Jean Felder authored
      Commits 7a7db137 and b6467bf4 fixed an issue with the player: it was
      impossible to change the current song when the player was on
      pause. However, it broke the repeat song mode and repeat all mode if
      the playlist has only one song.
      Indeed, at the end of a song, a new song is loaded only if the song
      url has changed. But, if the repeat all mode is set and the playlist
      has only one song, the url is unchanged.
      
      The repeat song case had already been solved by commit fcebe9ec.
      Adding a check to test if the repeat mode is in a
      loop (RepeatMode.SONG or RepeatMode.ALL is set) fixes the issue for
      both cases.
      
      Closes: #278
      de4b72c6
    • Daniel Mustieles García's avatar
      Updated Spanish translation · ac7fea69
      Daniel Mustieles García authored
      ac7fea69
    • Jean Felder's avatar
      playlistview: Do not add a playlist if the view is not populated · 17fff104
      Jean Felder authored
      Since commit 0faaeea7, the views are populated when opened. This means
      that a playlist can be created before the PlaylistView has been
      populated. In that case, the newly created playlist will be displayed
      two times: one because of the playlist creation logic and a second
      time because of the populate logic.
      
      Fix the issue by doing nothing in PlaylistView on playlist creation if
      the sidebar is not populated. The playlist will be correctly displayed
      on populate.
      17fff104
  13. 23 Apr, 2019 1 commit
  14. 19 Apr, 2019 1 commit
  15. 18 Apr, 2019 1 commit