How to set up a now playing "script" in foobar2000 v0.9.5.1+

Apr 30, 2008 13:52

UPDATED FOR THE NEW MILLENNIUM!!

A while ago I made a small tutorial for making a now playing script for foobar2000 to use on IRC or wherever you want. Unfortunately, foobar2000 has undergone some changes since then, so here's an updated tutorial for foobar2000 v0.9.5.1+.

Note: This makes use of features that are clearly marked as "legacy" in the latest versions of foobar2000, so it might break sometime in the future. At that point I'll try to update this again. Nevertheless I think this is a vastly superior solution compared to using some sort of COM messaging or whatever to communicate between a media player and an IRC client.

OK STEP 1: Find the Preferences window. Easy.



STEP 2: Create your now-playing script.



First scroll to the bottom and click "Advanced" on the left, then head over to the right pane, and select Display -> Legacy Title Formatting Strings -> Copy Command. There's probably something already there. Unfortunately we cannot type line breaks in this box anymore since foobar2000 v0.9.5.1, so just delete whatever is there. Then replace it with whatever text you want your now playing script to use. You can see that that's exactly what I did in the screenshot above. My full now-playing text is the following, if you're too lazy to make your own and just want to copy it:

/me np: [%list_index%. ][%artist% - ]%title% '['%playback_time%/%length%']'[ .:. ['#'%tracknumber%[/%totaltracks%], ][%album%[ '['disc %discnumber%']']]][ .:. %bitrate% Kb/s][ .:. %codec%][ .:. %samplerate% Hz[ %channels%]]

If you want to make your own, here's some tips: enclosing something in brackets, [], will make it resolve as nothing if anything inside produces an error or doesn't exist. Notice how I used that in my string. Where you place spaces is important too - you can make them disappear or reappear based on what information the currently playing song has, etc. The actual variable names are pretty easy to guess. Figure it out :) If you need help, you can always refer to these two pages about "title formatting strings", as they're called: (intro | reference).

STEP 3: Set a hotkey.



First click on "General -> Keyboard Shortcuts" on the left in the Preferences window, and then click "Add New" underneath the "Assigned Shortcuts" listbox. Type "copy name(s)" in the "Filter List By:" just to make it easier to find, and then click "[context / now playing] -> Copy Name(s)" as shown. Then underneath that, click in the text box and hit some obscure hotkey that no other sane program would ever need (I chose shift+ctrl+alt+win+z - on QWERTY those or all right next to each other so you can just mash it or something lol - though I use Dvorak). Make sure to check the "Global" checkbox.

Then click "Save All", then "Close". You're done - now you can hit your hotkey, followed by ctrl+v, in any program whatsoever, and get a nice now playing string. I mostly use it on IRC but it works on other IM clients as well, or even in email if you're feeling particularly retarded. :P The only drawback is that it replaces whatever was on your clipboard, but I find that it doesn't bother me that much. And now there's no need to use horrible garbage like AMIP, which is overly complicated and actually reads tag info from the file itself, instead of just reading it from the player, in many cases, or so I'm led to believe. Ugh. Luckily foobar2000 provides a convenient mechanism to export info about the currently playing song :) Enjoy...

-fs

tutorial, out, foobar2000

Previous post Next post
Up