Skip to content
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

Merged
merged 23 commits into from Jul 16, 2014
Merged

CHAP and CTOC frames support (solves https://github.com/taglib/taglib/issues/81) #173

merged 23 commits into from Jul 16, 2014

Conversation

dckface
Copy link
Contributor

@dckface dckface commented Apr 27, 2013

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.

Lukáš Krejčí added 7 commits April 20, 2013 15:52
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.
@dckface
Copy link
Contributor Author

dckface commented May 4, 2013

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.

@lalinsky
Copy link
Member

lalinsky commented May 6, 2013

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 ID3v2::Tag::parse().

@dckface
Copy link
Contributor Author

dckface commented May 7, 2013

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.

@sbooth
Copy link
Contributor

sbooth commented Sep 29, 2013

@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.

@dckface
Copy link
Contributor Author

dckface commented Sep 29, 2013

I didn't have much time during last few months, but I'll try to find some time in following week.

Lukas Krejci added 2 commits October 13, 2013 18:27
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.
@dckface
Copy link
Contributor Author

dckface commented Oct 13, 2013

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.
However, when I tried to use TIT2 frame as CHAP frame's embedded frame, rendering function of TIT2 frame actually never appended terminating null of contained string. I wasn't sure, if this is bug or not, so i modified unit to ignore this.
And sorry about last commit (uncommenting unit test). I had to comment out testCompressedFrameWithBrokenLength, because it was causing SEGFAULT, so this commit just uncomments this unit test.
Also, I'm not sure, if my changes still apply to current taglib's master. Should I rebase?

@sbooth
Copy link
Contributor

sbooth commented Oct 15, 2013

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!

@gholzmann
Copy link

That's great, thanks a lot!

If you need some files for testing, you can use:

Or some real-world podcasts (bigger files):

supermihi and others added 3 commits April 3, 2014 21:07
Removed a wrong note from a comment in tstring.h.
Fix #162: Xiph and APE generic getters return space-concatenated values
@attilagyorffy
Copy link

Any update on this one? I'd love to be able to read and write chapter information using TagLib. Great effort, thank you!

Lukáš Krejčí added 9 commits May 18, 2014 16:11
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
@dckface
Copy link
Contributor Author

dckface commented May 18, 2014

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).

@sbooth
Copy link
Contributor

sbooth commented Jun 7, 2014

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();
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

@lalinsky
Copy link
Member

I have not done a very thorough review, but does look good to me. Thanks for working on this!

@dckface
Copy link
Contributor Author

dckface commented Jun 18, 2014

Ok, so adressed issues are fixed, except that two changes from some old commit.

@lalinsky
Copy link
Member

Thanks, I'll merge it tomorrow.

@lalinsky lalinsky merged commit a192db0 into taglib:master Jul 16, 2014
@lalinsky
Copy link
Member

Sorry this took so long. It's merged now. Thank you for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants