Beispiel #1
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            NodeCount        = data.ReadNetwork16();
            NodeListenerPort = data.ReadNetwork16();
            Uptime           = TimeSpan.FromSeconds(data.ReadNetwork16());
            data.ReadBytes(2);
            VendorName    = data.ReadNetworkString(16);
            DeviceName    = data.ReadNetworkString(16);
            DeviceVersion = new Version(data.ReadByte(), data.ReadByte(), data.ReadByte());
            data.ReadBytes(1);
        }
Beispiel #2
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            int dataSize = (int)data.ReadNetwork32();

            TotalPackets    = data.ReadNetwork32();
            PacketNumber    = data.ReadNetwork32();
            DataClusterSize = data.ReadNetwork32();
            WaveformData    = data.ReadBytes(dataSize);
        }
Beispiel #3
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            data.ReadByte();
            LayerState = (DeckState)data.ReadByte();
            data.ReadByte();
            SyncMaster = data.ReadByte();
            data.ReadByte();
            BeatMarker      = data.ReadByte();
            TrackLength     = data.ReadNetwork32();
            CurrentPosition = data.ReadNetwork32();
            Speed           = Math.Round((double)data.ReadNetwork32() / 32767.0, 3);
            data.ReadBytes(13);
            BeatNumber = data.ReadNetwork32();
            data.ReadBytes(51);
            BPM            = (double)data.ReadNetwork32() / 100.0;
            SpeedPitchBend = Math.Round((double)data.ReadNetwork16() / 32767.0, 3);
            TrackId        = data.ReadNetwork32();
        }
Beispiel #4
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            Step = (Steps)data.ReadByte();
            data.ReadByte();
            int length = (int)data.ReadNetwork32();

            data.ReadBytes(12);
            TextData = data.ReadNetworkString(length);
        }
Beispiel #5
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            Layer[] layers = new Layer[] { Layer1, Layer2, Layer3, Layer4, LayerA, LayerB, LayerM, LayerC };

            //Current Time
            foreach (var layer in layers)
            {
                layer.CurrentTime = data.ReadNetworkTime();
            }

            //Total Time
            foreach (var layer in layers)
            {
                layer.TotalTime = data.ReadNetworkTime();
            }

            //Beat Marker
            foreach (var layer in layers)
            {
                layer.BeatMarker = data.ReadByte();
            }

            //Layer State
            foreach (var layer in layers)
            {
                layer.State = (DeckState)data.ReadByte();
            }

            //On Air
            foreach (var layer in layers)
            {
                layer.OnAir = data.ReadBoolean();
            }

            data.ReadBytes(42);
        }