public void Serialize(ByteArrayBuilder cmd)
        {
            cmd.AddUInt16(TransferId);

            cmd.AddUInt16(Body.Length);
            cmd.AddByte(Body);
        }
        public void Serialize(ByteArrayBuilder cmd)
        {
            cmd.AddUInt16(Inputs.Count);
            cmd.AddUInt16(Inputs.Count); // TODO - this could be a padding which just happens to be the same most of the time

            PutValue(cmd, MasterLeftLevel);
            PutValue(cmd, MasterRightLevel);
            PutValue(cmd, MasterLeftPeak);
            PutValue(cmd, MasterRightPeak);

            PutValue(cmd, MonitorLeftLevel);
            PutValue(cmd, MonitorRightLevel);
            PutValue(cmd, MonitorLeftPeak);
            PutValue(cmd, MonitorRightPeak);

            foreach (AudioMixerLevelInput input in Inputs)
            {
                cmd.AddUInt16((uint)input.Source);
            }
            cmd.PadToNearestMultipleOf4();

            foreach (AudioMixerLevelInput input in Inputs)
            {
                PutValue(cmd, input.LeftLevel);
                PutValue(cmd, input.RightLevel);
                PutValue(cmd, input.LeftPeak);
                PutValue(cmd, input.RightPeak);
            }
        }
Beispiel #3
0
 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(Tally.Count);

            foreach (var src in Tally)
            {
                cmd.AddUInt16((int)src.Key);
                cmd.AddBoolArray(src.Value.Item1, src.Value.Item2);
            }

            cmd.PadToNearestMultipleOf4();
        }
Beispiel #5
0
        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)
 {
     foreach (uint fr in MaxFrames)
     {
         cmd.AddUInt16(fr);
     }
 }
        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)
        {
            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.AddUInt16(Tally.Count);

            foreach (Tuple <bool, bool> src in Tally)
            {
                cmd.AddBoolArray(src.Item1, src.Item2);
            }

            cmd.PadToNearestMultipleOf4();
        }
Beispiel #11
0
        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.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());
        }
Beispiel #14
0
        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();
        }
Beispiel #15
0
        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(Id);
     cmd.AddByte(0x52, 0x65, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
                 0x00, 0x10, 0xA4, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x61);
 }
Beispiel #17
0
        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();
            }
        }
Beispiel #18
0
 public void Serialize(ByteArrayBuilder cmd)
 {
     cmd.AddUInt16(Clip1MaxFrames);
     cmd.Pad(2);
 }
 public void Serialize(ByteArrayBuilder cmd)
 {
     cmd.AddUInt16(Id);
     cmd.AddByte(0x00, 0x0A);
 }