Difference between revisions of "Foobar2000:Commandline Guide"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
(Examples)
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==Verbage from "foobar2000.exe /?"==
+
{{fb2k}}
  
===Basic Help===
+
=== General information ===
 +
Some features of foobar2000 can be accessed through a simple command line interface.
  
Available switches:
+
Each command line parameter is either parsed as a command (starting with a slash), or as the name of a file/folder that the user wishes to open or add to a playlist (the behaviour depends on other command line switches and setting under "Preferences > [[Foobar2000:Preferences:Shell_Integration|Shell Integration]]"). Arguments containing spaces can be escaped using double quotes, e.g. »<tt>foobar2000.exe "01 First Track.mp3"</tt>« or »<tt>foobar2000.exe "/command:Play or pause"</tt>« or »<tt>foobar2000.exe /command:"Play or pause"</tt>«.
/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>
+
  
 +
The set of available command line commands can be extended using additional components.
  
 +
=== Basic commands ===
 +
This is what »<tt>foobar2000.exe /?</tt>« shows as of version 1.1 &ndash; most of the commands are self-explanatory:
 +
  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
  
''See glossary below for <menu command> and <context menu command> options.''
+
===== Clarifications =====
 +
'''<tt>/add</tt>'''<br>
 +
&nbsp;&nbsp;Changes the default behaviour of "opening" (replace active playlist and start playback) files and directories found on the command line.
  
'''Note: any command with a space in it, requires quotes around it.  
+
'''<tt>/immediate</tt>'''<br>
 +
&nbsp;&nbsp;&nbsp;&nbsp;foobar2000 always sorts incoming files using the pattern configured under "Preferences > [[Foobar2000:Preferences:Shell_Integration|Shell Integration]]". Because there is a possibility that more files belonging to the same batch will be passed to the program, adding the items really to a playlist is postponed until no new file is received for a short while, because only with the full set of incoming files they can be correctly sorted. Use this option to disable this behaviour for the currently added items.
  
Eg. foobar2000.exe /command:"Components/Album list"'''
+
'''<tt>/command:<...></tt>''' and '''<tt>/xxx_command:<...></tt>'''<br>
 +
&nbsp;&nbsp;&nbsp;&nbsp;The command names can be derived e.g. from the "Preferences > [[Foobar2000:Preferences:General:Keyboard_Shortcuts|Keyboard Shortcuts]]" dialog: look in the sub-section ''[main]'' for main menu commands (e.g. <tt>/command:Console</tt>) or ''[context]'' for the other types (e.g. <tt>/playing_command:Properties</tt>). Use only the final command name; do not specify the name of the parent menu or any other part of the menu path/group. (Note: this limits the usage of these commands in some cases; look into the [[Foobar2000:Components_0.9/Run_Commands_(foo_runcmd)|foo_runcmd]] component if you need more functionality.)
  
===More Advanced Help===
 
  
'''Useage:'''
+
=== Extensions ===
 +
Known components which provide additional command line functionality:
 +
* [[Foobar2000:Components/Masstagger_(foo_masstag)|Masstagger (foo_masstag)]] &ndash; <tt>/tag:xxx</tt> commands for tag modifications.
 +
* [[Foobar2000:Components_0.9/Run_Commands_(foo_runcmd)|Run Commands (foo_runcmd)]] &ndash; Family of <tt>/runcmd=...</tt> commands for advanced execution of main/context menu commands.
  
/tag:help - displays this message
 
  
/tag:<command1>[;<command2>;<command3>...] <file1> [<file2> <file3>...]
 
  
 
+
[[Category:foobar2000 Guides|Commandline Guide]]
'''Commands:'''
+
 
+
<NAME>=<VALUE>
+
* Sets <NAME> field to <VALUE>, e.g. "/tag:title=test <file>".
+
* You can erase particular field by specifying empty value, e.g. "/tag:comment= <file>".
+
* You can also specify multiple values by separating them with \ character, e.g. "/tag:artist=name1\name2 <file>".
+
 
+
AUTOTRACKNUMBER
+
* Sets TRACKNUMBER field of multiple files according to their order in commandline.
+
* E.g. "/tag:AUTOTRACKNUMBER <file1> <file2> <file3>" will assign TRACKNUMBER=1 to <file1>, 2 to <file2> and 3 to <file3>.
+
 
