HydrogenAudio

Hosted Forums => foobar2000 => Support - (fb2k) => Topic started by: Warmonger on 2007-05-21 03:28:32

Title: Commandline problems
Post by: Warmonger on 2007-05-21 03:28:32
I'm trying to control foobar2000 from the command-line, and I'm having some problems. The /play, /stop, etc. commands work as expected, but if I do foobar2000 /command:"Playback/Play", nothing happens. No errors in foobar, no output on the command prompt. Any idea what could be wrong? This looks like the correct syntax to me.
Title: Commandline problems
Post by: Squeller on 2007-05-21 21:07:43
Is "playback/play" a correct syntax for the native command line? I won't look now: Go and get foo_runcmd from http://foosion.foobar2000.org/ (http://foosion.foobar2000.org/), documentation is there. You can perfectly control fb2k then.
Title: Commandline problems
Post by: Warmonger on 2007-05-21 21:21:29
Is "playback/play" a correct syntax for the native command line? I won't look now: Go and get foo_runcmd from http://foosion.foobar2000.org/ (http://foosion.foobar2000.org/), documentation is there. You can perfectly control fb2k then.


According to the docs it is. I've tried it with about 20 different commands, copy-and-pasted straight from the command line wiki, and none have worked.

If it helps, what I'm trying to do is build a music library app that can load an album into a new playlist. Using the command line seemed like the easiest option. Is there any bundled component that allows for IPC of any kind?
Title: Commandline problems
Post by: Squeller on 2007-05-22 09:17:37
According to the docs it is. I've tried it with about 20 different commands, copy-and-pasted straight from the command line wiki, and none have worked.


Code: [Select]
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>
I don't know any other documentation than "foobar2000.exe /help" and iirc Peter was never really interested in the issue. "<menu command> only seems to be the commands name, without the complete menu path information. This is the disadvantage of the native command line interface, it is not necessarily precise.
Title: Commandline problems
Post by: thuan on 2007-05-22 14:13:35
Have you tried foobar2000.exe /playpause ?
Title: Commandline problems
Post by: Warmonger on 2007-05-22 16:06:51
Here's the Command line help wiki (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Commandline_Guide) that shows the syntax and commands. I've heard of other people being able to use this without anything extra, which is why I'd like to figure out what's wrong.

And yes, as I mentioned, I've tried all the other switches. Everything except /command:, /playlist_command:, and /playing_command: works as expected.
Title: Commandline problems
Post by: eevan on 2007-05-23 03:17:38
It is /command: "Play or pause". I use it in Girder and it works just fine.
Title: Commandline problems
Post by: foosion on 2007-05-23 08:17:18
Here's the Command line help wiki (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Commandline_Guide) that shows the syntax and commands. I've heard of other people being able to use this without anything extra, which is why I'd like to figure out what's wrong.

This wiki page hasn't been updated for foobar2000 0.9 yet; you might notice that there are no "Foobar2000", "Playlist" or "Components" menus. Also, since foobar2000 0.9 /command:x does not parse path information and just tries to match x against the name of a main menu item. That's one of the reasons why foo_runcmd was created.
Title: Commandline problems
Post by: Warmonger on 2007-05-23 15:46:10
Here's the Command line help wiki (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Commandline_Guide) that shows the syntax and commands. I've heard of other people being able to use this without anything extra, which is why I'd like to figure out what's wrong.

This wiki page hasn't been updated for foobar2000 0.9 yet; you might notice that there are no "Foobar2000", "Playlist" or "Components" menus. Also, since foobar2000 0.9 /command:x does not parse path information and just tries to match x against the name of a main menu item. That's one of the reasons why foo_runcmd was created.


Okay, that explains a lot.

Doing stuff with the syntax /command:"Play or pause" worked. However, there's one command that still doesn't seem to work with the different syntax, which is "Create new playlist". I'll keep experimenting and see if I can figure out what's wrong with that.
Title: Commandline problems
Post by: eevan on 2007-05-23 16:11:31
Just go to the Preferences>Keyboard Shortcuts. Click Add New and in the tree below find the action you want. Then use that in the /command: "name_of_command"
Title: Commandline problems
Post by: Warmonger on 2007-05-23 16:28:40
Okay, that seems to work. Thanks a lot for the help.
Title: Commandline problems
Post by: eevan on 2007-05-23 22:49:17
You're welcome
Title: Commandline problems
Post by: gmB on 2009-08-25 20:56:40
The foo_scrobblecharts plugin dynamically modifies the context menu to the corresponding artist that is played.
Like this:

(http://www2.pic-upload.de/25.08.09/afvg4w15riv5.png)


The problem is that none of the following commands will work:

"C:\Programme\foobar2000\foobar2000.exe" "/runcmd-playing=Last.fm/Artist Charts Playlist"  <-- This is whats shown in the command tree in the preference pages
"C:\Programme\foobar2000\foobar2000.exe" "/runcmd-playing=Last.fm/%Artist% Charts Playlist"  <-- This doesn't work either.


Does anybody know a workaround?
Title: Commandline problems
Post by: chrisjj on 2010-09-14 13:27:30
Just go to the Preferences>Keyboard Shortcuts. Click Add New and in the tree below find the action you want. Then use that in the /command: "name_of_command"
I find that works for the [main] commands I tried, but not any [context] commands I tried e.g.

Code: [Select]
 start "View" /WAIT "%PROGRAMFILES%\foobar2000\foobar2000.exe" /command:"Select All" /command:"Properties"  R:\Dance\00008637207120-1-2.wma

does "Select All" but not "Properties".

Any workaround?

Title: Commandline problems
Post by: chrisjj on 2012-11-15 12:00:50
Just go to the Preferences>Keyboard Shortcuts. Click Add New and in the tree below find the action you want. Then use that in the /command: "name_of_command"
I find that works for the [main] commands I tried, but not any [context] commands I tried e.g.

Code: [Select]
 start "View" /WAIT "%PROGRAMFILES%\foobar2000\foobar2000.exe" /command:"Select All" /command:"Properties"  R:\Dance\00008637207120-1-2.wma

does "Select All" but not "Properties".

Any workaround?

Please?
Title: Commandline problems
Post by: foosion on 2012-11-15 13:40:57
Have you tried running "foobar2000.exe /?" This command will show a window with the following content.
Quote
Available switches:
  /add <list-of-files> - appends the specified files to the current playlist instead of replacing the playlist content and playing them immediately
  /immediate - bypasses the "please wait" dialog when adding files
  /play, /pause, /playpause, /prev, /next, /rand, /stop - playback controls
  /exit - exits foobar2000
  /show, /hide - shows or hides the main foobar2000 window
  /config - opens the Preferences dialog
  /command:<menu command> - invokes the specified main menu command
  /playlist_command:<context menu command> - invokes the specified context menu command on current playlist selection
  /playing_command:<context menu command> - invokes the specified context menu command on currently played track
  /context_command:<context menu command> <files> - invokes the specified context menu command on the specified files
(Emphasis added)
Title: Commandline problems
Post by: chrisjj on 2012-11-15 16:21:47
  /playlist_command:<context menu command> - invokes the specified context menu command on current playlist selection


Thanks, I'll try

start "View" /WAIT "%PROGRAMFILES%\foobar2000\foobar2000.exe" /command:"Select All" /playlist_command:"Properties"  R:\Dance\00008637207120-1-2.wma