Randirplay 2.1 for Windows
Manual
by Martin Scarratt 30/04/2010
Randirplay for Windows 2.1 - instructions
NOTE: This program only works if you have your music files organised in such a way that each album is contained in one folder.
Randirplay creates a playlist of files from selected folders such that the order of the files within the folders is preserved but the order of the folders themselves is random. So playing the playlist will result in entire albums being played in a random order.
You must have Cygwin installed on your windows system first.
To install, double click on the win-install.bat file. You can now run Randirplay from the shortcut on the desktop (you can delete the original files).
The folders file
Before you run the program you need to set up the folders file. This file tells Randirplay which folders to include in your playlist file. To do this, double click on the shortcut ‘Randirplay - folders’. This will open a text file which contains the paths of each folder that you wish to scan. The default entry is
/cygdrive/c/users
As you will probably notice, the system uses some strange notation to describe a path. The c drive, which is usually ‘C:\’ in Windows, is now called ‘/cygdrive/c/’. This notation is the same for all drives – each always starts with ‘/cygdrive/’ and then the drive letter (in lower case). Make sure you use forward slashes rather than the usual Windows backslashes.
You can put any number of paths into this file, one per line. The program will scan these paths and their sub-folders and enter all of the music files contained within the paths into a playlist.
Excluding folders
If there is a particular folder contained within one of your paths that you don’t wish to include in your playlist, then you need to add an extra line to the folders file which consists of the path to the unwanted folder preceded with a ‘-‘ sign.
eg.
/cygdrive/c/music
-/cygdrive/c/music/single tracks
This will create a playlist of all files in “C:\music” but will not include files contained within “C:\music\single tracks”. It will still include files within the sub-folders of “C:\music\single tracks” though, so files in “C:\music\single tracks\rock” will be included.
To exclude a folder and all its sub-folders you need to precede the path with ‘-r’ (r for recursive).
eg.
/cygdrive/c/music
-r/cygdrive/c/music/single tracks
This will create a playlist of all files in “C:\music” but will not include files or folders contained within “C:\music\single tracks”. So it will not include “C:\music\single tracks\rock” or even “C:\music\single tracks\rock\whatever”.
Exclusion exceptions
You may want to exclude an entire folder but keep just one or two albums from within it. You can create exceptions to your exclusion lines by starting a new line with –e, or –er for a recursive exception.
Eg.
/cygdrive/c/music
-r/cygdrive/c/music/single tracks
-er/cygdrive/c/music/single tracks/particularfolder
-e/cygdrive/c/music/single tracks/other/folder
This example would create a playlist of all files in “C:\music” but will not include files or folders contained within “C:\music\single tracks” apart from the folder \particularfolder with its sub-folders and \other\folder\ without its sub-folders.
Permanent folders
Together with the use of some other options (see ‘Options’ below) you are able to limit the size of your playlist. If your playlist size is limited, then not all of the folders within your chosen paths will be included, but your playlist will consist of a random selection of folders from your paths.
If you want a certain album to always appear in your playlist then you must make it a permanent folder. To do this, add a line to the folders file containing the path to that album’s folder preceded with a ‘+’ sign.
eg.
/cygdrive/c/music
+/cygdrive/c/music/favourites
With a size limitation, this will create a playlist of a random selection of albums contained within “C:\music” but will always include the files contained in the folder “C:\music\favourites”. However it may not include albums contained in the sub-folders of “C:\music\favourites” (this depends on whether they are randomly chosen or not).
To make a folder and all of its sub-folders permanent you must precede your path with ‘+r’.
eg.
/cygdrive/c/music
+r/cygdrive/c/music/favourites
With a size limitation, this will create a playlist of a random selection of albums contained within “C:\music” but will always include the files and folders contained in the folder “C:\music\favourites”.
If there is no size limitation then
/cygdrive/c/music
and
/cygdrive/c/music
+r/cygdrive/c/music/favourites
and
/cygdrive/c/music
+/cygdrive/c/music/favourites
are equivalent.
The ‘+’ prefix can be useful with no size limitation. If you want to include a certain folder without its subfolders outside your specified paths, then you need the following lines in your folders file:
/cygdrive/c/music
+/cygdrive/c/documents/podcasts
If there is no size limitation and you want to include the sub-folders of “C:\documents\podcasts” though, the ‘+r’ is not needed, as
/cygdrive/c/music
+r/cygdrive/c/documents/podcasts
is equivalent to
/cygdrive/c/music
/cygdrive/c/documents/podcasts
Options
Right clicking on the Randirplay shortcut on the desktop and selecting ‘edit’ will open a file into which you can add certain options which change the contents of your playlist.
:: append options to the end of the following line.
c:\cygwin\bin\bash --login randirplay.b -c "/cygdrive/c/Program Files/Randirplay/folders.txt" -p "/cygdrive/c/Program Files/Randirplay/Playlists/playlist"
pause
explorer c:\"Program Files"\Randirplay\Playlists
As the file suggests, any options should be added to the second line of this file, separated by spaces
c:\cygwin\bin\bash --login randirplay.b -c "/cygdrive/c/Program Files/Randirplay/folders.txt" -p "/cygdrive/c/Program Files/Randirplay/Playlists/playlist"
There are seven ‘flags’ that you can use. These are -c, -s, -p, -e, -d, -q and -o. A flag followed by its argument is called an option. As you can see, there is already a -c flag present along with its argument that points to the folders file and a -p flag with its argument which tells the program where to save and what to call the final playlist file. Both of the arguments of these flags may be edited if you wish to have more than one folders file or playlist.
Please note however that the ‘Randirplay - folders’ shortcut on the desktop will only open the default folders file. To edit any other folder file you will have to create and edit it manually.
Adding options
Apart from -c and -p there are five other flags. Every flag must be preceded and followed by a space. All the flagss need an argument to follow them, apart from –o and -q.
-s needs an integer
-e needs a specially formatted string of characters
-d needs a drive letter
So after you have entered your options your 2nd line might look something like this:
c:\cygwin\bin\bash --login randirplay.b -c "/cygdrive/c/Program Files/Randirplay/folders.txt" -p "/cygdrive/c/Program Files/Randirplay/Playlists/playlist" -e “.mp3” -d f
Here are the options written separately:
-c "/cygdrive/c/Program Files/Randirplay/folders.txt"
-p "/cygdrive/c/Program Files/Randirplay/Playlists/playlist"
-e “.mp3”
-d f
What the flags do
-s and -d
-s and -d are size limiting flags. -d takes precedence over -s, so if you include both, the -s flag will be ignored.
The argument that needs to follow -s is the size in Kb that you wish the files in your playlist to be. So adding the option ‘-s 4000000’ will create a playlist which is 4000000Kb in size (about 3.8Gb).
The -d flag automatically determines the free space on whichever drive you choose and sets this number as the size of the playlist. So adding the option ‘-d f’ will create a playlist which will fit onto your f drive (you need to make sure the drive is plugged in before you create the playlist).
-q
Quick mode - quicker, but not as good a fit to requested size. only use if randirplay seems to run particularly slowly. This flag must be used in conjunction with –s or –d. If –s or –d is not also flagged then –q will be ignored.
-e
This flag allows you to state the extensions that all of the files in the playlist must have. There is a special notation that you must use for the argument that follows the switch.
i) The argument must always start and finish with double quotes
ii) Any period character must come after a backslash
iii) If you want more than one file extension they must be separated by /|
eg.
-e “/.mp3” All files ending .mp3
-e "" Everything, whether music files or not.
-e "/.mp3/|/.m4a/|/.m4b/|/.wav" All files ending .mp3, .m4a, .m4b and .wav
-e "mp3/|m4a/|m4b/|wav" All files ending mp3, m4a, m4b, and wav (no periods)
If the -e flag is not included then the included files are .mp3, .m4a, .m4b and .wav (which is perfect for iPods).
-o
This flag doesn’t take an argument and so is an option in itself. The output from this option is a playlist in linux form, ie each line will look like this
/cygdrive/c/documents/podcasts/talky.mp3
Rather than converted into windows form
C:\documents\podcasts\talky.mp3
This option is only useful if you wish to process the playlist further from within a linux environment (ie Cygwin). A playlist in this form will not work in the usual Windows environment.
Creating the M3U playlist
Once you have set up the folder file and entered your desired options it is simply a matter of double clicking on the Randirplay shortcut on the desktop. You will see a text window open which will keep you informed of the status of the running program. It will tell you the final size of your playlist and if the -d switch is used it will tell you the free space left on your chosen device. When it has finished, press any key when you are ready and a window will open that contains the generated playlist, which is located in “C:\Program Files\Randirplay\Playlists”