2009年2月13日 星期五

foobar2000-under-wine-in-ubuntu/

http://polishlinux.org/apps/multimedia/foobar2000-under-wine-in-ubuntu/
* Wujek_Bogdan has provided instructions in Polish, you can find them here.

Installation

I. Wine
- You will need a working linux box with wine. Under Ubuntu you can use the command:
QUOTE
sudo apt-get install wine
* If you intend to use multilingual support, I suggest reading this tutorial and install winelocale.
- This tutorial assumes you have a wine drive z: mapped to your filesystem root "/" directory. This is the default setup with most wine installs.
- Be sure to configure wine as a Windows XP machine, there are significant limitations when running as other OSs such as Vista or Win95. Also be sure to install windows fonts to make sure everything looks pretty. To do this withwinetricks:
QUOTE
sh winetricks winxp allfonts
- To correct audio stuttering problems during CPU spikes, set wine audio acceleration to "Emulation" instead of "Full". From the Wine Application DB entry for foobar2000:
QUOTE
The beta version of foobar2000 uses Directsound by default, which can cause some problems when playing music. In order to get the program to play music properly, you must set the Hardware Acceleration to emulate Directsound. Go to a terimal and type in "winecfg". A window will open with options for you to modify. Click on the Audio tab, and then look for "Hardware Acceleration". It is currently on "Full". Click on it, and you will have a list of options. Click on "Emulation", and then click on "Apply". foobar2000 should now be able to play music. Note that this will make foobar2000 version 0.8.3 give out an error when you try to play an audio file. Just change it back to "Full" in winecfg when you're done using foobar2000 version 0.9 beta.

II. Foobar2000
* If you have an existing copy of foobar, copy your old foobar2000 folder to ~/.foobar2000 and skip this section.

- Download the foobar installer from the main foobar homepage.
- Run the foobar installer with wine:
QUOTE
wine foobar2000_0.9.6.2.exe
- Use the "Portable installation" Type to avoid mucking about with user profiles.
- Install to the location z:\home\YOURNAME\.foobar2000\ which translates through wine as ~/.foobar2000
  • DO NOT install "Audio CD support", wine does not currently support direct access to optical drives.
III. Shell Script
- Let's build a shell script to execute foobar like a normal Linux program
QUOTE
gksudo gedit /usr/bin/foobar2000
CODE
#!/bin/sh
cd ~/.foobar2000/
if [ "$1" != "" ]; then
filename=`echo z:$1 | sed 's/\\//\\\\/g'`
wine foobar2000.exe "$filename" &
else
wine foobar2000.exe &
fi
* If you are using winelocale for CJK or other international support, replace "wine" with "wineloc -l ja_JP" or something similar for your region.

- Close gedit and save the file.
- Make the file executable with the following command:
QUOTE
sudo chmod +x /usr/bin/foobar2000



IV. Application Package
- Pick an icon for foobar, I rather like this one by Byan. Save it as /usr/share/icons/foobar2000.png
- Let's build a .desktop application package so we can launch foobar from the gnome main menu
QUOTE
gksudo gedit /usr/share/applications/foobar2000.desktop
CODE
[Desktop Entry]
Type=Application
Name=foobar2000
GenericName=Plays Music
Version=1.0
Encoding=UTF-8
Terminal=false
Exec=/usr/bin/foobar2000
Comment=Plays Music
Icon=foobar2000.png
Categories=GNOME;GTK;AudioVideo;Audio;Player;
- Close gedit and save the file.

Components
Not all components work well under wine. Components written in .NET are particularly problematic.Keyboard Shortcuts:
By default, wine should allow foobar to map multimedia keys if they are not already mapped by something else however these bindings will not be global (you cannot change songs when using a different program). To globally control foobar with your multimedia keys you may want to read through this post over on the ubuntu forums. To summarize:

- Press Alt+F2 to open a Run Configuration window.
- Enter "gconf-editor" in the box and either press or click [Run]
- This should open the Gnome Configuration Editor.
- In the left pane navigate to /apps/metacity/keybinding_commands and define the following keys:
CODE
command_1 - wine ~/.foobar2000/foobar2000.exe /playpause
command_2 - wine ~/.foobar2000/foobar2000.exe /stop
command_3 - wine ~/.foobar2000/foobar2000.exe /next
command_4 - wine ~/.foobar2000/foobar2000.exe /prev
- In the left pane navigate to /apps/metacity/global_keybindings and define the following keys:
CODE
run_command_1 - XF86AudioPause
run_command_2 - XF86AudioStop
run_command_3 - XF86AudioNext
run_command_4 - XF86AudioPrev

Announcing Now Playing Information:
Many people like to announce what they are currently playing in foobar to other programs such as IRC or an Instant Meesenger. Most of the popular solutions do not translate well outside of wine. However I discoveredfoo_np_simple which basically dumps titleformatted text into an external plain text file that can then be processed by your external program (cat ~/.foobar2000/now_playing.txt). I have considered trying to mirror a nowplaying info file from another player such as quodlibet and then create an xchat perl script to parse the information nicely but I think that goes beyond the scope of this topic.

Other Comments:
- Wine tray icons are a bit buggy with both gnome and kde, To Avoid problems you may want to prevent foobar from minimizing to it in your Columns/Panels config.
- These instructions are written for a gnome environment. For KDE users replace "gksudo" with "kdesu" and "gedit" with "kate". 

This post has been edited by Yotsuya: Feb 9 2009, 19:14


--------------------

沒有留言:

張貼留言

BloggerAds