/// <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(DJTapBinaryReader data) { base.ReadData(data); Brand = ASCIIEncoding.ASCII.GetString(data.ReadBytes(8)); Model = ASCIIEncoding.ASCII.GetString(data.ReadBytes(8)); DeckId = data.ReadNetwork16(); DeckState = (DeckState)data.ReadNetwork16(); SyncMaster = data.ReadNetwork16(); BeatMarker = data.ReadNetwork16(); TrackLength = data.ReadUInt32(); LocationMarker = data.ReadUInt32(); SpeedValue = Math.Round((double)data.ReadUInt16() / 32767.0, 3); data.ReadBytes(2); TCType = data.ReadNetwork16(); TCState = data.ReadNetwork16(); TCHours = data.ReadNetwork16(); TCMinutes = data.ReadNetwork16(); TCSeconds = data.ReadNetwork16(); TCFrames = data.ReadNetwork16(); data.ReadBytes(56); BPM = (double)data.ReadUInt32() / 100.0; SpeedPitchBend = Math.Round((double)data.ReadUInt16() / 32767.0, 3); TrackId = data.ReadNetwork16(); TrackArtist = ASCIIEncoding.ASCII.GetString(data.ReadBytes(256)).TrimEnd('\0'); TrackTitle = ASCIIEncoding.ASCII.GetString(data.ReadBytes(256)).TrimEnd('\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(DJTapBinaryReader data) { base.ReadData(data); Brand = ASCIIEncoding.ASCII.GetString(data.ReadBytes(8)); Model = ASCIIEncoding.ASCII.GetString(data.ReadBytes(8)); }
/// <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(DJTapBinaryReader data) { IdentifierNumber = data.ReadUInt16(); FirmwareVersion = data.ReadUInt16(); Timer = data.ReadUInt16(); ContentType = (MessageTypes)data.ReadUInt16(); }
/// <summary> /// Gets a data reader for the data inside this buffer. /// </summary> /// <returns>A reader for the recieved data.</returns> public DJTapBinaryReader GetReader() { if (reader == null) { reader = new DJTapBinaryReader(this); } Seek(ReadPosition, SeekOrigin.Begin); return(reader); }
/// <summary> /// Reads the data from a memory buffer into this packet object. /// </summary> /// <remarks> /// Decodes the raw data into usable information. /// </remarks> /// <param name="data">The data to be read.</param> public abstract void ReadData(DJTapBinaryReader data);