Exemple #1
0
        /// <summary>
        /// Writes the contents of this packet into a memory buffer.
        /// </summary>
        /// <param name="data">The data buffer to write the packet contents to.</param>
        public override void WriteData(DJTapBinaryWriter data)
        {
            base.WriteData(data);

            data.Write(ASCIIEncoding.ASCII.GetBytes(Brand.PadRight(8)));
            data.Write(ASCIIEncoding.ASCII.GetBytes(Model.PadRight(8)));
            data.Write(DeckId);
            data.Write((ushort)DeckState);
            data.Write(SyncMaster);
            data.Write(TrackLength);
            data.Write(LocationMarker);
            data.Write((ushort)(SpeedValue * 32767));
            data.Write(new byte[2]);
            data.Write(TCType);
            data.Write(TCState);
            data.Write(TCHours);
            data.Write(TCMinutes);
            data.Write(TCSeconds);
            data.Write(TCFrames);
            data.Write(new byte[56]);
            data.Write((uint)(BPM * 100.0));
            data.Write((ushort)(SpeedValue * 32767));
            data.Write(TrackId);
            data.Write(ASCIIEncoding.ASCII.GetBytes(TrackArtist.PadRight(64)));
            data.Write(ASCIIEncoding.ASCII.GetBytes(TrackTitle.PadRight(64)));
        }
Exemple #2
0
 /// <summary>
 /// Writes the contents of this packet into a memory buffer.
 /// </summary>
 /// <param name="data">The data buffer to write the packet contents to.</param>
 public override void WriteData(DJTapBinaryWriter data)
 {
     data.WriteToNetwork(IdentifierNumber);
     data.WriteToNetwork(FirmwareVersion);
     data.WriteToNetwork(Timer);
     data.WriteToNetwork((ushort)ContentType);
 }
Exemple #3
0
        /// <summary>
        /// Sends the specified packet using unicast to a specific DJ Tap device.
        /// </summary>
        /// <param name="packet">The packet to send on the network.</param>
        /// <param name="address">The address of the device to send the packet to.</param>
        public void Send(DJTapPacket packet, RdmEndPoint address)
        {
            MemoryStream      data   = new MemoryStream();
            DJTapBinaryWriter writer = new DJTapBinaryWriter(data);

            packet.WriteData(writer);
            SendTo(data.ToArray(), new IPEndPoint(address.IpAddress, Port));
        }
Exemple #4
0
        /// <summary>
        /// Writes the contents of this packet into a memory buffer.
        /// </summary>
        /// <param name="data">The data buffer to write the packet contents to.</param>
        public override void WriteData(DJTapBinaryWriter data)
        {
            base.WriteData(data);

            data.Write(ASCIIEncoding.ASCII.GetBytes(Brand.PadRight(8)));
            data.Write(ASCIIEncoding.ASCII.GetBytes(Model.PadRight(8)));
            data.Write((byte)0);
        }
Exemple #5
0
 /// <summary>
 /// Writes the contents of this packet into a memory buffer.
 /// </summary>
 /// <param name="data">The data buffer to write the packet contents to.</param>
 public abstract void WriteData(DJTapBinaryWriter data);