*небольшой рефакторинг

*добавлен метод encode_size для Frame
This commit is contained in:
K1ndWha1e committed 2026-07-12 00:26:27 +03:00
1 parent 81034325a1
commit 18ac12f3b5
6 files changed
+55 -60

No files matched your search

+13 -3
View File
@@ -8,12 +8,13 @@ pub struct Frame {
size u64
start u64
end u64
apic ?[]u8
coded_size ?[]u64
addition []u8
encoding string
text string
name string
addition []u8
encoded [4]u8
apic ?[]u8
coded_size ?[]u64
}
// Во врейме первый байт указывает кодировку 0 - ISO-8859-1 (Latin-1), 1 - UTF-16LE
@@ -70,3 +71,12 @@ pub fn (mut frame Frame) encode_size(idv3_version u8) []u64 {
frame.size & stride[3]
]
}
@[inline]
pub fn encode_size(mut frame Frame) {
frame.encoded[3] = u8(frame.size & 0x7F)
frame.encoded[2] = u8((frame.size >> 7) & 0x7F)
frame.encoded[1] = u8((frame.size >> 14) & 0x7F)
frame.encoded[0] = u8((frame.size >> 21) & 0x7F)
}