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.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.AddString(32, Name); // TODO figure out what this is. It might mean something, or nothing. By blanking out after the name seems to cause the client to lose input names on the buttons cmd.AddByte(0x28, 0x36, 0x9B, 0x60, 0x4C, 0x08, 0x11, 0x60); cmd.AddUInt8((uint)Model); cmd.AddByte(0x3D, 0xA4, 0x60); }
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 cmd.AddUInt8((uint)AvailableExternalPorts); 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.AddUInt16(Tally.Count); foreach (KeyValuePair <VideoSource, uint> t in Tally) { cmd.AddUInt16((uint)t.Key); cmd.AddUInt8(t.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((uint)(1 << (int)mode.MultiviewMode)); // TODO - should be mask cmd.AddUInt32((uint)(1 << (int)mode.SomeMode)); // TODO - should be mask } }
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.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) { switch (Action) { case MacroAction.Run: case MacroAction.Delete: cmd.AddUInt16(Index); break; default: cmd.AddUInt16(0xFFFF); break; } cmd.AddUInt8((int)Action); cmd.Pad(); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt8((int)Index); cmd.AddUInt8((int)SourceType); if (SourceType == MediaPlayerSource.Still) // TODO - verify this is correct { cmd.AddUInt8(SourceIndex); cmd.AddUInt8(0); } else { cmd.AddUInt8(0); cmd.AddUInt8(SourceIndex); } }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Modes.Count); cmd.Pad(2); foreach (Entry mode in Modes) { cmd.AddUInt8((uint)mode.Mode); cmd.Pad(5); cmd.AddUInt16(1 << (int)mode.MultiviewMode); cmd.Pad(4); } // cmd.AddByte("00-08".HexToByteArray()); // cmd.Pad(2); // cmd.AddByte("00-00-00-00-00-00-00-80-00-00-00-00".HexToByteArray()); // cmd.AddByte("01-02-00-00-00-00-00-40-00-00-00-00".HexToByteArray()); // cmd.AddByte("02-00-00-00-00-00-00-80-00-00-00-00".HexToByteArray()); // cmd.AddByte("03-EB-E2-C0-00-00-00-40-00-00-00-00".HexToByteArray()); // cmd.AddByte("04-00-00-00-00-00-00-10-00-00-00-00".HexToByteArray()); // cmd.AddByte("05-EB-E2-E0-00-00-00-20-00-00-00-00".HexToByteArray()); // cmd.AddByte("06-0F-e2-80-00-00-01-00-00-00-00-00".HexToByteArray()); // cmd.AddByte("07-FB-6B-20-00-00-00-80-00-00-00-00".HexToByteArray()); }
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 SerializeType(ByteArrayBuilder cmd) { cmd.AddUInt8((uint)Type); }
protected override void SerializeType(ByteArrayBuilder cmd) { cmd.AddBoolArray(Relative); cmd.AddUInt8((uint)Type); cmd.Pad(1); }