Sansa Playlist Editor
version 0.01
Copyright 2007 Assaf Gordon
About
This is a GUI program that allows creating playlist files on Sandisk's Sansa Audio Players.
License
This program is released under GPLv2
Requirements:
- modern unix OS
- perl
- GTK-PERL (The GTK interface for Perl)
- Sansa Player in "MSC" mode (i.e. USB-DISK mode)
Installation:
- To install "GTK-PERL":
- On Debian/Ubuntu, use Synaptic to install the package named "libgtk2-perl".
(or run "sudo apt-get install libgtk2-perl").
- Other distros should have a similar package as well.
- Or, Install libgtk-perl by yourself - see http://gtk2-perl.sourceforge.net/
- Download sansa-editor
- (This is just a text file, a perl script)
- Save it in an accessible folder (e.g. "/usr/local/bin" if you have enough permissions)
- make it executable (e.g. chmod a+x sansa-editor)
Using the Playlist Editor
- run the sansa-editor file (you did make it executable, right?)
If it is not executable, run perl sansa-editor on a terminal.
- The Editor only displays files that are already on the Sansa player. It does not copy files from your hard-drive to the player. So put all the desired files on the Sansa player before running the playlist editor.
- The editor tries to auto-detect the mounted Sansa player (by scanning all the mounted devices, looking for a mount point that contains "MUSIC" and "PLAYLISTS" sub-directories). So mount the Sansa player before running the playlist editor.
- When you run the editor (and after it successfully detected the Sansa Player), you will see the following window:
- [Folder Tree] - all sub-directories that exist on the Sansa player, under the "MUSIC" sub-directory.
- [File List] - files in the currently selected folder. only MP3 and OGG files are displayed.
- [Playlist content] - files on the current playlist.
- Adding files to the playlist:
- Click on the desired folder on the [Folder Tree]
- Select the desired files from the [File List]
- Click "Add Selected Files To Playlist" button
- Files will appear on the [Playlist]
- Saving a playlist:
- Click "Save" or "Save As", a [Save file dialog] will appear.
the default folder is the "PLAYLISTS" folder on the Sansa Play, so there should be no reason to manually change the folder.
- Just enter the playlist name (can contain spaces and other non-alpha-numeric characters) and click "OK".
- There's no need to add the ".pla" extension (it is added automatically).
("Save" vs. "Save As" - if you already saved the playlist onces (and therefor gave it a name), "Save" will simply update the same playlist. "Save As" will always ask for a new playlist name.)
- Opening a playlist:
- click "Open". An [open file dialog] will be shown, select the playlist to load and clock "OK".
- All files listed in the playlist are loaded in the playlist window.
- Files that actually exists, have a [Check-Mark] left of the file name.
- Files that don't exists on the Sansa Player (maybe you deleted the folder, but did not update the playlist) have [X mark] left of the file name.
That's all there is to it. should be pretty self-explanatory.
Frequantly Asked Questions
(actually, they're all made-up, never-been-asked questions):
Q. Can my Sansa be damaged in any way by using the Playlist Editor ?
A. Theoretically, yes. If there's a bug in the program, it might delete some critical files, rendering the player into a useless brick. However, the program only reads the 'MUSIC' sub-driectory, and writes unicode-text files in the 'PLAYLISTS' sub-directory of the Sansa player, So chances of 'bricking' the player are slim.
Nevertheless, Please remember that this program COMES WITH ABSOLUTLY NO
WARRANTY WHATSOEVER.
Q. What about encodings ?
A. The Sansa uses FAT32 (called 'vfat' on linux) filesystem. The editor assumes that files are stored in UTF-8 encoding on the Sansa drive.
The Playlists (*.pla) files are saved in UTF16-LE encodings.
The conversion between UTF8 and UTF16-LE is done internally with perl's beautiful encoding mechamisms.
The Editor was successfully tested with the following setup:
- Sansa e280, Firmware 1.02
- Ubuntu 6.10, locale = "en_US.utf8"
- Files (on Sansa) in English and Hebrew file names (which means UTF8 characters in file names were actually used).
- Playlists (on Sansa) in UTF16-LE encoding referenced both English and Hebrew files, and were successfully read by the Sansa player.
If your system is not UTF8, I don't know how it will handle non ASCII characters. use at your own risk.
Q. How can I hack the Editor's code ?
A. I suggest the following:
- know Perl (this is a Good Thing, regardless of the playlist editor)
- read the GTK-PERL documentation
- Install (on Debian/Ubuntu) the "libgtk2-perl-doc" package, which contains:
- PerlDoc pages for all GTK objects (e.g. run: "perldoc Gtk2::SimpleList" on a terminal).
- nice perl/gtk samples in "/usr/share/doc/libgtk2-perl-doc/examples".
- Read the sansa-editor source code. It is only ~600 lines of code, and most of it is documented.
- ask me specific questions, if you'd like (my email is shown inside the sansa-editor file).
Q. Can it run on Windows(tm) ?
A. Currently, no. But with some hacking, it should work(tm).
- Perl is of course available for windows (see http://www.activeperl.com).
- Gtk-Perl has a port that should work(tm) on Win32 (see http://gtk2-perl.sourceforge.net/win32/)
- In sansa-editor file, at least the following will have to be modified:
- all the path/folder manipulations (e.g. slashes and backslashes).
- auto detection of the sansa player drive (which is a driver letter on Windows, but a mount-point on linux)
- UTF8 encoding (as Windows uses 16bit Unicode, AFAIK)
Q. What's next ?
A. Not much, actually. many improvements can be made, but since I don't even own a Sansa, my incentive is pretty low...
(this Playlist Editor was written for someone else...)
If anybody wants to take over the project - please do so.
Critical bugs - I'll try to fix, if you send enough information.