Exemple #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++;
            }
        }
Exemple #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();
        }
 /// <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);