playlist-gen Code
Playlist generator for Samsung MSC audio sticks
Status: Beta
Brought to you by:
cvine
playlist-gen ------------ This program is released under the GNU General Public License, version 2 of that license or, at your option, any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file COPYING distributed with this file for a copy of version 2 of the license. This program is a utility to enable a playlist to be generated for a Samsung MSC audio USB stick. It has only been tested with a YP-U6 device, but should work with any Samsung MSC sticks which accept playlists in Samsung SPL format and keep their playlist files on their filesystem in a playlist directory named "Playlists". It has only been tested on linux, but should work on any POSIX-like operating system. Note that this program does not disconnect or unmount the USB stick from the user's computer's file system when the program is closed. The user must do that herself, using the tool provided by the desktop's file manager (such as nautilus or dolphin) before the stick is physically removed from the computer. Nor does this program mount the stick when it is plugged into the computer. It is for the desktop's automounter to do that. This program requires GTK+-2 >= 2.20.0 or any version of GTK+-3, glib >= 2.16, c++-gtk-utils-2.2 >= 2.1.0, and taglib. If using gcc, it requires gcc >= 4.6.0. gtk+ and taglib are probably already provided by your distribution (confusingly, on debian/ubuntu it goes by the name of libtag1/libtag1-dev). c++-gtk-utils can be obtained from http://cxx-gtk-utils.sourceforge.net/index.html . The program (playlist-gen) should normally be started via the provided start-playlist-gen.sh script. That script should specify the mount point of the stick as an environmental variable SAMSUNG_MOUNT_POINT, as the mount point varies between distributions when sticks are automounted. You can normally find out what that is by executing 'mount' in a console after it has been plugged in for the first time ('mount' executed without any arguments will report all mount points currently mounted). Both playlist-gen and start-playlist-gen.sh are installed by 'make install'. By default, the playlist created by the program has the name 'UserPlaylist', but another name can be passed as the environmental variable SAMSUNG_CUSTOM_PLAYLIST if wanted: the name provided must be in valid UTF-8 encoding. The playlist file itself is stored in the stick's 'Playlists' directory, and the files which are added to the playlist are copied by the program from the user's computer into a special directory on the USB stick with the same name as the playlist but with the suffix 'Files', so by default this directory is named 'UserPlaylistFiles' The Samsung YP-U6 stick uses the vfat filesystem, and requires any generated playlist file to be placed in its 'Playlists' directory and to be in UTF-16 encoding (see further below), which this program does, but the names of files on the stick are in narrow encoding. The narrow encoding of filenames which the stick will use when looking for the files specified in the (UTF-16) playlist is ASCII/UTF-8 encoding, and when copying files to the stick the appropriate filename conversion is carried out. The program also maintains a trash directory in the user's home directory, comprising the name of the home directory plus the playlist name with the suffix '-PlaylistGenTrash', so by default the trash directory is ~/UserPlaylist-PlaylistGenTrash. The trash directory can be emptied by hand when wanted, or from the program itself. If, when starting up playlist-gen or after copying files to the stick, taglib comes across tags in a music file which are not in valid UTF-16 format, taglib will issue a warning to the console. These warnings are harmless and can be ignored: it usually means some tag information is missing in the music file. By way of background information for debugging purposes, the format of the required SPL file is as follows, in UTF-16 encoding: [BOM]SPL PLAYLIST VERSION 1.00 \UserPlaylistFiles\file-name.mp3 END PLAYLIST This represents a playlist (having the name of the playlist file) containing the mp3 file 'file-name.mp3' existing in the stick's 'UserPlaylistFiles' directory. The playlist file must have a prepended BOM marker, so presumably it will accept both big and little endian UTF-16, but this program has only been tested on little endian machines. Line endings are in DOS format (u"\r\n").