CurrentSong after Shuffle (1 Viewer)

Messiahs

Portal Pro
December 11, 2008
222
106
Home Country
Germany Germany
MediaPortal Version: v1.1.0 Final

CurrentSong (item position in PlayingNow) returns the same value after shuffling.
example:

Dim MCCurPlaylist As Playlists.PlayList
MCCurPlaylist = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC)
Dim a As Integer = playlistPlayer.SingletonPlayer.CurrentSong
MCCurPlaylist.Shuffle()
Dim b As Integer = playlistPlayer.SingletonPlayer.CurrentSong
 

arion_p

Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    Shuffling the playlist does not change the current song. This is normal, and you can see it in the UI as well.
    If you think about it from a user perspective that is the right thing to do.
     

    Messiahs

    Portal Pro
    December 11, 2008
    222
    106
    Home Country
    Germany Germany
    You're right.. the current song is the same, but the position in Playing now (returned by playlistPlayer.SingletonPlayer.CurrentSong) is another...
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    I reread your code and realized that what you are trying to do is not related to the UI in any way.

    You are modifying a playlist object (it doesn't matter that it is the playlist currently being played, the playlist knows nothing about it or about players altogether) and then expect the player to know what has happened to the playlist. This will simply not work. It is the caller's responsibility to inform the player that something has changed in the playlist by changing the required player properties and/or calling the player's methods. This is by design.

    To get an idea how to do this, have a look at ShufflePlaylist() in GUIMusicPlayList.cs
     

    Users who are viewing this thread

    Top Bottom