Hi Max,

mpd has support for embedded cue sheets. ;)

But there are still some issues left.
First i'd like to recommend to do something like this:

metaflac --remove-all file.flac;
metaflac --import-cuesheet-from=file.cue
--set-tag-from-file="CUESHEET=file.cue" --add-seekpoint=1s file.flac

(And check those cue sheets: i had some with incorrect index points..)

The biggest problem for now is that seeking doesn't work proper for
tracks which are shorter than 10 or 20 seconds (didn't figure out
exactly yet):
When trying to seek on such a short track mpd jumps to the next song in
the playlist queue.
Above that time frame seeking works flawlessly as far as i can see.

The other issue would be to load the tags for the single tracks from the
cuesheet comment. I'd like do it with the CUESHEET comment block which
you can get with the metaflac command i mentioned above.

But first i'll clean up the code, do something to prevent seeking below
10 to 20 seconds and send patches.

From memory i think i have modified update.c, flac_plugin.c,
_flac_common.c/.h and created input_flac.c/.h (added input_flac to
input_stream.c).

I *think* it should work with oggflac but i haven't tried.

Max Kellermann wrote:
> If you're doing FLAC cuesheets only, then you have to write the code
> in flac_plugin.c; I think you have to implement the file_decode()
> method, and expect a path in the form "foo/bar.flac/subsongnumber".
> In this method, you open the FLAC file and call flac_seek_absolute()
> to seek to the correct sub song.

That's what i did for now. Thanks for that hint. It's been the final
impulse i needed.
By the way: i'm using some new methods from libflac, should i add them
to macro list? I think it's not a bad idea in case the lib changes but
on the other hand i got quite confused by that in the beginning.

>> Another way would be to list the single tracks without the virtual
>> directory but instead with different tag structs.
> 
> I don't understand...

Forget about that as it's been a dead end anyway :)

>> This initially worked, i've been able to add several tracks but then i
>> had to realize that instead of having different tags they all had the
>> same tag struct. I guess this is due to songvec sorting by path or so
>> which leads to every file getting updated with the same tag struct.
> 
> For the sorting algorithm, see songvec_cmp() in songvec.c.  To get the
> correct sorting order, assign an incrementing TAG_ITEM_TRACK number to
> each virtual sub-song.

There is now a TAG_ITEM_TRACK to every song file and a unique filename.

>> At the moment i'm even thinking if one shouldn't rewrite the whole
>> flac plugin (which would be something i am not up to at the moment i
>> think..)
> 
> If you think this is worthwhile, you can start by implementing a new
> plugin, let's say "cueflac".  Make it refuses to decode FLAC files
> without cuesheet, so if we insert it before the old "flac" plugin in
> the plugin list, MPD will handle cue-less files with the old plugin,
> and files with CUE will be handled by your code.

Fortunately i was able to use *a lot* of existing code.

I hope i'll be able to send patches the next 2-3 days.

Greets,

Jochen

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to