Rockbox

Tasklist

FS#6884 - Sansa E200 m3u/m3u8 to pla playlist converter

Attached to Project: Rockbox
Opened by Gerritt Gonzales (GRaTT) - Wednesday, 21 March 2007, 20:44 GMT
Last edited by Alex Parker (BigBambi) - Saturday, 05 June 2010, 23:07 GMT
Task Type Patches
Category Playlists
Status Closed
Assigned To No-one
Operating System Sansa e200
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This is a viewer plugin (m3u2pla) to allow a user to convert
a rockbox created playlist either (name.m3u or name.m3u8) to a
(name.pla) playlist file that will play on the Sansa E200
in the Original firmware.
Buttons:
Up toggles Display ON of each entry
Down toggles Display OFF
Power is OFF

Converts a 500 song playlist very fast, (+- one second).

It is a simple program but my C is rusty.
GRaTT
This task depends upon

Closed by  Alex Parker (BigBambi)
Saturday, 05 June 2010, 23:07 GMT
Reason for closing:  Rejected
Comment by Gerritt Gonzales (GRaTT) - Thursday, 22 March 2007, 03:36 GMT
Fixed an off by one error in the file name extension change.
Comment by Ivan Z (zivan56) - Thursday, 22 March 2007, 22:04 GMT
Just an FYI, it only works on filenames using the latin UTF set. Anything more extended will not work (problem is where you write tempy).
Comment by Gerritt Gonzales (GRaTT) - Sunday, 25 March 2007, 21:44 GMT
First attempt to make this work for all Char sets.
Using compiler defined NULL.
Comment by Jonathan Gordon (jdgordon) - Sunday, 08 April 2007, 03:17 GMT
This looks OK, except:
- Way too much use of splash(), output to the display instaed (and use the multi-screen api, not rb->lcd_puts()..)
- // comments
- tabs
- all the code for the case(plug_QUIT): WTF?

edit: can you make it convert pla->m3u(8) as well?
Comment by Gerritt Gonzales (GRaTT) - Saturday, 14 April 2007, 04:19 GMT
I just looked at this and I actually uploaded the wrong file.
Thus the extra code in (QUIT) it was a joke.
I will fix comments and tabs and attempt to add in pla->m3u(8).

GRaTT
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 18 April 2007, 01:14 GMT
Fixed
// comments, tabs removed, extra code in QUIT removed.
Saved some space by removing some char buffers that were not really required
Big code changes to add in pla->m3u(8) but it does not work yet.
Just creates an empty (name.m3u) file from a (name.pla) file.
Trouble reading in the lines with null bytes in between each character.
I have only been able to read in the first char.
Also fixed for new viewer.conf
I am unsure about the multi-screen api for display output but I did
remove some spash displays.
If display is on It takes some time for long playlists.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Friday, 20 April 2007, 00:08 GMT
Playlist_Converter V1.0

This new version converts from (m3u8->pla) or (m3u->pla)
Rockbox playlist to Sansa Original Firmware playlist
and from (pla->m3u8)
Sansa OF playlist to Rockbox playlist.
I use a temp file for this instead of working with the array,
but it works well. Display is optional, default timeout it 0 seconds
so you know something is happening or 1 second if Display ON.
It is "fixed " now so it will NOT write music to a playlist
if it is on the SD Card or if it is WMA.
When SD Card and WMA are functional they will work here as well.

If you have other patches you may need to fix the SOURCES and viewers.config files.

GRaTT
Comment by Gerritt Gonzales (GRaTT) - Friday, 20 April 2007, 23:05 GMT
The last one choked on pla files (pla->m3u8) over 1024 bytes.
This fixes that, and seems to work on all pla files
tested with 422 songs.
m3u-> pla still works well.
I have been testing with normal svn build and with
patched build: album art, wheel buffer, anti audio glich,
battery optimized, and my Delete Playlist patch.

TODO
more checking for file extentions.
do away with temp file.
better display.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Saturday, 21 April 2007, 00:34 GMT
Some oddities fixed some still to overcome.
some characters left that should be removed
is "fixed"
some characters removed that should not be?
in a playlist of 426 last line missing?
Most pla->m3u8 work
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Sunday, 22 April 2007, 05:33 GMT
I think this has it all fixed :)
No missed characters and no extras.
Information display is ok.
Just need to set font to rockbox default
so display is readable, and then set
back to user font.

