public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            LibraryType = (MsexElementType)data.ReadByte();

            if (MsexVersion > CitpMsexVersions.Msex10Version)
            {
                LibraryParentId = data.ReadMsexLibraryId();
            }

            int libraryCount = 0;

            if (MsexVersion < CitpMsexVersions.Msex12Version)
            {
                libraryCount = data.ReadByte();
            }
            else
            {
                libraryCount = data.ReadUInt16();
            }

            for (int n = 0; n < libraryCount; n++)
            {
                LibraryNumbers.Add(data.ReadByte());
            }
        }
예제 #2
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            int count = data.ReadUInt16();

            for (int n = 0; n < count; n++)
            {
                FixtureChange change = new FixtureChange()
                {
                    FixtureId     = data.ReadUInt32(),
                    ChangedFields = (Modification)data.ReadByte(),
                    Patched       = data.ReadBoolean(),
                    DMXUniverse   = data.ReadByte(),
                    DMXAddress    = data.ReadUInt16(),
                    Unit          = data.ReadUcs2(),
                    Channel       = data.ReadUInt16(),
                    Circuit       = data.ReadUcs2(),
                    Note          = data.ReadUcs2(),
                    Position      = new Coordinate()
                    {
                        X = data.ReadSingle(), Y = data.ReadSingle(), Z = data.ReadSingle()
                    },
                    Angle = new Coordinate()
                    {
                        X = data.ReadSingle(), Y = data.ReadSingle(), Z = data.ReadSingle()
                    }
                };
                Fixtures.Add(change);
            }
        }
예제 #3
0
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            byte versionHi = reader.ReadByte();
            byte versionLo = reader.ReadByte();

            if (versionHi == 1 && versionLo == 0)
            {
                Version = MsexVersion.Version1_0;
            }
            else if (versionHi == 1 && versionLo == 1)
            {
                Version = MsexVersion.Version1_1;
            }
            else if (versionHi == 1 && versionLo == 2)
            {
                Version = MsexVersion.Version1_2;
            }
            else
            {
                Version = MsexVersion.UnsupportedVersion;
            }

            if (Version == MsexVersion.UnsupportedVersion)
            {
                throw new InvalidOperationException("Incorrect or invalid MSEX version");
            }

            if (MessageType != CitpEnumHelper.GetEnumFromIdString <MsexMessageType>(reader.ReadIdString()))
            {
                throw new InvalidOperationException("Incorrect or invalid message type");
            }
        }
예제 #4
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            ThumbnailFormat = data.ReadCookie();
            ThumbnailWidth  = data.ReadUInt16();
            ThumbnailHeight = data.ReadUInt16();
            ThumbnailFlags  = (ThumbnailOptions)data.ReadByte();
            LibraryType     = (MsexElementType)data.ReadByte();

            if (MsexVersion < CitpMsexVersions.Msex11Version)
            {
                LibraryId = new CitpMsexLibraryId(data.ReadByte());
            }
            else
            {
                LibraryId = data.ReadMsexLibraryId();
            }

            int elementCount = (MsexVersion < CitpMsexVersions.Msex12Version) ? data.ReadByte() : data.ReadUInt16();

            for (int n = 0; n < elementCount; n++)
            {
                ElementNumbers.Add(data.ReadByte());
            }
        }
            public override void ReadData(CitpBinaryReader data)
            {
                if (MsexVersion < CitpMsexVersions.Msex11Version)
                {
                    LibraryNumber = data.ReadByte();
                }
                else
                {
                    LibraryId = data.ReadMsexLibraryId();
                }

                if (MsexVersion > CitpMsexVersions.Msex11Version)
                {
                    SerialNumber = data.ReadUInt32();
                }

                DmxRangeMin = data.ReadByte();
                DmxRangeMax = data.ReadByte();
                Name        = data.ReadUcs2();

                if (MsexVersion > CitpMsexVersions.Msex10Version)
                {
                    LibraryCount = MsexVersion < CitpMsexVersions.Msex12Version ? data.ReadByte() : data.ReadUInt16();
                }

                ElementCount = MsexVersion < CitpMsexVersions.Msex12Version ? data.ReadByte() : data.ReadUInt16();
            }
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            byte supportedVersionsCount = reader.ReadByte();

            SupportedMsexVersions = new List <MsexVersion>(supportedVersionsCount);
            for (int i = 0; i < supportedVersionsCount; ++i)
            {
                byte versionMinor = reader.ReadByte();
                byte versionMajor = reader.ReadByte();

                if (versionMajor == 1 && versionMinor == 0)
                {
                    SupportedMsexVersions.Add(MsexVersion.Version1_0);
                }
                else if (versionMajor == 1 && versionMinor == 1)
                {
                    SupportedMsexVersions.Add(MsexVersion.Version1_1);
                }
                else if (versionMajor == 1 && versionMinor == 2)
                {
                    SupportedMsexVersions.Add(MsexVersion.Version1_2);
                }
                else
                {
                    SupportedMsexVersions.Add(MsexVersion.UnsupportedVersion);
                }
            }
        }
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            ThumbnailFormat = data.ReadCookie();
            ThumbnailWidth  = data.ReadUInt16();
            ThumbnailHeight = data.ReadUInt16();
            ThumbnailFlags  = (ThumbnailOptions)data.ReadByte();
            LibraryType     = (MsexElementType)data.ReadByte();

            int libraryCount = (MsexVersion < CitpMsexVersions.Msex12Version) ? data.ReadByte() : data.ReadUInt16();

            if (MsexVersion < CitpMsexVersions.Msex11Version)
            {
                for (int i = 0; i < libraryCount; i++)
                {
                    LibraryIds.Add(new CitpMsexLibraryId(data.ReadByte()));
                }
            }
            else
            {
                for (int i = 0; i < libraryCount; i++)
                {
                    LibraryIds.Add(data.ReadMsexLibraryId());
                }
            }
        }
