Esempio n. 1
0
        public VixenImport(string filename)
        {
            var deserializer = new XmlSerializer(typeof(VIX.Program));

            VIX.Program sequence;
            using (TextReader textReader = new StreamReader(filename))
            {
                sequence = (VIX.Program)deserializer.Deserialize(textReader);
            }

            this.eventPeriodInMilliseconds = sequence.EventPeriodInMilliseconds;

            byte[] effectData = Convert.FromBase64String(sequence.EventValues);
            this.effectsPerChannel = effectData.Length / sequence.Channels.Length;

            int i = 0;
            foreach (var channel in sequence.Channels)
            {
                var channelIdentity = new VixenChannel(channel.output);
                AddChannelData(channelIdentity, new ChannelData(channel.Value));

                var channelEffectData = new byte[this.effectsPerChannel];
                Array.Copy(effectData, i, channelEffectData, 0, channelEffectData.Length);
                effectDataPerChannel[channelIdentity] = channelEffectData;

                i += this.effectsPerChannel;
            }
        }
Esempio n. 2
0
        public VixenImport(string filename)
        {
            var deserializer = new XmlSerializer(typeof(VIX.Program));

            VIX.Program sequence;
            using (TextReader textReader = new StreamReader(filename))
            {
                sequence = (VIX.Program)deserializer.Deserialize(textReader);
            }

            this.eventPeriodInMilliseconds = sequence.EventPeriodInMilliseconds;

            byte[] effectData = Convert.FromBase64String(sequence.EventValues);
            this.effectsPerChannel = effectData.Length / sequence.Channels.Length;

            int i = 0;

            foreach (var channel in sequence.Channels)
            {
                var channelIdentity = new VixenChannel(channel.output);
                AddChannelData(channelIdentity, new ChannelData(channel.Value));

                var channelEffectData = new byte[this.effectsPerChannel];
                Array.Copy(effectData, i, channelEffectData, 0, channelEffectData.Length);
                effectDataPerChannel[channelIdentity] = channelEffectData;

                i += this.effectsPerChannel;
            }
        }