+
FORMAT:<FIELD>:<SPEC>
+
* Formats <FIELD> using <SPEC>; see title formatting manual for more info how to use it.
+
* E.g. "/tag:FORMAT:COMMENT:"%ARTIST% - %TITLE%" <file>".
+
 
+
GUESS:<PATTERN>:<SPEC>
+
* Guesses field values using <PATTERN>, according to <SPEC>.
+
* To perform "guess values from filename" action, use "/tag:GUESS:<PATTERN>:%_FILENAME% <file>".
+
* E.g. "/tag:GUESS:"%TRACKNUMBER%. %TITLE%":%_FILENAME% <file>".
+
 
+
==Examples==
+
 
+
From above examples explained:
+
 
+
<NAME>=<VALUE>
+
 
+
c:\Program Files\Foobar2000\foobar2000.exe /tag:artist=name1\name2 <file>
+
 
+
''Use this when you want to put in static text. You cannot use this with any foobar variables.
+
''
+
 
+
 
+
FORMAT:<FIELD>:<SPEC>
+
 
+
c:\Program Files\Foobar2000\foobar2000.exe /tag:FORMAT:COMMENT:"%ARTIST% - %TITLE%" <file>
+
 
+
c:\Program Files\Foobar2000\foobar2000.exe /tag:FORMAT:TITLE:"%_FILENAME%" <file>
+
 
+
''Use this when you want to put in text from foobar variables.''
+
 
