-
Notifications
You must be signed in to change notification settings - Fork 0
/
OwnershipFrame.cs
31 lines (25 loc) · 922 Bytes
/
OwnershipFrame.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
namespace NAudio.Flac
{
public class OwnershipFrame : TextFrame
{
public string Price { get; private set; }
public string PurchaseDate { get; private set; }
public OwnershipFrame(FrameHeader header)
: base(header)
{
}
protected override void Decode(byte[] content)
{
int offset = 1;
if (content.Length < 10)
throw new ID3Exception("Invalid Contentlength");
int read;
Price = ID3Utils.ReadString(content, offset, -1, ID3Utils.Iso88591, out read);
offset += read;
PurchaseDate = ID3Utils.ReadString(content, offset, 8, ID3Utils.Iso88591);
offset += 8;
var encoding = ID3Utils.GetEncoding(content, 0, offset);
Text = ID3Utils.ReadString(content, offset, -1, encoding);
}
}
}