コード例 #1
0
        public async Task <string> Transfer([NotNull] TransferState cmd)
        {
            var ps = cmd.CurrentSession;

            ConnectState.PlayOrigin = ProtoUtils.ConvertPlayOrigin(ps.PlayOrigin);
            ConnectState.Options    = ProtoUtils.ConvertPlayerOptions(cmd.Options);
            var sessionId = SetContext(ps.Context);

            var pb = cmd.Playback;

            TracksKeeper.InitializeFrom(list => list.FindIndex(z => z.Uid == ps.CurrentUid), pb.CurrentTrack, cmd.Queue);

            ConnectState.PositionAsOfTimestamp = pb.PositionAsOfTimestamp;
            ConnectState.Timestamp             = pb.IsPaused
                ? TimeProvider.CurrentTimeMillis() : pb.Timestamp;

            await LoadTransforming();

            return(sessionId);
        }