示例#1
0
        /// <inheritdoc />
        public override void Deserialize(SequenceEntity entity)
        {
            if (entity == null)
            {
                throw new CorruptedFileException();
            }

            Bars  = entity.Bars;
            Beats = entity.Beats;
            Gate  = entity.Gate;
            ReloadSteps();

            InNote  = ((DrumSequenceEntity)entity).InNote;
            OutNote = ((DrumSequenceEntity)entity).OutNote;

            Input.Channel = entity.Input.Channel;
            if (entity.Input.Device.HasValue)
            {
                Input.ConnectToDevice(entity.Input.Device.Value);
            }

            Output.Channel = entity.Output.Channel;
            if (entity.Output.Device.HasValue)
            {
                Output.ConnectToDevice(entity.Output.Device.Value);
            }

            var i = 0;

            foreach (var step in ((DrumSequenceEntity)entity).Steps)
            {
                Steps[i].Deserialize(step);
                i++;
            }
        }
示例#2
0
        /// <inheritdoc />
        public override void Deserialize(SequenceEntity entity)
        {
            if (entity == null)
            {
                throw new CorruptedFileException();
            }

            Stop();
            Bars  = entity.Bars;
            Beats = entity.Beats;
            ReloadSteps();
            _timer.SetTimer();
        }
示例#3
0
 /// <summary>
 ///     Deserializes sequence by applying values from passed serialized entity to this instance of Sequence.
 /// </summary>
 /// <param name="entity">Serialized sequence</param>
 public abstract void Deserialize(SequenceEntity entity);