public FrameTextInformation(byte[] full_data) : base(full_data) { encode = FrameFuncs.getEncoding(data[0]); // Custom Text Tag if (!text_tags.Contains <String>(frame_id)) { int pos = 1; while (pos < data.Length && data[pos] != 0x00) { pos++; } description = encode.GetString(File.Subset(data, 1, pos)); pos++; if (data[pos] == 0x00) { pos++; } value = encode.GetString(File.Subset(data, pos, data.Length - pos - 1)); information = value; } else // Normal Text Tag { information = encode.GetString(File.Subset(data, 1, data.Length - 1)); } }
public FrameSynchronizedLyrics(byte[] full_data) : base(full_data) { encode = FrameFuncs.getEncoding(data[0]); language = File.Subset(data, 1, 3); time_stamp_format = data[4]; try { content_type = types[data[5]]; } catch (KeyNotFoundException) { content_type = "Unknown key"; } descriptor = encode.GetString(File.Subset(data, 6, data.Length - 6)); }
// Frame Reader private void ReadFrames(int pos) { frames = new Dictionary <string, Frame>(); while (pos < tag_buffer.Length) { // Save location of tag for writing int loc = pos; // Get Frame ID String frame_id = System.Text.Encoding.ASCII.GetString(File.Subset(tag_buffer, pos, 4)); pos += 4; // Get Frame Size byte[] size_b = File.Subset(tag_buffer, pos, 4); Array.Reverse(size_b); int size = BitConverter.ToInt32(size_b, 0) + 10; pos += 6; // Get Frame data byte[] data = File.Subset(tag_buffer, loc, size); // Add Frame Frame frame = FrameFuncs.getFrame(frame_id, data); if (frame != null) { frames.Add(frame_id, frame); } pos += size - 10; // Skip Padding while (pos < tag_buffer.Length && tag_buffer[pos] == 0x00) { pos++; } } }
public FrameComments(byte[] full_data) : base(full_data) { encode = FrameFuncs.getEncoding(data[0]); language = File.Subset(data, 1, 3); int pos = 4; while (data[pos] != 0x00) { pos++; } description = encode.GetString(File.Subset(data, 4, pos - 4)); pos++; if (data[pos] == 0x00) { pos++; } comment = encode.GetString(File.Subset(data, pos, data.Length - pos)); }
public FrameUnsynchronizedLyricsTranscription(byte[] full_data) : base(full_data) { encode = FrameFuncs.getEncoding(data[0]); language = File.Subset(data, 1, 3); int pos = 4; while (data[pos] != 0x00) { pos++; } descriptor = encode.GetString(File.Subset(data, 2, pos - 4)); pos++; if (data[pos] == 0x00) { pos++; } lyrics = encode.GetString(File.Subset(data, pos, data.Length - pos)); }