New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHAP and CTOC frames support (solves https://github.com/taglib/taglib/issues/81) #173
Conversation
Fixed minor bugs in ChapterFrame and TableOfContentsFrame headers.
…rame and TableOfContentsFrame classes. Methods setElementID of ChapterFrame and TableOfContentsFrame classes now automatically terminates new element ID with null.
Fixed errors in ChapterFrame method renderFields. Fixed errors in TableOfContentsFrame method parseFields. Added ChapterFrame and TableOfContentsFrame headers and sources to CMakeLists.txt. Added some basic testing of CHAP and CTOC frames parsing.
I removed duplicated function for CHAP frame parsing test (I just noticed it). Other parts of code should be ok, so I hope this will be useful somehow. And if I shouldn't ignore optional embedded frames in CHAP and CTOC frames, just let me know and I will change it. |
I'll try to review this later this week. It would be great to get the embedded frames in as well. I'm not familiar withe CHAP frame specification, but I think it would work similarly to the loop when reading the main ID3v2 frames in |
Ok, I'll do it later today. I think the best approach is to read embedded frames as you say and store them in frame list, because CHAP and CTOC frames specification doesn't say anything about which types of frames can be embedded in CHAP and CTOC frames. |
@krejclu6 is there any chance you have time to take a look at implementing embedded frames? Its been a few months and I'd like to merge this pull request. |
I didn't have much time during last few months, but I'll try to find some time in following week. |
Added embedded frames parsing. Added embedded frames rendering. Modified constructor of CHAP and CTOC frame, so it can accept list of embedded frames. Added unit tests for CHAP and CTOC frames parsing and rendering (with support of embedded frames). Fixed bugs in rendering of CTOC frames. Added functions for adding and removing child elements in CTOC frames.
I was finally able to find some time to complete embedded frames support (including modification of existing chapter and table of contents frames unit tests). It should work as expected. |
If you're able to rebase to get your changes to apply cleanly it would make things much easier. Thank you for taking the time to write this code! |
That's great, thanks a lot! If you need some files for testing, you can use:
Or some real-world podcasts (bigger files): |
Removed a wrong note from a comment in tstring.h.
Fix #162: Xiph and APE generic getters return space-concatenated values
Any update on this one? I'd love to be able to read and write chapter information using TagLib. Great effort, thank you! |
Fixed minor bugs in ChapterFrame and TableOfContentsFrame headers.
…rame and TableOfContentsFrame classes. Methods setElementID of ChapterFrame and TableOfContentsFrame classes now automatically terminates new element ID with null.
Fixed errors in ChapterFrame method renderFields. Fixed errors in TableOfContentsFrame method parseFields. Added ChapterFrame and TableOfContentsFrame headers and sources to CMakeLists.txt. Added some basic testing of CHAP and CTOC frames parsing.
Added embedded frames parsing. Added embedded frames rendering. Modified constructor of CHAP and CTOC frame, so it can accept list of embedded frames. Added unit tests for CHAP and CTOC frames parsing and rendering (with support of embedded frames). Fixed bugs in rendering of CTOC frames. Added functions for adding and removing child elements in CTOC frames.
…into krejclu6_chapters Conflicts: taglib/mpeg/id3v2/id3v2framefactory.cpp tests/test_id3v2.cpp
After several months, I was finally able to find some free time to do the rebase. Howere, I'm not sure, if i did it the right way, so let me know, if there is anything I could fix (maybe squashing the commits or so). |
This looks good to me. @lalinsky what do you think? |
@@ -89,35 +89,35 @@ String APE::Tag::title() const | |||
{ | |||
if(d->itemListMap["TITLE"].isEmpty()) | |||
return String::null; | |||
return d->itemListMap["TITLE"].toString(); | |||
return d->itemListMap["TITLE"].values().toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you can probably ignore this and the other comment. I see it was from a commit that was merged to master, but I'm not sure why it's showing up as a change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it appeared in changes after I merged current master with my fork's master.
I have not done a very thorough review, but does look good to me. Thanks for working on this! |
Ok, so adressed issues are fixed, except that two changes from some old commit. |
Thanks, I'll merge it tomorrow. |
Sorry this took so long. It's merged now. Thank you for the patch! |
I've added support for ID3v2 CHAP and CTOC frames (according to http://id3.org/id3v2-chapters-1.0).
Every field is supported, except optional embedded frames, which are currently ignored, because I wasn't sure, how to handle them properly. If I shouldn't ignore them, just let me know and I will change it.
Also, I added some basic tests of CHAP and CTOC frames parsing.