コード例 #1
0
        public static bool TryGetLastPlayedMusicTrack(ProtoPlaylist playlist, out MusicTrack lastMusicTrack)
        {
            if (!LastStopTime.TryGetValue(playlist, out var result))
            {
                lastMusicTrack = null;
                return(false);
            }

            LastStopTime.Remove(playlist);

            if (Api.Client.Core.ClientRealTime - result.ClientTimeLastPlayback
                > MaxDurationToRememberTrackPosition)
            {
                // it stopped too long ago, forget about this
                lastMusicTrack = null;
                return(false);
            }

            lastMusicTrack = result.LastMusicTrack;
            return(true);
        }
コード例 #2
0
 public static void RememberLastTrack(ProtoPlaylist playlist, MusicTrack lastMusicTrack)
 {
     LastStopTime[playlist] = new PlaylistStopTime(lastMusicTrack, Api.Client.Core.ClientRealTime);
 }