コード例 #1
0
        public EditRGBTrack Duplicate()
        {
            var track = new EditRGBTrack();

            track.ledIndices = new List <int>(ledIndices);
            track.gradient   = gradient.Duplicate();
            return(track);
        }
コード例 #2
0
        public override Animation ToAnimation(EditDataSet editSet, DataSet.AnimationBits bits)
        {
            var ret = new AnimationGradient();

            ret.duration = (ushort)(this.duration * 1000.0f);
            ret.faceMask = (uint)this.faces;

            // Add gradient
            ret.gradientTrackOffset = (ushort)bits.rgbTracks.Count;
            var tempTrack = new EditRGBTrack()
            {
                gradient = gradient
            };
            var gradientTrack = tempTrack.ToTrack(editSet, bits);

            bits.rgbTracks.Add(gradientTrack);
            return(ret);
        }
コード例 #3
0
        public override Animation ToAnimation(EditDataSet editSet, DataSet.AnimationBits bits)
        {
            var ret = new AnimationGradientPattern();

            ret.duration           = (ushort)(duration * 1000); // stored in milliseconds
            ret.speedMultiplier256 = (ushort)(this.speedMultiplier * 256.0f);
            ret.tracksOffset       = (ushort)editSet.getPatternTrackOffset(pattern);
            ret.trackCount         = (ushort)pattern.gradients.Count;

            // Add gradient
            ret.gradientTrackOffset = (ushort)bits.rgbTracks.Count;
            var tempTrack = new EditRGBTrack()
            {
                gradient = gradient
            };
            var gradientTrack = tempTrack.ToTrack(editSet, bits);

            bits.rgbTracks.Add(gradientTrack);
            ret.overrideWithFace = (byte)(overrideWithFace ? 1 : 0);

            return(ret);
        }