devsnd/cherrymusic — pull request #457 by sn4kebite (2014-05-21 22:39:52+00:00)
Title: Cue sheet support

Hi, these commits adds support for cue sheets. These changes are based on some changes I did last summer but didn't have time to finish.

This works by adding some intrusive changes throughout the code, especially the transcoding and playlist parts. Most importantly it passes a track parameter around to indicate which track in the cue sheet should be played. The cue sheet is then parsed and the correct track is fetched, along with the proper time offset and length. The file pointed to by the cue sheet is then decoded with ffmpeg using these time codes.

The reason I'm going with ffmpeg here is that in theory you can provide pretty much any file format with cue sheets, and while the most common is FLAC, there are also some less popular formats such as TTA and TAK which are often used (TTA is fairly common in my case). This also adds another issue, which is missing audiolength for the last track when the format is unknown to cherrymusic; the first tracks uses the start time of the next track as their end time. I guess this could be solved with some ffmpeg magic, unless it's preferable to implement this natively in TinyTag (which I've so far only had a brief look at).

As far as I can see normal playback and transcoding is not affected (works for me), and all unit tests pass (yay), so there shouldn't be any issues for regular usage. Also I'm open for suggestions for any changes or other feedback.

Thanks,
Jon