IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
One way to use multiple libraries with Foobar2000 (example with three
jazzfido
post Apr 26 2012, 09:54
Post #1





Group: Members
Posts: 5
Joined: 20-April 12
Member No.: 99006



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

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

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

CODE
; 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.
Go to the top of the page
+Quote Post
MrEnergizer
post Apr 26 2012, 11:55
Post #2





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



Wow hope this works....been after something like this for years. Thanks
Go to the top of the page
+Quote Post
Kohlrabi
post Apr 26 2012, 17:16
Post #3





Group: Super Moderator
Posts: 1059
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



Album List Viewer or Facets and $directory(x).

Nice effort, though. smile.gif

This post has been edited by Kohlrabi: Apr 26 2012, 17:19


--------------------
Ceterum censeo Masterdiskem esse delendam.
Go to the top of the page
+Quote Post
MrEnergizer
post May 1 2012, 12:10
Post #4





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



QUOTE (Kohlrabi @ Apr 26 2012, 17:16) *
Album List Viewer or Facets and $directory(x).

Nice effort, though. smile.gif


AFAIK ....those methods are just ways of viewing different libraries and are not suitable for handling different folders that may contain copies of tracks in different formats as has been much discussed on this forum. Hopefully the way above is a solution to manage multiple libraries.
I havent had chance to check it out yet but will give it a go.
Go to the top of the page
+Quote Post
Andreasvb
post May 1 2012, 13:08
Post #5





Group: Members
Posts: 1338
Joined: 6-March 04
From: Sweden
Member No.: 12509



You can replace C:\Documents and Settings\YOURNAME\Application Data\foobar2000 with %appdata%\foobar2000


--------------------
Windows 8.1u1 Pro x64 Media Center // foobar2000 1.3.3
Go to the top of the page
+Quote Post
Kohlrabi
post May 1 2012, 18:41
Post #6





Group: Super Moderator
Posts: 1059
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



QUOTE (MrEnergizer @ May 1 2012, 13:10) *
those methods are just ways of viewing different libraries and are not suitable for handling different folders that may contain copies of tracks in different formats as has been much discussed on this forum.

Handling multiple versions mainly necessitates proper metadata and use of title formatting than the use of multiple libraries, imho.


--------------------
Ceterum censeo Masterdiskem esse delendam.
Go to the top of the page
+Quote Post
MrEnergizer
post May 2 2012, 14:27
Post #7





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



QUOTE (Andreasvb @ May 1 2012, 13:08) *
You can replace C:\Documents and Settings\YOURNAME\Application Data\foobar2000 with %appdata%\foobar2000

Thanks
Go to the top of the page
+Quote Post
MrEnergizer
post May 2 2012, 14:40
Post #8





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



QUOTE (Kohlrabi @ May 1 2012, 18:41) *
QUOTE (MrEnergizer @ May 1 2012, 13:10) *
those methods are just ways of viewing different libraries and are not suitable for handling different folders that may contain copies of tracks in different formats as has been much discussed on this forum.

Handling multiple versions mainly necessitates proper metadata and use of title formatting than the use of multiple libraries, imho.


I use Album List Panel Kohlrabi....But I obviously haven't got the coding skills to accomplish this. I am able to split the folders up in views but have always found that the media is still 'physically' there so once you select a whole tree all the files appear (regardless of codec) hence creating doubles.
Sorry but I haven't got the technical knowledge or jargon to explain myself properly.
Go to the top of the page
+Quote Post
jazzfido
post May 3 2012, 09:41
Post #9





Group: Members
Posts: 5
Joined: 20-April 12
Member No.: 99006



Inspired by Andreasvb's code revelation above (thank you!) I decided to automate the procedure a bit, i.e. making the creation of three databases a lot easier.

So, an alternative way to install multiple libraries is to do the following.

1. Download multipleDBexe.zip from http://www.mediafire.com/?9pv0apdou1l5cp6

2. Unzip the files - create-databases-in-foobar.exe, foobar2000-smallDB.exe, foobar2000-mediumDB.exe and foobar2000-bigDB.exe - to your desktop (not in a folder)

3. Make sure foobar2000 is closed

4. Execute create-databases-in-foobar.exe

create-databases-in-foobar.exe does the following:

a. Moves the unzipped files foobar2000-smallDB.exe, foobar2000-mediumDB.exe and foobar2000-bigDB.exe from the desktop to %appdata%\foobar2000\ (these three .exe files are used to open foobar2000 with three different databases).

b. Creates a backup directory, %appdata%\foobar2000\backup\, and copies Core.Cfg and database.dat to this directory (just in case).

c. Creates an additional two databases in %appdata%\foobar2000\ with the names databasesmall.dat and databasemedium.dat. The existing database, database.dat, is, in effect, databasebig.dat. The two new databases are copies of database.dat.

d. Creates shortcuts for the three databases and places these shortcuts on the desktop.

5. Delete create-databases-in-foobar.exe

6. Open foobar2000 by using the foobar2000-smallDB shortcut on the desktop and go to menu/library/media library and add the correct folders for this database (and remove any that are not required). Close foobar2000.

7. Open foobar2000 by using the foobar2000-mediumDB shortcut on the desktop (if you need 3 databases) and go to menu/library/media library and add the correct folders for this database (and remove any that are not required). Close foobar2000.

Use the three shortcuts that have been created on the desktop to open foobar2000 with different database content.

If you need the AutoHotKey files, they can be downloaded from here: http://www.mediafire.com/?p8tqoqik3j87j6i
Go to the top of the page
+Quote Post
Kohlrabi
post May 3 2012, 12:46
Post #10





Group: Super Moderator
Posts: 1059
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



QUOTE (MrEnergizer @ May 2 2012, 15:40) *
Sorry but I haven't got the technical knowledge or jargon to explain myself properly.

Nothing to be sorry about, I don't have any gripes with this solution, I just wanted to mention that similar functionality can be achieved within foobar2000 itself.


--------------------
Ceterum censeo Masterdiskem esse delendam.
Go to the top of the page
+Quote Post
MrEnergizer
post May 3 2012, 15:10
Post #11





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



Thanks Jazzfido
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th September 2014 - 21:56