+
==Glossary==
+
===Main Menu Items===
+
You can find these listed under:
+
Foobar2000 | Preferences | Core | Main Menu Items | Right-click a group item and choose "Insert Item | Command"
+
* Components/Add XA file(s)...
+
* Components/Album list
+
* Components/Columns UI/Decrease font size
+
* Components/Columns UI/Enable sidebar
+
* Components/Columns UI/Increase font size
+
* Components/Columns UI/Show now playing
+
* Components/Columns UI/Show sidebar
+
* Components/Columns UI/Show statusbar
+
* Components/Columns UI/Show toolbars
+
* Components/Database search
+
* Components/Database search help
+
* Components/Entended Playlist Generator/Configure Playlist Query...
+
* Components/Entended Playlist Generator/Generate Playlist...
+
* Components/Extended Search
+
* Components/Hide Database search
+
* Components/History
+
* Components/History help
+
* Components/Open XA file(s)...
+
* Components/Play audio CD...
+
* Components/Record
+
* Components/Reset shuffle history
+
* Components/Search command...
+
* Components/Show console
+
* Components/Toggle Database search
+
* Components/Visualization/Simple spectrum
+
* Foobar2000/About
+
* Foobar2000/Activate
+
* Foobar2000/Activate or hide
+
* Foobar2000/Always on top
+
* Foobar2000/Close
+
* Foobar2000/Hide
+
* Foobar2000/Preferences
+
* Foobar2000/Reset configuration
+
* Foobar2000/Restart
+
* Foobar2000/Titleformatting help
+
* Playback/Copy now playing
+
* Playback/Follow cursor
+
* Playback/History/Clear history
+
* Playback/History/Next in history
+
* Playback/History/Previous in history
+
* Playback/Next
+
* Playback/Next or random
+
* Playback/Order/Default
+
* Playback/Order/Random
+
* Playback/Order/Repeat
+
* Playback/Order/Repeat One
+
* Playback/Order/Shuffle
+
* Playback/Order/Shuffle album
+
* Playback/Order/Shuffle album 2
+
* Playback/Order/Shuffle tag set
+
* Playback/Pause
+
* Playback/Play
+
* Playback/Play or pause
+
* Playback/Previous
+
* Playback/Random
+
* Playback/ReplayGain/Album
+
* Playback/ReplayGain/Disabled
+
* Playback/ReplayGain/Track
+
* Playback/Seek ahead by 1 minute
+
* Playback/Seek ahead by 1 second
+
* Playback/Seek ahead by 10 minutes
+
* Playback/Seek ahead by 10 seconds
+
* Playback/Seek ahead by 2 minutes
+
* Playback/Seek ahead by 20 seconds
+
* Playback/Seek ahead by 5 minutes
+
* Playback/Seek ahead by 5 seconds
+
* Playback/Seek back by 1 minute
+
* Playback/Seek back by 1 second
+
* Playback/Seek back by 10 minutes
+
* Playback/Seek back by 10 seconds
+
* Playback/Seek back by 2 minutes
+
* Playback/Seek back by 30 seconds
+
* Playback/Seek back by 5 minutes
+
* Playback/Seek back by 5 seconds
+
* Playback/Set volume to 0dB
+
* Playback/Set volume to -12dB
+
* Playback/Set volume to -15dB
+
* Playback/Set volume to -18dB
+
* Playback/Set volume to -21dB
+
* Playback/Set volume to -3dB
+
* Playback/Set volume to -6dB
+
* Playback/Set volume to -9dB
+
* Playback/Stop
+
* Playback/Stop after current
+
* Playback/Volume down
+
* Playback/Volume mute
+
* Playback/Volume up
+
* Playlist/Add directory...
+
* Playlist/Add files...
+
* Playlist/Add location...
+
* Playlist/Add playlist...
+
* Playlist/Clear
+
* Playlist/Collect tracks
+
* Playlist/Copy tracks
+
* Playlist/Create new playlist
+
* Playlist/Cut tracks
+
* Playlist/Edit/Redo
+
* Playlist/Edit/Remove clipboard items
+
* Playlist/Edit/Remove history items
+
* Playlist/Edit/Undo
+
* Playlist/Highlight playing item
+
* Playlist/Insert tracks
+
* Playlist/Load playlist...
+
* Playlist/Move back
+
* Playlist/Move forward
+
* Playlist/Next playlist
+
* Playlist/Open...
+
* Playlist/Paste tracks
+
* Playlist/Playlist switcher
+
* Playlist/Previous playlist
+
* Playlist/Remove active playlist
+
* Playlist/Remove dead entries
+
* Playlist/Remove duplicates
+
* Playlist/Rename playlist...
+
* Playlist/Save all playlists...
+
* Playlist/Save playlists...
+
* Playlist/Scroller/Autofocus enabled
+
* Playlist/Scroller/Autofocus requires no selection
+
* Playlist/Scroller/Autofocus to playlist
+
* Playlist/Scroller/Autofocus/On pause/5. Autofocus + Highlight
+
* Playlist/Scroller/Current track/Focus
+
* Playlist/Scroller/Current track/Focus + Highlight (Keep Selection)
+
* Playlist/Scroller/Current track/Focus + Highlight (Single)
+
* Playlist/Scroller/Current track/Highlight
+
* Playlist/Scroller/Current track/Make visible
+
* Playlist/Scroller/Current track/1. Do nothing
+
* Playlist/Scroller/Current track/2. Autofocus
+
* Playlist/Scroller/Current track/3. Highlight
+
* Playlist/Scroller/Current track/4. Autofocus + Highlight (Single)
+
* Playlist/Scroller/Current track/5. Autofocus + Highlight (Keep Selection)
+
* Playlist/Scroller/Current track/6. Make visible
+
* Playlist/Scroller/On pause/1. Do nothing
+
* Playlist/Scroller/On pause/2. Autofocus
+
* Playlist/Scroller/On pause/3. Highlight
+
* Playlist/Scroller/On pause/4. Autofocus + Highlight (Single)
+
* Playlist/Scroller/On pause/6. Make visible
+
* Playlist/Scroller/On unpause/1. Do nothing
+
* Playlist/Scroller/On unpause/2. Autofocus
+
* Playlist/Scroller/On unpause/3. Highlight
+
* Playlist/Scroller/On unpause/4. Autofocus + Highlight (Single)
+
* Playlist/Scroller/On unpause/5. Autofocus + Highlight (Keep Selection)
+
* Playlist/Scroller/On unpause/6. Make visible
+
* Playlist/Scroller/Refocus on playlist switch
+
* Playlist/Search...
+
* Playlist/Selection/Crop
+
* Playlist/Selection/Invert
+
* Playlist/Selection/Remove
+
* Playlist/Selection/Select all
+
* Playlist/Selection/Select none
+
* Playlist/Selection/Sort/Randomize
+
* Playlist/Selection/Sort/Reverse
+
* Playlist/Selection/Sort/Sort by ...
+
* Playlist/Selection/Sort/Sort by album
+
* Playlist/Selection/Sort/Sort by artist
+
* Playlist/Selection/Sort/Sort by display name
+
* Playlist/Selection/Sort/Sort by file path
+
* Playlist/Selection/Sort/Sort by title
+
* Playlist/Selection/Sort/Sort by track number
+
* Playlist/Sort/Randomize
+
* Playlist/Sort/Reverse
+
* Playlist/Sort/Sort by ...
+
* Playlist/Sort/Sort by album
+
* Playlist/Sort/Sort by artist
+
* Playlist/Sort/Sort by display name
+
* Playlist/Sort/Sort by file path
+
* Playlist/Sort/Sort by title
+
* Playlist/Sort/Sort by track number
+
* Playlist/Undo
+
 
+
===Context Menu Items===
+
You can find these listed under:
+
Foobar2000 | Preferences | Core | Context Menu Items | Right-click a group item and choose "Insert Item | Command"
+
 
+
* ABX two tracks...
+
* Bit-compare tracks...
+
* Convert/Run conversion
+
* Convert/Run conversion, single file output
+
* Convert/Settings...
+
* Copy name(s)
+
* Create Off Preview
+
* Database search/Search for same album
+
* Database search/Search for same artist
+
* Database search/Search for same date
+
* Database search/Search for same title
+
* Database search/Search for same venue
+
* Database search/Search for same...
+
* Database/Reload info from file(s)
+
* Database/Reload info from file(s) if changed
+
* Database/Remove file(s) from database
+
* Database/Remove tags from file(s)
+
* Database/Rewrite file tags from database
+
* Edit/Add to playlist
+
* Edit/Collect tracks
+
* Edit/Copy tracks
+
* Edit/Cut tracks
+
* Edit/Insert into playlist
+
* Edit/Insert tracks
+
* Edit/Paste tracks
+
* Edit/Remove from playlist
+
* Edit/Send to playlist
+
* Fix MP3 header...
+
* freedb/Configure
+
* freedb/Get tags
+
* freedb/Get tags (multiple albums)
+
* freedb/Manual query
+
* freedb/Search
+
* Highlight in playlist
+
* Mastagger/Copy tags
+
* Mastagger/Edit tags
+
* Mastagger/Move, rename or copy files
+
* Module: Change starting order or subsong
+
* MP4 utilities/Converter (AAC,MP3 <-> MP4)
+
* MP4 utilities/Converter (AAC,MP3 <-> MP4), different directory
+
* MP4 utilities/MP4 Layout Optimizer
+
* NSFE: Edit Length
+
* NSFE: Edit Playlist
+
* Open directory
+
* Play
+
* Properties
+
* PSF: Edit Length
+
* Replaygain/Edit replaygain info (advanced)
+
* Replaygain/Remove replaygain info from files
+
* Replaygain/Scan per-file track gain
+
* Replaygain/Scan selection as album
+
* Replaygain/Scan selection as multiple albums
+
* Save as playlist
+
* Search command...
+
* Send to playlist...
+
* Show file info (special)
+
* Show file info (special) Multiple items...
+
* SPC: Edit Length
+
* Write APL link file(s)
+
* Write Audio CD...
+
* XA: Rip
+
* XA: Scan
+
 
+
[[Category: foobar2000]]
+

Revision as of 10:20, 24 October 2011

Foobar2000_Logo.png

General information

Some features of foobar2000 can be accessed through a simple command line interface.

Each command line parameter is either parsed as a command (starting with a slash), or as the name of a file/folder that the user wishes to open or add to a playlist (the behaviour depends on other command line switches and setting under "Preferences > Shell Integration"). Arguments containing spaces can be escaped using double quotes, e.g. »foobar2000.exe "01 First Track.mp3"« or »foobar2000.exe "/command:Play or pause"« or »foobar2000.exe /command:"Play or pause"«.

The set of available command line commands can be extended using additional components.

Basic commands

This is what »foobar2000.exe /?« shows as of version 1.1 – most of the commands are self-explanatory:

 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
Clarifications

/add
  Changes the default behaviour of "opening" (replace active playlist and start playback) files and directories found on the command line.

/immediate
    foobar2000 always sorts incoming files using the pattern configured under "Preferences > Shell Integration". Because there is a possibility that more files belonging to the same batch will be passed to the program, adding the items really to a playlist is postponed until no new file is received for a short while, because only with the full set of incoming files they can be correctly sorted. Use this option to disable this behaviour for the currently added items.

/command:<...> and /xxx_command:<...>
    The command names can be derived e.g. from the "Preferences > Keyboard Shortcuts" dialog: look in the sub-section [main] for main menu commands (e.g. /command:Console) or [context] for the other types (e.g. /playing_command:Properties). Use only the final command name; do not specify the name of the parent menu or any other part of the menu path/group. (Note: this limits the usage of these commands in some cases; look into the foo_runcmd component if you need more functionality.)


Extensions

Known components which provide additional command line functionality: