public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16((int)Id); cmd.AddString(20, LongName); cmd.AddString(4, ShortName); cmd.AddByte(0x00); // Xa cmd.Pad(); // ?? cmd.AddByte((byte)(IsExternal ? 0x00 : 0x01)); // Xb if (ExternalPorts == null) { cmd.AddBoolArray(false); // Is an external type, so no port options } else { cmd.AddBoolArray(ExternalPorts.Contains(ExternalPortType.SDI), ExternalPorts.Contains(ExternalPortType.HDMI), ExternalPorts.Contains(ExternalPortType.Component), ExternalPorts.Contains(ExternalPortType.Composite), ExternalPorts.Contains(ExternalPortType.SVideo)); } cmd.AddByte((byte)(IsExternal ? 0x00 : 0x01)); // Xd cmd.AddUInt8((int)ExternalPortType); // Xe cmd.AddUInt8((int)InternalPortType); cmd.Pad(); //Xg ?? cmd.AddUInt8((uint)SourceAvailability); // Xh cmd.AddUInt8((uint)MeAvailability); // Xi }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddBoolArray(Unknown); cmd.AddBoolArray(Unknown2); cmd.AddByte(BytePattern.Take((int)Length)); cmd.PadToNearestMultipleOf4(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt8((int)MixEffectIndex); cmd.AddUInt8((int)KeyerIndex); cmd.AddBoolArray(false); cmd.AddBoolArray(false); cmd.Pad(); cmd.AddBoolArray(false, false, false, false); cmd.AddUInt8(0); cmd.Pad(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddBoolArray(CanRotate); cmd.AddBoolArray(CanScaleUp); cmd.AddUInt16(SupportedTransitions?.Count ?? 0); if (SupportedTransitions != null) { foreach (DVEEffect effect in SupportedTransitions) { cmd.AddUInt8((uint)effect); } } cmd.PadToNearestMultipleOf4(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Tally.Count); foreach (Tuple <bool, bool> src in Tally) { cmd.AddBoolArray(src.Item1, src.Item2); } cmd.PadToNearestMultipleOf4(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Tally.Count); foreach (var src in Tally) { cmd.AddUInt16((int)src.Key); cmd.AddBoolArray(src.Value.Item1, src.Value.Item2); } cmd.PadToNearestMultipleOf4(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Inputs.Count); foreach (KeyValuePair<AudioSource, bool> src in Inputs) { cmd.AddUInt16((int) src.Key); cmd.AddBoolArray(src.Value); } cmd.PadToNearestMultipleOf4(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Tally.Count); cmd.Pad(6); foreach (KeyValuePair <Tuple <AudioSource, long>, bool> v in Tally) { cmd.AddInt64(v.Key.Item2); cmd.AddUInt16((uint)v.Key.Item1); cmd.AddBoolArray(v.Value); } cmd.PadToNearestMultipleOf4(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Modes.Count); cmd.Pad(2); foreach (Entry mode in Modes) { cmd.AddUInt8((uint)mode.Mode); cmd.Pad(3); cmd.AddUInt32(ModesToUInt(mode.MultiviewModes)); cmd.AddUInt32(ModesToUInt(mode.DownConvertModes)); cmd.AddBoolArray(mode.RequiresReconfig); } }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt8((uint)Input); cmd.AddUInt8(Category); cmd.AddUInt8(Parameter); SerializeType(cmd); switch (Type) { case CameraControlDataType.Bool: { bool[] data = BoolData ?? Array.Empty <bool>(); cmd.AddUInt16(data.Length); cmd.Pad(6); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); foreach (bool val in data) { cmd.AddBoolArray(val); } cmd.PadToNearestMultipleOf8(); break; } case CameraControlDataType.SInt8: { int[] data = IntData ?? Array.Empty <int>(); cmd.AddUInt16(data.Length); cmd.Pad(6); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); foreach (int val in data) { cmd.AddInt8(val); } cmd.PadToNearestMultipleOf8(); break; } case CameraControlDataType.SInt16: { int[] data = IntData ?? Array.Empty <int>(); cmd.Pad(2); cmd.AddUInt16(data.Length); cmd.Pad(4); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); foreach (int val in data) { cmd.AddInt16(val); } cmd.PadToNearestMultipleOf8(); break; } case CameraControlDataType.SInt32: { int[] data = IntData ?? Array.Empty <int>(); cmd.Pad(4); cmd.AddUInt16(data.Length); cmd.Pad(2); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); foreach (int val in data) { cmd.AddInt32(val); } cmd.PadToNearestMultipleOf8(); break; } case CameraControlDataType.SInt64: { long[] data = LongData ?? Array.Empty <long>(); cmd.Pad(6); cmd.AddUInt16(data.Length); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); foreach (long val in data) { cmd.AddInt64(val); } cmd.PadToNearestMultipleOf8(); break; } case CameraControlDataType.String: { string str = StringData ?? string.Empty; cmd.AddUInt16(str.Length); cmd.Pad(6); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); cmd.AddString(str); cmd.PadToNearestMultipleOf8(); break; } case CameraControlDataType.Float: { double[] data = FloatData ?? Array.Empty <double>(); cmd.Pad(2); cmd.AddUInt16(data.Length); cmd.Pad(4); SerializePostLength(cmd); cmd.PadToNearestMultipleOf8(); foreach (double val in data) { cmd.AddInt16(0x7ff, val); // TODO } cmd.PadToNearestMultipleOf8(); break; } default: throw new ArgumentOutOfRangeException(); } }
protected override void SerializePostLength(ByteArrayBuilder cmd) { cmd.AddBoolArray(PeriodicFlushEnabled); }
protected override void SerializeType(ByteArrayBuilder cmd) { cmd.AddBoolArray(Relative); cmd.AddUInt8((uint)Type); cmd.Pad(1); }