Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Playlists
  • Assigned To No-one
  • Operating System Sansa e200
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by GRaTT - 2007-03-21
Last edited by BigBambi - 2010-06-05

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

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

Closed by  BigBambi
2010-06-05 23:07
Reason for closing:  Rejected
GRaTT commented on 2007-03-22 03:36

Fixed an off by one error in the file name extension change.

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).

GRaTT commented on 2007-03-25 21:44

First attempt to make this work for all Char sets.
Using compiler defined NULL.

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?

GRaTT commented on 2007-04-14 04:19

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

GRaTT commented on 2007-04-18 01:14

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

GRaTT commented on 2007-04-20 00:08

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

GRaTT commented on 2007-04-20 23:05

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

GRaTT commented on 2007-04-21 00:34

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

GRaTT commented on 2007-04-22 05:33

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

GRaTT commented on 2007-04-22 06:03

last small fix.
I will continue to test but I think this has it.
GRaTT

GRaTT commented on 2007-04-22 15:41

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

GRaTT commented on 2007-04-25 17:07

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

GRaTT commented on 2007-05-10 04:24

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

GRaTT commented on 2007-05-18 17:03

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

GRaTT commented on 2007-07-03 17:11

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

GRaTT commented on 2007-08-06 20:26

updated for changes to the plugins directory structure.
Use of CATAGORIES file.
GRaTT

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… :)

GRaTT commented on 2007-10-09 03:42

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

GRaTT commented on 2007-10-22 01:17

Fixed some warnings
GRaTT

GRaTT commented on 2007-10-22 01:25

Here is the full patch.
GRaTT

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?

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...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing