Skip to main content
Topic: foobar2000.exe /command:? (Read 18293 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar2000.exe /command:?

foobar2000.exe /command:

What options can i give? I would like to create a new playlist tab.

foobar2000.exe /command:?

Reply #1
Quote
foobar2000.exe /command:

What options can i give? I would like to create a new playlist tab.
[a href="index.php?act=findpost&pid=248237"][{POST_SNAPBACK}][/a]

foobar2000 can execute any command listed under Preferences/Core/Main menu items via "/command:".

E.g. to create a new playlist tab:
foobar2000.exe /command:"Playlist/Create new playlist"

foobar2000.exe /command:?

Reply #2
Quote
Quote
foobar2000.exe /command:

What options can i give? I would like to create a new playlist tab.
[a href="index.php?act=findpost&pid=248237"][{POST_SNAPBACK}][/a]

foobar2000 can execute any command listed under Preferences/Core/Main menu items via "/command:".

E.g. to create a new playlist tab:
foobar2000.exe /command:"Playlist/Create new playlist"
[a href="index.php?act=findpost&pid=248250"][{POST_SNAPBACK}][/a]


And is it possible to remove a playlist?
foobar2000.exe /playlist_command:"Playlist/Remove this playlist"
doesn't work.

foobar2000.exe /command:?

Reply #3
Quote
And is it possible to remove a playlist?
foobar2000.exe /playlist_command:"Playlist/Remove this playlist"
doesn't work.[a href="index.php?act=findpost&pid=255779"][{POST_SNAPBACK}][/a]

Try foobar2000.exe /command:"Playlist/Remove active playlist".

foobar2000.exe /command:?

Reply #4
Quote
Quote
And is it possible to remove a playlist?
foobar2000.exe /playlist_command:"Playlist/Remove this playlist"
doesn't work.[a href="index.php?act=findpost&pid=255779"][{POST_SNAPBACK}][/a]

Try foobar2000.exe /command:"Playlist/Remove active playlist".
[a href="index.php?act=findpost&pid=255797"][{POST_SNAPBACK}][/a]


That works. But I have more problems....
Here is what I'm trying to do (in a batch file):

foobar2000.exe /add "d:\music\pop\"
pause
foobar2000.exe" /command:"Playlist/Sort/Sort by display name"
foobar2000.exe" /command:"Playlist/Create new playlist"
foobar2000.exe" /add "d:\music\trance"
pause
foobar2000.exe" /command:"Playlist/Sort/Sort by display name"
foobar2000.exe" /command:"Playlist/Create new playlist"
etc...

So I want to start foobar with a few tabs and in each tab I want to load all the files from one directory. The pause command is necessary (try yourself). This works so far. Now I want to rename the playlist (from the batch file). I tried this:

foobar2000.exe /command:"Playlist/Rename playlist..."

But that pops up a rename playlist dialog. You guessed it: I want to specify the new playlist name from the command line. Is that possible?

foobar2000.exe /command:?

Reply #5
Quote
But that pops up a rename playlist dialog. You guessed it: I want to specify the new playlist name from the command line. Is that possible?[a href="index.php?act=findpost&pid=256387"][{POST_SNAPBACK}][/a]
No, someone would have to write a component for this.

foobar2000.exe /command:?

Reply #6
Quote
Quote
But that pops up a rename playlist dialog. You guessed it: I want to specify the new playlist name from the command line. Is that possible?[a href="index.php?act=findpost&pid=256387"][{POST_SNAPBACK}][/a]
No, someone would have to write a component for this.
[a href="index.php?act=findpost&pid=256390"][{POST_SNAPBACK}][/a]


Maybe I can do that myself...
Do you have any idea how I could do that (from inside a component)?

foobar2000.exe /command:?

Reply #7
To rename a playlist, you have to call playlist_switcher::rename_playlist() or playlist_switcher::rename_playlist_fixname(). The index of the active playlist can be retrieved using playlist_switcher::get_active_playlist(). To handle a command line argument, you have to implement the commandline_handler service. Example components in the SDK that make use of these features are foo_playlistswitcher (use ofplaylist_switcher service) and foo_masstag (implementation of commandline_handler), though your commandline_handler implementation will be significantly simpler than the one in foo_masstag.

foobar2000.exe /command:?

Reply #8
Ok, I could write a plugin, but that's not really a good solution. Why has foobar these command line parameters anyway when you can't specify a value?
So it would be better if the author added support for that than writing a plugin for each parameter you wan't to specify at the command line. That makes no sense.

So this should work in the future:
foobar2000.exe /command:"Playlist/Rename playlist..." "new name"
otherwise it makes no sense to have that commandline option at all.

foobar2000.exe /command:?

Reply #9
Quote
Ok, I could write a plugin, but that's not really a good solution. Why has foobar these command line parameters anyway when you can't specify a value?
The "/command:" parameter allows you to invoke an arbitrary main menu command from the command line. However, menu commands don't expect to be called in a non-interactive way (they are not aware of being invoked from the command line), so they use a GUI to get any additional parameters they might need. Components can also add additional command line parameters - that's what the commandline_handler service is for.

Quote
otherwise it makes no sense to have that commandline option at all.
The "/command:" parameter works rather well for quitting foobar2000 or for playback manipulations (play/pause/stop/...).

foobar2000.exe /command:?

Reply #10
Ok that makes sense, I get it.

But here is my other problem:

foobar2000.exe /add "d:\music\pop\"
pause
foobar2000.exe" /command:"Playlist/Sort/Sort by display name"

The pause is needed to let foobar load all the files in the directory, before sorting the playlist. But now I have to check when foobar is finished and then I have to press a key.

It would be nice to have a commandline option (eg. /wait) that, when specified, makes sure the foobar2000.exe doesn't return (back to the OS) until the operation is completed.

Johan.

foobar2000.exe /command:?

Reply #11
Quote
It would be nice to have a commandline option (eg. /wait) that, when specified, makes sure the foobar2000.exe doesn't return (back to the OS) until the operation is completed.


Wait.exe

usage:


...\Wait.exe [seconds]

C:\wait.exe 60 (pauses the Batch for 60 seconds)

foobar2000.exe /command:?

Reply #12
Quote
Quote
It would be nice to have a commandline option (eg. /wait) that, when specified, makes sure the foobar2000.exe doesn't return (back to the OS) until the operation is completed.


Wait.exe

usage:


...\Wait.exe [seconds]

C:\wait.exe 60 (pauses the Batch for 60 seconds)
[a href="index.php?act=findpost&pid=258474"][{POST_SNAPBACK}][/a]


That helps, but not very well.
You don't know in advance how long foobar needs to load all the files. So you should wait a fairly long time to be sure. And that stinks
But thanks anyway.

foobar2000.exe /command:?

Reply #13
Quote
To rename a playlist, you have to call playlist_switcher::rename_playlist() or playlist_switcher::rename_playlist_fixname(). The index of the active playlist can be retrieved using playlist_switcher::get_active_playlist(). To handle a command line argument, you have to implement the commandline_handler service. Example components in the SDK that make use of these features are foo_playlistswitcher (use ofplaylist_switcher service) and foo_masstag (implementation of commandline_handler), though your commandline_handler implementation will be significantly simpler than the one in foo_masstag.
[a href="index.php?act=findpost&pid=256396"][{POST_SNAPBACK}][/a]


Please, help a total newbie out...

Is there a list of all the calls available? I'm investigating how to write a component, but would like to be able, for instance, to query (and change) the volume. Browsing the available source code is a lot of work but ok, but since the main app. and some of the dll's come without source code I don't know which calls are available.

foobar2000.exe /command:?

Reply #14
Quote
Is there a list of all the calls available? I'm investigating how to write a component, but would like to be able, for instance, to query (and change) the volume.
The services exposed by the core are contained in the foobar2000_sdk project. The class names suggest which part of the player you can access with the corresponding service, i.e. play_control has methods to start, stop or pause playback or access the volumne (among others). If you haven't already, you might also want to take a look at the component development tutorial.

Quote
Browsing the available source code is a lot of work but ok, but since the main app. and some of the dll's come without source code I don't know which calls are available.
The services available from the core are all in the foobar2000 SDK. I'd suggest you try to find the service(s) you want to use in the SDK first, and then search for usage examples should you need them. I admit that documentation is a little scarce in places, but this is expected to improve with the 0.9 SDK.

foobar2000.exe /command:?

Reply #15
Thanks a heap!

I've already been reading all the header files which do shed some light on the matter.

I guess communicating with components that come without source code is simply out of the question (e.g. the dynamic compressor by Garf).

I've been playing around with the tutorial and I'll get there eventually. It's just a matter of motivation (I'm an engineer, not a programmer, damnit Jim). Thanks again for the pointers (pun intended).

[edit]it was Garf's plugin[/edit]

foobar2000.exe /command:?

Reply #16
Quote
But that pops up a rename playlist dialog. You guessed it: I want to specify the new playlist name from the command line. Is that possible?[a href="index.php?act=findpost&pid=256387"][{POST_SNAPBACK}][/a]
No, someone would have to write a component for this.



And after almost 2 years 
Is there still no plugin to rename playlist from command line like this?
foobar2000.exe /command:"Playlist/Rename playlist..."
Without having to type in playlist name manually.

foobar2000.exe /command:?

Reply #17
Is there still no plugin to rename playlist from command line like this?
foobar2000.exe /command:"Playlist/Rename playlist..."
Without having to type in playlist name manually.
You also can't do this with foo_runcmd, so the answer is: YES.

foobar2000.exe /command:?

Reply #18
11 years have passed... but still can not specify the name of the playlist from the command line. Is it so difficult to add?

foobar2000.exe /command:?

Reply #19
11 years have passed...

Welcome to 2017.

Or, my bad, from the first post yes, 11 years

Re: foobar2000.exe /command:?

Reply #20
How can I send a folder and create a new playlist with folder name?

 
SimplePortal 1.0.0 RC1 © 2008-2020