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: foobar commandline control and dockable panels (Read 7649 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar commandline control and dockable panels

Like Canar said in another topic :

The best-easiest way to control foobar2000 externally is using the commandline. foobar2000.exe /play and whatnot work without configuring keyboard shortcuts and are guaranteed to work regardless of what shortcuts any particular user has set up.

In that case, could somebody give me the right commandline syntax for executing these two actions ?
- View menu > Dockable Panels > Activate > (name of the panel we wish to activate)
- View menu > Dockable Panels > Collapse > (name of the panel we wish to collapse)

Right now I can assigh these two actions to convenient shortcuts and use them within an external AutoHotKey script. But I'd be happy to use the commandline instead if that's the "best-easiest way" to do it.

Thanks for your help.

foobar commandline control and dockable panels

Reply #1
Without further testing, foo_runcmd may help you here.

foobar commandline control and dockable panels

Reply #2
Thanks, I didn't know an additional component was needed here.

I simply don't understand why this would be "better-easier" than my actual script that works... any ideas ?


foobar commandline control and dockable panels

Reply #4
He needs a plugin. From the wiki:

Quote
Please Note: All of the above works for 0.8.3, but /command: and /playlist_command: doesn't seem to be functional with the 0.9.x version. To work around this problem, try using the hotkey mechanism as listed here:


Following the link which is provided by the wiki:http://www.hydrogenaudio.org/forums/index....st&p=493883

foobar commandline control and dockable panels

Reply #5
The wiki is severely outdated. The best way to get current info is to invoke [font= "Courier New"]foobar2000.exe /?[/font]

For example [font= "Courier New"]foobar2000.exe "/playing_command:Tagging/Get Tags From freedb"[/font] works fine with the default installation of the latest version. What doesn't work are items which are dynamically created, e.g. converter presets - then foo_runcmd comes into play.
Full-quoting makes you scroll past the same junk over and over.

foobar commandline control and dockable panels

Reply #6
So I don't need a plugin. Great.

I have invoked "foobar2000.exe /?" inside XP's cmd prompt :

Code: [Select]
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

I'm going to try to deal with this... For example, would this command be correct ?

Code: [Select]
foobar2000.exe /command:View/Dockable Panels/Activate/1 - Peakmeter Spectrum

However, even if it's correct, I think we'll have a problem anyway. Because in the Dockable Panels' "Activate" menu, all panels have a distinctive number (e.g. "1 - Peakmeter Spectrum"). But in the "Collapse" menu, there are no distinctive numbers ! So if we have two Peakmeter Spectrum panels, they will all be named "Peakmeter Spectrum". So how can we differentiate them from the commandline ? 

foobar commandline control and dockable panels

Reply #7
As foosion said in his linked post, "foobar2000 0.9 /command:x does not parse path information and just tries to match x against the name of a main menu item.". Therefore it would be just:
[font= "Courier New"]foobar2000.exe "/command:Columns Playlist"[/font] for "View menu > Dockable Panels > Collapse > Columns Playlist".
[font= "Courier New"]foobar2000.exe "/command:1 - Columns Playlist"[/font] for "View menu > Dockable Panels > Activate > 1 - Columns Playlist".
Full-quoting makes you scroll past the same junk over and over.

foobar commandline control and dockable panels

Reply #8
So if we have two Peakmeter Spectrum panels, they will all be named "Peakmeter Spectrum". So how can we differentiate them from the commandline ? 
Go to "View -> Dockable Panels -> Active Panel -> Custom Title ..." and change the titles to your needs.

foobar commandline control and dockable panels

Reply #9
Thanks to both of you.

Yirkha, your commands work as expected (and much better than the same thing done via foobar shortcuts ! Yay !  ). fbuser, I hadn't noticed that panel titles could be changed.

One small problem remains : at foobar's startup, some panels keep appearing in the foreground when they shouldn't. I have tried forcing them to close upon foobar startup with the following AutoHotKey command :

Code: [Select]
Run C:\Program Files\foobar2000\foobar2000.exe "/command:Panelname1" "/command:Panelname2" "/command:Panelname3"

However, this doesn't work ! foobar keeps starting with some panels in the foreground.

Once foobar is completely started, everything works as expected (including the above command if I execute it via AutoHotKey), so it seems to be a startup problem.

So, is there a way to really force foobar to start up with ALL existing panels collapsed ?...

 

foobar commandline control and dockable panels

Reply #10
Moderation: Subsequent debate about CUI panels in DUI, design choices and other things moved here.
Full-quoting makes you scroll past the same junk over and over.