GRaTT
Comment by Gerritt Gonzales (GRaTT) - Sunday, 22 April 2007, 06:03 GMT
last small fix.
I will continue to test but I think this has it.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Sunday, 22 April 2007, 15:41 GMT
fixed off by one error that added more garbage in.
Just setting the font for display now.
Proper display with rockbox default font only.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 25 April 2007, 17:07 GMT
Playlist Converter 2.0
Finished version
Display works well with font up to 19
and I have found no more errors in the conversions.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Thursday, 10 May 2007, 04:24 GMT
Added support for the SD card support patch.
It now includes songs from the SD card as well.
Small bug fix on song count.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Friday, 18 May 2007, 17:03 GMT
Converts both ways m3u/8<->pla with SD card support.
I still drop out the wma files on pla->m3u8 as RB does
not support them 'yet'.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Tuesday, 03 July 2007, 17:11 GMT
updated to current SVN July 03 2007.
Included support for newly added WMA codec.
Support for added SDMMC card support with path "/<microSD1>"
Changed SOURCES file to only compile Playlist Converter for Sansa.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 20:26 GMT
updated for changes to the plugins directory structure.
Use of CATAGORIES file.
GRaTT
Comment by Magnus Holmgren (learman) - Wednesday, 26 September 2007, 20:23 GMT
I looked a bit at the code and found some issues that ought to be fixed, IMHO:

* m3u(8) -> pla only supports latin1 chars in filenames.

* When calling snprintf(), don't use the length of the arguments as the size. No point in using snprintf over sprintf then, as it won't protect from buffer overflows.

* Don't mix code and variable declarations within a block.

* Some indentation issues makes the code harder to read.

* No all-caps variable names please. Defines should typically be all caps though.

* Variable names are sometimes confusing (e.g., newparam and newparam1, size_of and size_of_file). Made me think there was a bug when there wasn't in a couple of places.

* Use memset to clear buffers. And why not use a simple "0" instead of the "(char)*tempy" stuff?

Side note: Rockbox doesn't care if a playlist uses '/' or '\' in a path.

Well, that'll do for now... :)
Comment by Gerritt Gonzales (GRaTT) - Tuesday, 09 October 2007, 03:42 GMT
m3u(8) -> pla only supports latin1 chars in filenames.
I am unsure as to why this would be, I am using the parameter name as selected,
unless it is because of the hard coded file extensions and if so I am unsure of how to fix this.
I would also expect it would then be the same for pla -> m3u(8)

* When calling snprintf(), don't use the length of the arguments as the size. No point in using snprintf over sprintf then,
as it won't protect from buffer overflows.
I think I fixed this right. I now use the max size of the buffer that is being copied to,
not size of the string being copied from.

* Don't mix code and variable declarations within a block.
I think I fixed all this.

* Some indentation issues makes the code harder to read.
I think I fixed all this.

* No all-caps variable names please. Defines should typically be all caps though.
I fixed all these.

* Variable names are sometimes confusing (e.g., newparam and newparam1, size_of and size_of_file).
Made me think there was a bug when there wasn't in a couple of places.
Changed size_of to size_of_read. newparam changes to newparam1 just increments as it changes to the next step.

* Use memset to clear buffers. And why not use a simple "0" instead of the "(char)*tempy" stuff?
memset used now with "0" to clear buffers.
"(char)*tempy" stuff still used as there were issues when I was using "0". I do not recall what they were though.
example: buff[q-a]=(char)*tempy;
A null byte is required between each character for the sansa playlists.

Side note: Rockbox doesn't care if a playlist uses '/' or '\' in a path.
The same loop counts the newlines as well, and my own quirk fora *nix slashes.

GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 22 October 2007, 01:17 GMT
Fixed some warnings
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 22 October 2007, 01:25 GMT
Here is the full patch.
GRaTT
Comment by Alfred (Xaolindragon) - Tuesday, 06 January 2009, 23:38 GMT
Wait a minute guys. I'm really new to this stuff. I was having some trouble adding/making playlists in my Sansa e250. So I searched on Google for some answers and came across this. Bad thing is, I have no idea what I'm suppose to do with the file. I'm think I should have the V3.3 not the one in the original post? Anyone mind explaining what I should do?
Comment by Justin Hannigan (Chronon) - Tuesday, 12 May 2009, 02:57 GMT
Use the most recent version of the patch and apply it to a checkout of the source trunk. You can refer to the docs index for instructions on applying patches and building Rockbox. Also, be aware that there's a good chance that the patch is out of sync after so much time.

Loading...