One way to use multiple libraries with Foobar2000 (example with three libraries).
Foobar2000 doesn't support multiple libraries natively. However, many users may have separate music collections that they want to access independently. This hack provides a relatively easy and unintrusive way of adding a multiple library functionality.
One way of using multiple libraries is to have mulitiple (portable) installations of Foobar2000. The advantage of the method below is that settings, components, layout etc. are maintained in all libraries, which they aren't in the multiple installation approach.
Requirements:
The installation of the software AutoHotKey.
A working Foobar2000 installation (the procedure described below works with version 1.1.11. It should work with previous versions aswell).
Windows XP (the procedure described below works with other versions of Windows, but the file paths will be different).
The Foobar2000 settings are located in the Application Data folder.
Procedure:
1 Install AutoHotKey, which can be downloaded from here: http://www.autohotkey.com/
2 Backup the two files that are being used in this procedure. Open your file manager of choice, e.g. Windows Explorer, and go to
C:\Documents and Settings\YOURNAME\Application Data\foobar2000\ and create a folder called “backup”.
and go to
C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\ and copy the file “Core.cfg” to C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\.
and go to
C:\Documents and Settings\YOURNAME\Application Data\foobar2000\ and copy the file “database.dat” to C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\.
3 The creation of multiple libraries involves only the two files mentioned above: Core.cfg and database.dat. Now that you have a backup of these, it is time to create two more databases. The three databases will, in the following, be referred to with the names “small”, “medium” and “big”. In my setup, the big database contains the music that is on my server, the medium database contains the music that is on my computer, and the small database contains the music on my computer that has just arrived and is awaiting editing, tagging etc.
In C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\, rename Core.cfg to Coremedium.cfg and database.dat to databasemedium.dat and copy these files to their respective original directories as mentioned above under point 2.
In C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\, Rename Coremedium.cfg to Corebig.cfg and databasemedium.dat to databasebig.dat and copy these files to their respective original directories as mentioned above under point 2.
In C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\, Rename Corebig.cfg to Core.cfg and databasebig.dat to database.dat.
In the configuration directory mentioned under 2, you should now have three core files with the names Core.cfg, Coremedium.cfg and Corebig.cfg.
In the database directory mentioned under 2, you should now have three database files with the names database.dat, databasemedium.dat and databasebig.dat.
This means that we now have three databases, albeit with the same content, in place.
4 The next step involves the creation of a script to be executed by AutoHotKey.
Open Notepad or your preferred text editor. Copy the following lines into a new document (change YOURNAME to whatever is the correct path in your computer).
; THIS ACTIVATES THE DATABASE NAMED SMALL
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Coremedium.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Corebig.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Coresmall.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasemedium.dat
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasebig.dat
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasesmall.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat
Run C:\Program Files\foobar2000\foobar2000.exe
Save the document to C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\ with any name, e.g. “foobar2000-smallDB”, but with the extension .ahk (the AutoHotKey extension) instead of .txt.
Open Notepad or your preferred text editor. Copy the following lines into a new document (change YOURNAME to whatever is the correct path in your computer).
; THIS ACTIVATES THE DATABASE NAMED MEDIUM
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Coresmall.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Corebig.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Coremedium.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasesmall.dat
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasebig.dat
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasemedium.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat
Run C:\Program Files\foobar2000\foobar2000.exe
Save the document to C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\ with any name, e.g. “foobar2000-mediumDB”, but with the extension .ahk (the AutoHotKey extension) instead of .txt.
Open Notepad or your preferred text editor. Copy the following lines into a new document (change YOURNAME to whatever is the correct path in your computer).
; THIS ACTIVATES THE DATABASE NAMED BIG
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Coresmall.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Coremedium.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Corebig.cfg, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\configuration\Core.cfg
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasesmall.dat
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasemedium.dat
FileMove, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\databasebig.dat, C:\Documents and Settings\YOURNAME\Application Data\foobar2000\database.dat
Run C:\Program Files\foobar2000\foobar2000.exe
Save the document to C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\ with any name, e.g. “foobar2000-bigDB”, but with the extension .ahk (the AutoHotKey extension) instead of .txt.
5 These three files will, when executed, open the three different database files. The FileMove function in the script basically renames the Core.cfg and database.dat files according to which database you want to open. Open Foobar2000 by executing an ahk.fil, go to menu/file/preferences/Media Library and enter the correct path for the specific library.
6 To make this slightly neater, it is possible to compile the scripts into .exe files which, among other things, has the advantage that a foobar2000 icon can be used and that you are not dependent on AutoHotKey remaining installed on the computer. To do this you need to access the AutoHotKey folder from Start/All Programs. Click “convert .ahk to .exe”. In the source field, load one of the .ahk file that were created under point 4. In the destination field, choose the folder C:\Documents and Settings\YOURNAME\Application Data\foobar2000\backup\. In the custom icon field you can, for instance, choose an icon from C:\Program Files\foobar2000\icons. Click “convert”. Repeat for the remaining ahk files created under point five. You may have to rename the resulting files to add the .exe extension to the file name. Make shortcuts for these .exe files, and place them on your desktop or whereever you keep your icons.
7 If you only need two libraries I suggest you follow the procedure above, but only make two shortcuts. This will mean that a future installation of a third library will be very easy because it is already there. Using the standard foobar2000 shortcut will open the database with the latest used library.