protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); switch (Version) { case MsexVersion.Version1_0: case MsexVersion.Version1_1: { int layerStatusCount = reader.ReadByte(); LayerStatuses = new List <LayerStatus>(layerStatusCount); for (int i = 0; i < layerStatusCount; ++i) { LayerStatuses.Add(new LayerStatus { LayerNumber = reader.ReadByte(), PhysicalOutput = reader.ReadByte(), MediaLibraryNumber = reader.ReadByte(), MediaNumber = reader.ReadByte(), MediaName = reader.ReadString(), MediaPosition = reader.ReadUInt32(), MediaLength = reader.ReadUInt32(), MediaFps = reader.ReadByte(), LayerStatusFlags = (MsexLayerStatusFlags)reader.ReadUInt32() }); } } break; case MsexVersion.Version1_2: { int layerStatusCount = reader.ReadByte(); LayerStatuses = new List <LayerStatus>(layerStatusCount); for (int i = 0; i < layerStatusCount; ++i) { LayerStatuses.Add(new LayerStatus { LayerNumber = reader.ReadByte(), PhysicalOutput = reader.ReadByte(), MediaLibraryType = (MsexLibraryType)reader.ReadByte(), MediaLibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)), MediaNumber = reader.ReadByte(), MediaName = reader.ReadString(), MediaPosition = reader.ReadUInt32(), MediaLength = reader.ReadUInt32(), MediaFps = reader.ReadByte(), LayerStatusFlags = (MsexLayerStatusFlags)reader.ReadUInt32() }); } } break; } }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); switch (Version) { case MsexVersion.Version1_1: { LibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)); int elementCount = reader.ReadByte(); Information = new List <CitpGenericInformation>(elementCount); for (int i = 0; i < elementCount; ++i) { Information.Add(new CitpGenericInformation { ElementNumber = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), VersionTimestamp = DateTimeHelpers.ConvertFromUnixTimestamp(reader.ReadUInt64()) }); } } break; case MsexVersion.Version1_2: { LibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)); int elementCount = reader.ReadUInt16(); Information = new List <CitpGenericInformation>(elementCount); for (int i = 0; i < elementCount; ++i) { Information.Add(new CitpGenericInformation { ElementNumber = reader.ReadByte(), SerialNumber = reader.ReadUInt32(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), VersionTimestamp = DateTimeHelpers.ConvertFromUnixTimestamp(reader.ReadUInt64()) }); } } break; } }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); UniverseIndex = reader.ReadByte(); UniverseName = reader.ReadString(true); }
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); ListeningTcpPort = reader.ReadUInt16(); if (ListeningTcpPort == 0) { IsListeningForTcpConnection = false; } CitpPeerType peerType; Type = Enum.TryParse(reader.ReadString(true), out peerType) ? peerType : CitpPeerType.Unknown; Name = reader.ReadString(true); State = reader.ReadString(true); }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); int sourcesCount = reader.ReadUInt16(); Sources = new List <CitpVideoSourceInformation>(sourcesCount); for (int i = 0; i < sourcesCount; ++i) { var s = new CitpVideoSourceInformation { SourceIdentifier = reader.ReadUInt16(), SourceName = reader.ReadString(), PhysicalOutput = reader.ReadByte(), LayerNumber = reader.ReadByte(), Flags = (MsexVideoSourcesFlags)reader.ReadUInt16(), Width = reader.ReadUInt16(), Height = reader.ReadUInt16() }; Sources.Add(s); } }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); switch (Version) { case MsexVersion.Version1_0: { LibraryNumber = reader.ReadByte(); int mediaCount = reader.ReadByte(); Media = new List <CitpMediaInformation>(mediaCount); for (int i = 0; i < mediaCount; ++i) { Media.Add(new CitpMediaInformation { ElementNumber = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), MediaVersionTimestamp = DateTimeHelpers.ConvertFromUnixTimestamp(reader.ReadUInt64()), MediaWidth = reader.ReadUInt16(), MediaHeight = reader.ReadUInt16(), MediaLength = reader.ReadUInt32(), MediaFps = reader.ReadByte() }); } } break; case MsexVersion.Version1_1: { LibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)); int mediaCount = reader.ReadByte(); Media = new List <CitpMediaInformation>(mediaCount); for (int i = 0; i < mediaCount; ++i) { Media.Add(new CitpMediaInformation { ElementNumber = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), MediaVersionTimestamp = DateTimeHelpers.ConvertFromUnixTimestamp(reader.ReadUInt64()), MediaWidth = reader.ReadUInt16(), MediaHeight = reader.ReadUInt16(), MediaLength = reader.ReadUInt32(), MediaFps = reader.ReadByte() }); } } break; case MsexVersion.Version1_2: { LibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)); int mediaCount = reader.ReadUInt16(); Media = new List <CitpMediaInformation>(mediaCount); for (int i = 0; i < mediaCount; ++i) { Media.Add(new CitpMediaInformation { ElementNumber = reader.ReadByte(), SerialNumber = reader.ReadUInt32(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), MediaVersionTimestamp = DateTimeHelpers.ConvertFromUnixTimestamp(reader.ReadUInt64()), MediaWidth = reader.ReadUInt16(), MediaHeight = reader.ReadUInt16(), MediaLength = reader.ReadUInt32(), MediaFps = reader.ReadByte() }); } } break; } }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); Identifier = reader.ReadString(true); }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); switch (Version) { case MsexVersion.Version1_0: case MsexVersion.Version1_1: { ProductName = reader.ReadString(); ProductVersionMajor = reader.ReadByte(); ProductVersionMinor = reader.ReadByte(); int dmxSourcesCount = reader.ReadByte(); LayerDmxSources = new List <CitpDmxConnectionString>(dmxSourcesCount); for (int i = 0; i < dmxSourcesCount; ++i) { LayerDmxSources.Add(CitpDmxConnectionString.Parse(reader.ReadString(true))); } } break; case MsexVersion.Version1_2: { Uuid = new Guid(reader.ReadString(true)); ProductName = reader.ReadString(); ProductVersionMajor = reader.ReadByte(); ProductVersionMinor = reader.ReadByte(); ProductVersionBugfix = reader.ReadByte(); byte supportedVersionsCount = reader.ReadByte(); SupportedMsexVersions = new List <MsexVersion>(supportedVersionsCount); for (int i = 0; i < supportedVersionsCount; ++i) { byte versionMajor = reader.ReadByte(); byte versionMinor = 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); } } SupportedLibraryTypes = new List <MsexLibraryType>(); var supportedLibraryTypesBits = new BitArray(reader.ReadBytes(2)); for (byte i = 0; i < supportedLibraryTypesBits.Length; ++i) { if (supportedLibraryTypesBits[i]) { SupportedLibraryTypes.Add((MsexLibraryType)i); } } int thumbnailFormatsCount = reader.ReadByte(); ThumbnailFormats = new List <MsexImageFormat>(thumbnailFormatsCount); for (int i = 0; i < thumbnailFormatsCount; ++i) { ThumbnailFormats.Add(CitpEnumHelper.GetEnumFromIdString <MsexImageFormat>(reader.ReadIdString())); } int streamFormatsCount = reader.ReadByte(); StreamFormats = new List <MsexImageFormat>(streamFormatsCount); for (int i = 0; i < streamFormatsCount; ++i) { StreamFormats.Add(CitpEnumHelper.GetEnumFromIdString <MsexImageFormat>(reader.ReadIdString())); } int dmxSourcesCount = reader.ReadByte(); LayerDmxSources = new List <CitpDmxConnectionString>(dmxSourcesCount); for (int i = 0; i < dmxSourcesCount; ++i) { LayerDmxSources.Add(CitpDmxConnectionString.Parse(reader.ReadString(true))); } } break; } }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); switch (Version) { case MsexVersion.Version1_0: { LibraryNumber = reader.ReadByte(); int effectCount = reader.ReadByte(); Effects = new List<CitpEffectInformation>(effectCount); for (int i = 0; i < effectCount; ++i) { var e = new CitpEffectInformation { ElementNumber = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString() }; int effectParameterNameCount = reader.ReadByte(); e.EffectParameterNames = new List<string>(effectParameterNameCount); for (int j = 0; j < effectParameterNameCount; ++j) e.EffectParameterNames.Add(reader.ReadString()); Effects.Add(e); } } break; case MsexVersion.Version1_1: { LibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)); int effectCount = reader.ReadByte(); Effects = new List<CitpEffectInformation>(effectCount); for (int i = 0; i < effectCount; ++i) { var e = new CitpEffectInformation { ElementNumber = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString() }; int effectParameterNameCount = reader.ReadByte(); e.EffectParameterNames = new List<string>(effectParameterNameCount); for (int j = 0; j < effectParameterNameCount; ++j) e.EffectParameterNames.Add(reader.ReadString()); Effects.Add(e); } } break; case MsexVersion.Version1_2: { LibraryId = MsexLibraryId.FromByteArray(reader.ReadBytes(4)); int effectCount = reader.ReadUInt16(); Effects = new List<CitpEffectInformation>(effectCount); for (int i = 0; i < effectCount; ++i) { var e = new CitpEffectInformation { ElementNumber = reader.ReadByte(), SerialNumber = reader.ReadUInt32(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString() }; int effectParameterNameCount = reader.ReadByte(); e.EffectParameterNames = new List<string>(effectParameterNameCount); for (int j = 0; j < effectParameterNameCount; ++j) e.EffectParameterNames.Add(reader.ReadString()); Effects.Add(e); } } break; } }
protected override void DeserializeFromStream(CitpBinaryReader reader) { base.DeserializeFromStream(reader); switch (Version) { case MsexVersion.Version1_0: { LibraryType = (MsexLibraryType)reader.ReadByte(); int libraryCount = reader.ReadByte(); Elements = new List <CitpElementLibraryInformation>(libraryCount); for (int i = 0; i < libraryCount; ++i) { Elements.Add(new CitpElementLibraryInformation { Number = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), ElementCount = reader.ReadByte() }); } } break; case MsexVersion.Version1_1: { LibraryType = (MsexLibraryType)reader.ReadByte(); int libraryCount = reader.ReadByte(); Elements = new List <CitpElementLibraryInformation>(libraryCount); for (int i = 0; i < libraryCount; ++i) { Elements.Add(new CitpElementLibraryInformation { Number = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), LibraryCount = reader.ReadByte(), ElementCount = reader.ReadByte() }); } } break; case MsexVersion.Version1_2: { LibraryType = (MsexLibraryType)reader.ReadByte(); int libraryCount = reader.ReadUInt16(); Elements = new List <CitpElementLibraryInformation>(libraryCount); for (int i = 0; i < libraryCount; ++i) { Elements.Add(new CitpElementLibraryInformation { Number = reader.ReadByte(), DmxRangeMin = reader.ReadByte(), DmxRangeMax = reader.ReadByte(), Name = reader.ReadString(), LibraryCount = reader.ReadUInt16(), ElementCount = reader.ReadUInt16() }); } } break; } }