#22 'm3u capable' patch for audiocd.c

closed-accepted
bidd
None
5
2005-10-02
2005-10-02
No

I've only tested this with drag and drop capability,
but this patch contains code to get filenames (max len
255 chars) from lines in m3u data. I haven't actually
written anything to make sure that the file is an mp3,
because I avoiced rewriting all of that which already
exists in your audiocd_add_file(), and i just called
the function from within itself.

The additional code occurs after a 'non-audio' file has
been found. It simply checks to see if the file
extension is '.m3u', skips lines beginning with '#', '
', '\t', and then grabs the first 255 chars of each of
the remaining lines in turn. I read somewhere on the
net that 255 was the limit to the number of characters
in any linux filename (I'm not sure if this is actually
true, so i turned that magic number into a variable).

This will work for m3u files with 'relative' pathnames
as well, assuming that the base of the pathname is the
path leading to the m3u file.

I also went over your coding standards and adjusted
things as necessary, I hope that I didn't miss anything.

Regards,

Chris

Discussion

  • a replacement for 'audiocd.c' -> i would create a diff etc, but there's only one spot to upload a file here, this should work as a drop-in replacement

     
    Attachments
  • bidd
    bidd
    2005-10-02

    Logged In: YES
    user_id=1161543

    cvs GB now imports m3u. Thanks for the code.

     
  • bidd
    bidd
    2005-10-02

    • assigned_to: nobody --> bidd
    • status: open --> closed-accepted