Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Running Foobar in Linux (Read 655920 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Running Foobar in Linux

Reply #225
Hi all and thanks for this thread.
I made a little script to add files/folders in foobar from the Nautilus context menu. You should install the Nautilus-actions extension to add customized entries to the context menu.
I'm sure it's not perfect but it works on my linux (ubuntu) perhaps on yours too 

Code: [Select]
#!/bin/bash
#foobar2000.sh

# your installation directory
cd ~/.foobar2000/

if [ "$1" != "" ]; then
i="$@"
else
echo "No files"
exit 0
fi

#files
#add extensions if you want
for ext in .aac .mp3 .mp4 .ogg .flac .m4a .wma .mpc .wav .rar .zip; do
files=`echo $i | sed "s/$ext /$ext\" \"z:/g"`
i=$files
done

#folder
files=`echo \"z:$i | sed "s/ \//\" \"z:\//g"`

eval wine foobar2000.exe /add "$files\""

echo "Action: adding Directory or Files \"z:${files}\" to foobar2000"

exit 0


Save this script in where you want with the name: foobar2000.sh. and make it executable.

After, create a context menu item using the Nautilus Actions Configuration tool. Click on Add in the Nautilus Action configuration window, and in the Add a New Action dialog box, fill in the field like this:

Label: Send to foobar2000 (or what you want)
Tooltip: Send to foobar2000 (or what you want)
Path: /your/directory/foobar2000.sh
Parameters: %M

Next, click on the Conditions tab.:
Filenames: *
Mimetypes: */*
Check "both"
and check "appears if selection has multiple files or folders"

After, click on the Advanced conditions:
Check "smb (windwos file)"

Finally, click OK and close the Nautilus Actions Configuration tool. Now, when you right-click on a file or folder, you'll see the "Send to foobar2000, and clicking on it will add file and/or folder to foobar2000.

Running Foobar in Linux

Reply #226
I made a little script to add files/folders in foobar from the Nautilus context menu.


It's GREAT! And it works like a charm. You solved a big problem with fb2k on linux, so our music player it's REALLY usable. Many thanks.

Running Foobar in Linux

Reply #227
Okay, this is how I do it... shouldn't need any additional scripts, it passes on as many options as you'd like. So "foobar2000 -add file1 file2 directory3 -hide" acts just like "foobar2000.exe /add file1 file2 directory3 /hide" would.

Code: [Select]
#!/bin/bash
# launches fb2k w/ options

# set path to foobar executable
FB2K="C:\Program Files\foobar2000\foobar2000.exe"
# set Internal Field Separator : character should not appear in filepaths uris or options
IFS='|'

# gives the absolute z: path usable by wine
winepath () {
case "$1" in
/*) # absolute path
file="$1"
;;
~*) # unexpanded home-relative (?)
file="$HOME${1:1}"
# HOME + ~/path, stripping ~
;;
*) # relative path
file="$(pwd)/$1"
;;
esac
file=`echo "z:$file" | sed  -e '
s%/[^/]\+/\.\./%/%g # replaces /somedir/../ by /
s%\./%%g # removes ./
s%/%\\\\%g # replace / by \
'`
}

# list of arguments separated by IFS instead of space to prevent string splitting
args=""

# go through all parameters given to script and transform them for wine use if needed
until [ -z "$1" ] ; do
case "$1" in

-h|-help)
echo "Usage : `basename $0` [options] [file1 [file2 [...]]]"
echo "Available switches: -add, -play, -pause, -playpause, -prev, -next, -rand, -stop, -exit, -show, -hide, -config -command:<menu command>, -playlist_command:<context menu command>, -playing_command:<context menu command>, -help."
exit
;;

# add custom options here. Example :
# -rescan)
# args="$args$IFS/command:\"Rescan Media Library\""
# ;;

-*) # options, replacing first character
args="$args$IFS/${1:1}"
;;
# /[^/]+) args="$args$IFS$1" # alternative version, windows syntax

*) # anything else ? could be file path. Or an url... or some other kind of ufo
if [ -e "$1" ] ; then # if it's a file or a directory, translate it for wine
winepath "$1"
args="$args$IFS$file"
else # otherwise keep it as is
args="$args$IFS$1"
fi
;;
esac
shift
done

# replace positional parameters with arguments (starts out with a separator)
set ${args:1}

/usr/bin/wine "$FB2K" "$@" &
exit

Inspired by plukin's script.
You can add as many custom options as you want, see comment inside second "case" block.

Edit : minor readability change.

Running Foobar in Linux

Reply #228
There have been many changes to both wine and foobar since I started this thread. I have updated the main tutorial to reflect recent changes to the foobar installation procedure and also have begun to use winetricks for component dependencies. I am now able to load .NET components and have updated the information for the components listed (I can now load queue manager and egoh spectrum analyser). If there are additional popular compnents that require special dependencies please post, I do not habitually test every component ever made and have settled into a somewhat simple layout for my own configuration.

Running Foobar in Linux

Reply #229
Does anyone know if it's possible to make the converter use the linux encoder?
For instance, by launching flac.exe, it is actually launching /usr/bin/flac?
This would probably speed things up a bit.

Running Foobar in Linux

Reply #230
Laemtao: The Wine FAQ (Sections 7.3 - 7.4) indicate that this may be possible if you use the full path to the executable or call it with a script.

Running Foobar in Linux

Reply #231
kinda funny how all this fuss about changing a unix path into a wine path is totally useless since there is a "winepath" utility. Didin't notice myself before today.
A complete & simpler version of the script to launch foobar with command line arguments would be :

Code: [Select]
#!/bin/bash
# launches fb2k w/ options

# set path to foobar executable
FB2K="C:\Program Files\foobar2000\foobar2000.exe"
# set Internal Field Separator : character should not appear in filepaths uris or options
IFS='|'


# list of arguments separated by IFS instead of space to prevent string splitting
args=""

# go through all parameters given to script and transform them for wine use if needed
until [ -z "$1" ] ; do
    case "$1" in

        -h|-help)
            echo "Usage : `basename $0` [options] [file1 [file2 [...]]]"
            echo "Available switches: -add, -play, -pause, -playpause, -prev, -next, -rand, -stop, -exit, -show, -hide, -config -command:<menu command>, -playlist_command:<context menu command>, -playing_command:<context menu command>, -help."
            exit
        ;;

#      add custom options here. Example :
#      -rescan)
#          args="$args$IFS/command:\"Rescan Media Library\""
#      ;;

        -*) # options, replacing first character
            args="$args$IFS/${1:1}"
        ;;
#      /[^/]+) args="$args$IFS$1" # alternative version, windows syntax

        *) # anything else ? could be file path. Or an url... or some other kind of ufo
            if [ -e "$1" ] ; then # if it's a file or a directory, translate it for wine
                args="$args$IFS`winepath -w "$1"`"
            else # otherwise keep it as is
                args="$args$IFS$1"
            fi
        ;;
    esac
    shift
done

# replace positional parameters with arguments (starts out with a separator)
set ${args:1}

/usr/bin/wine "$FB2K" "$@" &
exit

Running Foobar in Linux

Reply #232
So I've been messing with the Dockable Panels extension to get something like this:


What I'd like to be able to do is minimize the main foobar window without minimizing the docked panels.  This is an option in the menu, but it doesn't seem to work when run with wine.

I've tried all sorts of tricks with compiz, but I get the feeling this isn't possible.

Running Foobar in Linux

Reply #233
Thanks for the great howto.

Foobar works surprisingly well.. But could really do with having hotkey support. I'm thinking of adapting something like this - http://www.dual-boxing.com/forums/index.ph...;threadID=12691 - to work with foobar (perhaps that page is completely irrelevant, or maybe not - it's late and I barely glanced at it, but it looks promising)

Running Foobar in Linux

Reply #234
Foobar supports global hotkeys but wine does not. I have bound my keyboard media keys to foobar as described in the tutorial and can easily change tracks while in other programs. You should be able to bind almost any keyboard combination in gnome and use that to initiate command line control of foobar. Is there particular functionality you are having trouble implementing?

From what I could tell that site is for people cheating at games by playing multiple characters simultaneously? I don't see the relevance, am I missing something?

Running Foobar in Linux

Reply #235
can easily change tracks while in other programs.


Works indeed, but is a bit slow...
And the relevance is those guys are using several workarounds to have global hotkeys working in wine (to be able to play multiple characters in a game, but that's not the point ).

Running Foobar in Linux

Reply #236
Ah, didn't see that part of the tutorial, thanks!

Got it working for play/pause and previous track, but something's weird about my key configuration.. If anyone out there is familiar with xfce and keymapping/hotkeys, please take a look at http://ubuntuforums.org/showthread.php?t=1082881

thanks!

Running Foobar in Linux

Reply #237
Well, thanks for all the work you people did to give us (me) a better foobar wine experience. Running now w/o problems.

Running Foobar in Linux

Reply #238
I don't know if it's been mentioned in this thread already, but there is an alternative way to get multimedia keys to work globally with foobar (and it also works with KDE).
I found it here so kudos to them.
Code: [Select]
sudo apt-get install xbindkeys xbindkeys-config
xbindkeys --default > ~/.xbindkeysrc
xbindkeys-config

The xbindkeys-config utility is pretty ugly, but it works in a very straightforward manner.

Running Foobar in Linux

Reply #239
Nevermind, I had old wine.

I have a problem with foobar (9.6.5) in Ubuntu (9.04). The audio stutters if I the audio isn't playing for some time. This happens when I shut down the program when I go to sleep, keep the computer on for night, and start listening to music in the morning. Same thing happens if I leave foobar on pause. I have to log out to fix the problem. I've tried changing the Audio Hardware Acceleration from winecfg to Emulation or Full, but with no luck. Any ideas? No problems with other programs.

Running Foobar in Linux

Reply #240
I have problems with displaying the album art using DUI. Looks all kinda messed up, pixelated and wrong colors.

EDIT: Nevermind solved it by installing correct GDI+ dlls.

Running Foobar in Linux

Reply #241
A call for help: is there anybody that succeeded to use Milkdrop under Wine with foo_vis_shpeck? With NVidia specifically? If yes, please, PM me

Running Foobar in Linux

Reply #242
I am currently using Milkdrop under Wine 1.1.21 with foo_vis_shpeck v0.3.4 with nVidia 180.44 under Ubuntu 9.04 and Foobar v0.9.6.5.

Can you elaborate what sort of problems your are experiencing?

Running Foobar in Linux

Reply #243
Hello, Yotsuya.
I use Milkdrop 2.1(the same with 2.0e), Wine 1.1.21, foo_vis_shpeck 0.3.5 (the same with 0.3.4), nVidia 180.44 (the same with 173...), Foobar 0.9.6.7(the same with .6.5) under Debian Testing/ Unstable 64bit.
While AVS works really well, when I start Milkdrop in windowed mode, its window becames shifted all of a sudden from the borders of a panel and Foobar hangs completely, forcing me to kill it.



I really have no idea what does this means. Please help me. Thanks

Running Foobar in Linux

Reply #244
I also experience strange behavior from Milkdrop2 when I first initialize the speck panel, the effect is shifted and distorted and I do not experience this with any other plugin such as AVS.  However the panel doesnt freeze on me and if I resize the panel (I have an auto-hiding panel right underneath it) the effect rescales and runs properly until the next time I run foobar.

-->

Running Foobar in Linux

Reply #245
@Yotsuya: Are you using the latest foobar version with your config? If so does the new DB code work now?

Running Foobar in Linux

Reply #246
 thank you so much for your tutorial!

there is one component i couldn't get to work: foo_albumart
does it require any special dll or something?
it's not that important anyway because now columns and standard UI both support albumart.

Running Foobar in Linux

Reply #247
@Yotsuya: OK, thanks for the feedback

Running Foobar in Linux

Reply #248
@Thuan: I upgraded to foobar2000 v0.9.6.7 and my configuration appears to be unaffected. I'm sorry I don't know what you mean by "the new DB code" can you be more specific?

@Flfoxtasy: I'm sorry I havn't used foo_albumart in ages. As you mentioned both DUI & CUI come with a capable replacement and can also be enhanced with foo_covers. Personally I use a PSS panel for album art to take advantage of conditional scripting.

@Vasya Belkin: Were you able to resolve your issue by resizing the panel while running? Have you experimented with running your wine session as WinXP vs. Vista? Have you tried swapping your gdiplus.dll with one from a working windows install?  I havnt been able to track this issue down and have copied my foobar folder over to XP and Win7 machines and run the same config without the problem so I strongly suspect it is wine specific.  Any reports of progress you may have had would be appreciated.

Running Foobar in Linux

Reply #249
I think Thuan means if the auto-update of the media library works, which I suggest, does not...
fb2k on OSX: flac q8 > rockboxed Sansa e280v1: Vorbis q5.0