예제 #8
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            MsexVersion      = data.ReadByte();
            MsexVersion     += (float)data.ReadByte() / 10;
            LayerContentType = data.ReadCookie();
        }
예제 #9
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);
            byte majorVersion = data.ReadByte();
            byte minorVersion = data.ReadByte();

            MsexVersion      = new Version(majorVersion, minorVersion);
            LayerContentType = data.ReadCookie();
        }
예제 #10
0
 public override void ReadData(CitpBinaryReader data)
 {
     SourceIdentifier = data.ReadUInt16();
     SourceName       = data.ReadUcs2();
     PhysicalOutput   = data.ReadByte();
     LayerNumber      = data.ReadByte();
     Flags            = data.ReadUInt16();
     Width            = data.ReadUInt16();
     Height           = data.ReadUInt16();
 }
예제 #11
0
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            SourceIdentifier = reader.ReadUInt16();
            FrameFormat      = CitpEnumHelper.GetEnumFromIdString <MsexImageFormat>(reader.ReadIdString());
            FrameWidth       = reader.ReadUInt16();
            FrameHeight      = reader.ReadUInt16();
            Fps     = reader.ReadByte();
            Timeout = reader.ReadByte();
        }
예제 #12
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            Blind         = data.ReadByte();
            UniverseIndex = data.ReadByte();
            FirstChannel  = data.ReadUInt16();
            int channelCount = data.ReadUInt16();

            ChannelLevels = data.ReadBytes(channelCount);
        }
예제 #13
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            SourceIdentifier = data.ReadUInt16();
            FrameFormat      = data.ReadCookie();
            FrameWidth       = data.ReadUInt16();
            FrameHeight      = data.ReadUInt16();
            FramesPerSecond  = data.ReadByte();
            Timeout          = data.ReadByte();
        }
예제 #14
0
 public override void ReadData(CitpBinaryReader data)
 {
     Number                = data.ReadByte();
     DmxRangeMin           = data.ReadByte();
     DmxRangeMax           = data.ReadByte();
     MediaName             = data.ReadUcs2();
     MediaVersionTimestamp = data.ReadUInt64();
     MediaWidth            = data.ReadUInt16();
     MediaHeight           = data.ReadUInt16();
     MediaLength           = data.ReadUInt32();
     MediaFPS              = data.ReadByte();
 }
예제 #15
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            FixtureIdentifier = data.ReadUInt16();
            Universe          = data.ReadByte();
            data.ReadByte();
            Channel      = data.ReadUInt16();
            ChannelCount = data.ReadUInt16();
            FixtureMake  = data.ReadUcs1();
            FixtureName  = data.ReadUcs1();
        }
예제 #16
0
 public override void ReadData(CitpBinaryReader data)
 {
     ElementNumber = data.ReadByte();
     if (MsexVersion == CitpMsexVersions.Msex12Version)
     {
         SerialNumber = data.ReadUInt32();
     }
     DmxRangeMin      = data.ReadByte();
     DmxRangeMax      = data.ReadByte();
     Name             = data.ReadUcs2();
     VersionTimeStamp = data.ReadUInt64();
 }
예제 #17
0
파일: CitpHeader.cs 프로젝트: ming-hai/ACN
        public override void ReadData(CitpBinaryReader data)
        {
            Cookie       = data.ReadCookie();
            VersionMajor = data.ReadByte();
            VersionMinor = data.ReadByte();

            RequestId        = data.ReadUInt16();
            MessageSize      = data.ReadUInt32();
            MessagePartCount = data.ReadUInt16();
            MessagePart      = data.ReadUInt16();

            ContentType = data.ReadCookie();
        }
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            LibraryType = (MsexElementType)data.ReadByte();

            int libraryCount = MsexVersion < CitpMsexVersions.Msex12Version ? data.ReadByte() : data.ReadUInt16();

            for (int n = 0; n < libraryCount; n++)
            {
                Libraries.Add(new ElementLibraryInformation(data, MsexVersion));
            }
        }
