mirror of
https://github.com/taglib/taglib.git
synced 2026-02-10 09:20:17 -05:00
Improve Matroska API
Make AttachedFile immutable. This is consistent with SimpleTag and Chapter and avoids using attached files which do not have all required attributes. Provide methods to insert and remove a single simple tag, so that they can be modified without setting all of them while still not exposing internal lists to the API. Use DATE_RECORDED instead of DATE_RELEASED for year() and the "DATE" property. This is more consistent with other tag formats, e.g. for ID3v2 "TDRC" is used, which is the recording time.
This commit is contained in:
@ -36,12 +36,8 @@ int main(int argc, char *argv[])
|
||||
TagLib::FileStream image(argv[2]);
|
||||
auto data = image.readBlock(image.length());
|
||||
auto attachments = file.attachments(true);
|
||||
TagLib::Matroska::AttachedFile attachedFile;
|
||||
attachedFile.setFileName("cover.jpg");
|
||||
attachedFile.setMediaType("image/jpeg");
|
||||
attachedFile.setData(data);
|
||||
//attachedFile.setUID(5081000385627515072ull);
|
||||
attachments->addAttachedFile(attachedFile);
|
||||
attachments->addAttachedFile(TagLib::Matroska::AttachedFile(
|
||||
data, "cover.jpg", "image/jpeg"));
|
||||
|
||||
file.save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user