This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6884 - Sansa E200 m3u/m3u8 to pla playlist converter
Attached to Project:
Rockbox
Opened by Gerritt Gonzales (GRaTT) - Wednesday, 21 March 2007, 21:44 GMT+1
Opened by Gerritt Gonzales (GRaTT) - Wednesday, 21 March 2007, 21:44 GMT+1
|
DetailsThis 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
Using compiler defined NULL.
- 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?
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
// 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
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
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
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
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
I will continue to test but I think this has it.
GRaTT
Just setting the font for display now.
Proper display with rockbox default font only.
GRaTT
Finished version
Display works well with font up to 19
and I have found no more errors in the conversions.
GRaTT
It now includes songs from the SD card as well.
Small bug fix on song count.
GRaTT
I still drop out the wma files on pla->m3u8 as RB does
not support them 'yet'.
GRaTT
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
Use of CATAGORIES file.
GRaTT
* 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... :)
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
GRaTT
GRaTT