vedev
New Member
Posts: 3
Posts: 3
|
Post by vedev on Apr 8, 2022 17:44:34 GMT
Hi,
This package has been wonderful to work with, thank you for making it. I haven't been able to find a clear answer about how to best play the previous song. There's an obvious PlayNextSong event but not one that plays the previous. Is the best way to do that by doing it manually? If so, any tips?
Also, it would be great to have a "fade out to 0 then fade in" transition option.
Thanks again for the awesome unity package!
|
|
vedev
New Member
Posts: 3
Posts: 3
|
Post by vedev on Apr 8, 2022 18:40:03 GMT
And the bigger goal is to create an in-game ui of a playlist selection and playback controls.
|
|
|
Post by DarkTonic Dev on Apr 8, 2022 19:46:13 GMT
I'm afraid you're going to need to use 1-song Playlists to get things to fade out then fade in. The Playlist Controller code is super complicated and I fear adding that may break other things.
Play previous song isn't going to reliably work unless you code it yourself either. Because we keep track of a pool of the remaining songs in the Playlist, so if you have played all, and the pool refills, you'd be going back to the old pool to play previous. Which of course isn't possible. In any case, you could record the song name as it's played and play the previously recorded one, but you'd need to write that code yourself.
Thanks, -Brian
|
|
vedev
New Member
Posts: 3
Posts: 3
|
Post by vedev on Apr 8, 2022 20:59:29 GMT
Got it, thank you for the reply.
My thinking is to subscribe to the SongChanged event to set the last and current song and use thisPlaylist.StartPlaylist(thisPlaylist.name, lastSongName) to play the last song. Of course that wouldn't help if the user wants to go back more than one song.
From your reply, I take it it's not possible to use PlaylistController.Instances[0].CurrentPlaylist.MusicSettings.IndexOf(thisPlaylist.CurrentSong) to play the previous song index of the playlist?
Would a possible solution be to make a duplicate list of song names and use those for navigating through the playlist?
Thank you again for your reply.
|
|
|
Post by DarkTonic Dev on Apr 8, 2022 21:03:20 GMT
Yes, the index of the song doesn't really matter (especially if you're not playing them in order, i.e. shuffle). But if they are in order, that code may be able to locate it. You could try that.
|
|