예제 #19
0
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            UniverseIndex = reader.ReadByte();
            UniverseName  = reader.ReadString(true);
        }
예제 #20
0
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            UniverseIndex    = reader.ReadByte();
            ConnectionString = CitpDmxConnectionString.Parse(reader.ReadString(true));
        }
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            IsBlind       = reader.ReadBoolean();
            UniverseIndex = reader.ReadByte();
            FirstChannel  = reader.ReadUInt16();

            ushort channelLevelsCount = reader.ReadUInt16();

            ChannelLevels = new List <byte>(channelLevelsCount);
            for (int i = 0; i < channelLevelsCount; ++i)
            {
                ChannelLevels.Add(reader.ReadByte());
            }
        }
예제 #22
0
        protected override void DeserializeFromStream(CitpBinaryReader reader)
        {
            base.DeserializeFromStream(reader);

            ushort levelsCount = reader.ReadUInt16();

            Levels = new List <ChannelLevel>(levelsCount);
            for (int i = 0; i < levelsCount; ++i)
            {
                Levels.Add(new ChannelLevel
                {
                    UniverseIndex = reader.ReadByte(),
                    Channel       = reader.ReadUInt16(),
                    Level         = reader.ReadByte()
                });
            }
        }
예제 #23
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            int count = data.ReadUInt16();

            for (int n = 0; n < count; n++)
            {
                ChannelLevel level = new ChannelLevel()
                {
                    UniverseIndex = data.ReadByte(),
                    Channel       = data.ReadUInt16(),
                    Level         = data.ReadByte()
                };
                ChannelLevels.Add(level);
            }
        }
예제 #24
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);
            Format = (LiveViewImageFormat)data.ReadByte();
            uint dataSize = data.ReadUInt32();

            Data = data.ReadBytes((int)dataSize);
        }
예제 #25
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            FixtureIdentifier = data.ReadUInt16();
            int filterCount = data.ReadByte();
            int goboCount   = data.ReadByte();

            for (int n = 0; n < filterCount; n++)
            {
                FrameFilters.Add(data.ReadUcs1());
            }
            for (int n = 0; n < goboCount; n++)
            {
                FrameGobos.Add(data.ReadUcs1());
            }
        }
            public override void ReadData(CitpBinaryReader data)
            {
                ElementNumber = data.ReadByte();
                if (MsexVersion == CitpMsexVersions.Msex12Version)
                {
                    SerialNumber = data.ReadUInt32();
                }
                DmxRangeMin = data.ReadByte();
                DmxRangeMax = data.ReadByte();
                EffectName  = data.ReadUcs2();
                byte parameterCount = data.ReadByte();

                EffectParameterNames.Clear();
                for (int i = 0; i < parameterCount; i++)
                {
                    EffectParameterNames.Add(data.ReadUcs2());
                }
            }
예제 #27
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            int count = data.ReadByte();

            for (int n = 0; n < count; n++)
            {
                SupportedMSEXVersions.Add(data.ReadUInt16().ToMsexVersion());
            }
        }
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            if (MsexVersion < CitpMsexVersions.Msex11Version)
            {
                LibraryId.ParseNumber(data.ReadByte());
            }
            else
            {
                LibraryId = data.ReadMsexLibraryId();
            }

            int elementCount = MsexVersion < CitpMsexVersions.Msex12Version ? data.ReadByte() : data.ReadUInt16();

            for (int n = 0; n < elementCount; n++)
            {
                Elements.Add(new EffectInfomation(data, MsexVersion));
            }
        }
예제 #29
0
        public override void ReadData(CitpBinaryReader data)
        {
            base.ReadData(data);

            if (MsexVersion < 1.1)
            {
                LibraryId.ParseNumber(data.ReadByte());
            }
            else
            {
                LibraryId = data.ReadMsexLibraryId();
            }

            int elementCount = MsexVersion < 1.2 ? data.ReadByte() : data.ReadUInt16();

            for (int n = 0; n < elementCount; n++)
            {
                Elements.Add(new MediaInformation(data));
            }
        }
예제 #30
0
        public List <FixtureLink> ReadLinks(CitpBinaryReader data)
        {
            List <FixtureLink> links = new List <FixtureLink>();

            int count = data.ReadByte();

            for (int n = 0; n < count; n++)
            {
                FixtureLink link = new FixtureLink()
                {
                    Type = (FixtureLinkType)data.ReadByte()
                };

                int linkDataSize = data.ReadUInt16();
                link.Data = data.ReadBytes(linkDataSize);
                links.Add(link);
            }

            return(links);
        }