.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MOOSIC 1" .TH MOOSIC 1 "2007-05-25" "Moosic 1.5.6" "" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" moosic \- a command\-line client for the Moosic jukebox system. .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBmoosic\fR [\fIoptions\fR] \fIcommand\fR [\fIoptions\fR] [\fIcommand arguments\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fBmoosic\fR program is the command-line interface to the Moosic jukebox system. It communicates with moosicd(1), the Moosic server, querying the server for information and telling the server what to do. \fBmoosic\fR will not be able to do very much unless \fBmoosicd\fR is running. When \fBmoosicd\fR isn't already running, \fBmoosic\fR will automatically start it for you, unless you specifically request otherwise (with the \-\-no\-startserver option). .SH "USAGE" .IX Header "USAGE" \&\fBmoosic\fR works by sending a command to the Moosic server and returning the response, if any. The first non-option argument given to \fBmoosic\fR is the name of the command to be performed. This command name is case-insensitive, and all non-alphanumeric characters in it are ignored. You can use the \*(L"help\*(R" command to quickly and easily view the names of all the available commands and to get a brief description of individual commands. You can also use \f(CW\*(C`moosic \&\-\-showcommands\*(C'\fR to display the short descriptions of all the commands at once. The \*(L"\s-1COMMANDS\s0\*(R" section below lists the full details of each command. There are very many commands, so you should start by just learning a few commonly used commands, and only learning others as you feel the need. I recommend starting with the following short command vocabulary: add, list, stop, play, and shuffle. .PP For example, \f(CW\*(C`moosic add foo.mp3\*(C'\fR adds the file \fIfoo.mp3\fR (in the current directory) to the end of the song queue and returns you immediately back to your shell prompt without printing any output (unless an error occurs). Compare with \&\f(CW\*(C`moosic list\*(C'\fR, which will list the contents of the song queue. Note that if the song queue is empty, \f(CW\*(C`moosic list\*(C'\fR will not display anything. .SH "OPTIONS" .IX Header "OPTIONS" Most of the options for \fBmoosic\fR are only relevant if they are used with one of the commands that take a \fIfilelist\fR argument. See \*(L"\s-1COMMANDS\s0\*(R" for the definition of a \fIfilelist\fR. The only shuffling options that don't mutually exclude each other are \fB\-d\fR and \fB\-a\fR. Shuffling options that are named later on the command line take precedence over ones that occur earlier. All options must be named immediately before the \fIcommand\fR given to \fBmoosic\fR or immediately after the \fIcommand\fR; options placed within the list of the command's arguments will not be interpreted as options. .IP "\fB\-g\fR, \fB\-\-shuffle\-global\fR" 4 .IX Item "-g, --shuffle-global" This option causes \fBmoosic\fR to shuffle the entire \fIfilelist\fR after directory expansion has taken place, before sending the \fIfilelist\fR to the Moosic server. This is the default behavior. This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. .IP "\fB\-d\fR, \fB\-\-shuffle\-dir\fR" 4 .IX Item "-d, --shuffle-dir" This option causes \fBmoosic\fR to shuffle the results of expanding the directories named in the \fIfilelist\fR. This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. .IP "\fB\-a\fR, \fB\-\-shuffle\-args\fR" 4 .IX Item "-a, --shuffle-args" This option causes \fBmoosic\fR to shuffle the actual command line arguments that comprise the \fIfilelist\fR. This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. .IP "\fB\-o\fR, \fB\-\-inorder\fR" 4 .IX Item "-o, --inorder" When this option is used, \fBmoosic\fR doesn't shuffle the \fIfilelist\fR named on the command line at all. Rather, the order specified on the command line is preserved. This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. .IP "\fB\-s\fR, \fB\-\-sort\fR" 4 .IX Item "-s, --sort" When this option is used, \fBmoosic\fR sorts the \fIfilelist\fR lexicographically after it has been expanded (through directory recursion or auto-finding or the like). The order specified on the command line is ignored. This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. .IP "\fB\-r\fR, \fB\-\-no\-recurse\fR" 4 .IX Item "-r, --no-recurse" Using this option prevents \fBmoosic\fR from replacing directories named in the \&\fIfilelist\fR with a recursive traversal of their contents. .IP "\fB\-n\fR, \fB\-\-no\-file\-munge\fR" 4 .IX Item "-n, --no-file-munge" Using this option prevents \fBmoosic\fR from modifying the names in the expanded \&\fIfilelist\fR. Normally, \fBmoosic\fR converts relative filenames into absolute filenames before sending the names to \fBmoosicd\fR, but this is generally not desirable behavior if you want to insert items that aren't local files into the queue (such as URLs). This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. .IP "\fB\-i\fR, \fB\-\-ignore\-case\fR" 4 .IX Item "-i, --ignore-case" Treats any given regular expressions as if they were case-insensitive. This option is only meaningful if used in conjunction with a command that accepts one or more regular expressions as arguments. This option is syntactic sugar, since the regular expressions supported by Moosic can also be made case-insensitive by including \*(L"(?i)\*(R" within the regular expression. .IP "\fB\-f\fR, \fB\-\-auto\-find\fR" 4 .IX Item "-f, --auto-find" This option causes each string in the \fIfilelist\fR with the results of performing a \*(L"fuzzy\*(R" search for music files. \*(L"Fuzzy\*(R" matching is done by simplifying all the candidate filenames (by lowering the case and removing all non-alphanumeric characters except slashes) and then testing to see if the search string (which has been similarly simplified) is contained in any of the filenames. The list of candidate filenames is obtained by recursively traversing the file hierarchy rooted at the directory specified by the \fB\-\-music\-dir\fR option (which has a default value of \fI~/music/\fR). .Sp For example, if you use \f(CW\*(C`moosic \-f add severedgoddess\*(C'\fR, and the file \&\fI~/music/Meat_Puppets/Severed_Goddess_Hand.mp3\fR exists, then this file will be included in the list of files to be added to the queue. Similarly, if you use \&\f(CW\*(C`moosic \-f pre nesad\*(C'\fR, and the directory \fI~/music/J/Jane's Addiction/\fR exists, then all the files in this directory (and its subdirectories) will be included in the list of files to be prepended to the queue. .Sp This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. Beware that using this option can cause \fBmoosic\fR to take a long time to complete if the directory tree being searched contains a very large number of files. .IP "\fB\-F\fR, \fB\-\-auto\-grep\fR" 4 .IX Item "-F, --auto-grep" This option enables behavior very much like that of the \fB\-\-auto\-find\fR option, except that regular expression searching is used instead of the \*(L"fuzzy\*(R" search scheme. Specifically, each string in the \fIfilelist\fR is treated as a regular expression, and is replaced with all the filenames that match the expression. As with \fB\-\-auto\-find\fR, the filenames that are eligible for matching are obtained by traversing the directory named with the \fB\-\-music\-dir\fR option (defaulting to \fI~/music/\fR if \fB\-\-music\-dir\fR is not used). Essentially, \&\f(CW\*(C`moosic \-F prepend something\*(C'\fR is semantically equivalent to \&\f(CW\*(C`moosic prepend \`find ~/music/ | grep something\`\*(C'\fR, but is syntactically a lot sweeter. .Sp This option is only meaningful if used in conjunction with a command that accepts a \fIfilelist\fR. Beware that using this option can cause \fBmoosic\fR to take a long time to complete if the directory tree being searched contains a very large number of files. .IP "\fB\-m\fR \fIdirectory\fR, \fB\-\-music\-dir\fR \fIdirectory\fR" 4 .IX Item "-m directory, --music-dir directory" This option controls which directory is used for searching when the \*(L"auto-find\*(R" or \*(L"auto-grep\*(R" feature is enabled. These automatic searches are limited to the file hierarchy rooted at the directory specified by this option. When this option is not used, the \fI~/music/\fR directory is used as a default. This option is only meaningful if either \fB\-\-auto\-find\fR or \fB\-\-auto\-grep\fR is used. .IP "\fB\-S\fR, \fB\-\-showcommands\fR" 4 .IX Item "-S, --showcommands" Prints a list of the commands that may be used with \fBmoosic\fR and then exits. Note that this output is quite copious, so you will probably want to pipe it to a text pager, such as \fBless\fR. .IP "\fB\-h\fR, \fB\-\-help\fR" 4 .IX Item "-h, --help" Prints a short help message that explains the command line options and then exits. .IP "\fB\-v\fR, \fB\-\-version\fR" 4 .IX Item "-v, --version" Prints version information and then exits. .IP "\fB\-c\fR \fIdirectory\fR, \fB\-\-config\-dir\fR \fIdirectory\fR" 4 .IX Item "-c directory, --config-dir directory" This option is not needed under normal circumstances. It should only be used if you want \fBmoosic\fR to communicate with an instance of \fBmoosicd\fR which was invoked with the \fB\-c\fR/\fB\-\-config\fR option. Using this option tells \fBmoosic\fR to search the specified directory for the files which are usually found in \&\fI~/.moosic/\fR. .IP "\fB\-t\fR \fIhost\fR:\fIport\fR, \fB\-\-tcp\fR \fIhost\fR:\fIport\fR" 4 .IX Item "-t host:port, --tcp host:port" This option tells \fBmoosic\fR to communicate with a Moosic server that is listening to the specified \s-1TCP/IP\s0 port on the specified host. Running a Moosic server that accepts requests via \s-1TCP/IP\s0 is not recommended because it is a security risk. .IP "\fB\-N\fR, \fB\-\-no\-startserver\fR" 4 .IX Item "-N, --no-startserver" This option prevents \fBmoosic\fR from trying to automatically start \fBmoosicd\fR if it can't contact a Moosic server. .IP "\fB\-U\fR, \fB\-\-allow\-unplayable\fR" 4 .IX Item "-U, --allow-unplayable" This option allows songs that the server doesn't know how to play to be added into the song queue. .IP "\fB\-C\fR, \fB\-\-current\-in\-list\fR" 4 .IX Item "-C, --current-in-list" This option causes the currently playing song to be printed at the top of the output of the \*(L"list\*(R" and \*(L"plainlist\*(R" commands. It has no effect if an argument is given to these commands or if used with other commands. .SH "COMMANDS" .IX Header "COMMANDS" Any of these commands may be specified with any mixture of upper-case and lower-case letters, and non-alphabetic characters (such as '\-') may be omitted. .PP Many of these commands accept a \fIrange\fR argument. A \fIrange\fR is a pair of colon-separated numbers. Such a \fIrange\fR addresses all items whose index in the song queue is both greater than or equal to the first number and less than the second number. For example, \*(L"3:7\*(R" addresses items 3, 4, 5, and 6. If the first number in the pair is omitted, then the \fIrange\fR starts at the beginning of the song queue. If the second number in the pair is omitted, then the \fIrange\fR extends to include the last item in the song queue. A \fIrange\fR can also be a single number (with no colon), in which case it addresses the single item whose index is that of the given number. Negative numbers may be used to index items from the end of the list instead of the beginning. Thus, \-1 refers to the last item in the song queue, \-2 refers to the second-to-last item, etc. .PP Beware that a negative number that immediately follows a moosic \fIcommand\fR is liable to be incorrectly interpreted as an option, so option processing should be explicitly terminated with an argument of \*(L"\-\-\*(R" between the \fIcommand\fR and the number. This is illustrated by the following example, which removes the last item in the queue: \f(CW\*(C`moosic del \-\- \-1\*(C'\fR .PP Alternatively (and perhaps more conveniently), you can prevent negative numbers from being interpreted as options by preceding the range with a single character that can't be mistaken for a number or an option (i.e. any character that isn't a digit or a dash). Example: \f(CW\*(C`moosic list /\-15:\-9\*(C'\fR. You can also place such a character at the end of the range if you think it makes it look prettier. Example: \f(CW\*(C`moosic list /\-15:\-9/\*(C'\fR. The bracketing characters surrounding a range need not be the same: \f(CW\*(C`moosic shuffle \*(Aq[\-13:8]\*(Aq\*(C'\fR. Notice how the preceding example surrounded the range in quotes to prevent the shell from treating the \&\*(L"[\*(R" and \*(L"]\*(R" characters specially (since shells have a habit of doing things like that). .SS "Querying for information" .IX Subsection "Querying for information" These commands print useful bits of information to standard output. .IP "\fBhelp\fR [\fIcommand\fR ...]" 4 .IX Item "help [command ...]" Prints a brief description of the moosic commands named as arguments. If no arguments are given, a list of all the available moosic commands is printed. .IP "\fBcurrent\fR" 4 .IX Item "current" Print the name of the song that is currently playing. .IP "\fBcurr\fR" 4 .IX Item "curr" An alias for \*(L"current\*(R". .IP "\fBcurrent-time\fR [\fIformat\fR]" 4 .IX Item "current-time [format]" Print the amount of time that the current song has been playing. By default, this time is printed in a format of \*(L"hours:minutes:seconds\*(R", but if a different format is desired, a string argument can be given to specify it. The format should be a string that is appropriate for passing to the \fIstrftime\fR\|(3) function. .IP "\fBlist\fR [\fIrange\fR]" 4 .IX Item "list [range]" Print the list of items in the current song queue. A whole number is printed before each item in the list, indicating its position in the queue. If a range is specified, only the items that fall within that range are listed. Remember that the song queue does not contain the currently playing song. .IP "\fBplainlist\fR [\fIrange\fR]" 4 .IX Item "plainlist [range]" Print the current song queue without numbering each line. If a range is specified, only the items that fall within that range are listed. This output is suitable for saving to a file which can be reloaded by the \*(L"pl-append\*(R", \&\*(L"pl-prepend\*(R", \*(L"pl-insert\*(R", and \*(L"pl-mixin\*(R" commands. .IP "\fBhistory\fR [\fInumber\fR]" 4 .IX Item "history [number]" Print a list of items that were recently played. The times mentioned in the output of this command represents the time that a song finished playing. If a number is specified, then no more than that number of entries will be printed. If a number is not specified, then the entire history is printed. Note that \&\fBmoosicd\fR limits the number of items stored in its history list. .IP "\fBhist\fR [\fInumber\fR]" 4 .IX Item "hist [number]" An alias for \*(L"history\*(R". .IP "\fBstate\fR" 4 .IX Item "state" Print the current state of the music daemon. .IP "\fBstatus\fR" 4 .IX Item "status" An alias for \*(L"state\*(R". .IP "\fBlength\fR" 4 .IX Item "length" Print the number of items in the queue. .IP "\fBlen\fR" 4 .IX Item "len" An alias for \*(L"length\*(R". .IP "\fBispaused\fR" 4 .IX Item "ispaused" Show whether the current song is paused or not. If the song is paused, \*(L"True\*(R" is printed and \fBmoosic\fR returns normally. If the song is not paused, \*(L"False\*(R" is printed and \fBmoosic\fR returns with a non-zero exit status (which happens to be 2 for no particular reason). .IP "\fBislooping\fR" 4 .IX Item "islooping" Show whether the server is in loop mode. If the server is in loop mode, \*(L"True\*(R" is printed and \fBmoosic\fR returns normally. If not, \*(L"False\*(R" is printed and \&\fBmoosic\fR returns with a non-zero exit status (which happens to be 2 for no particular reason). .IP "\fBisadvancing\fR" 4 .IX Item "isadvancing" Show whether the server is advancing through the song queue. If the server is advancing, \*(L"True\*(R" is printed and \fBmoosic\fR returns normally. If not, \*(L"False\*(R" is printed and \fBmoosic\fR returns with a non-zero exit status (which happens to be 2 for no particular reason). .IP "\fBversion\fR" 4 .IX Item "version" Print version information for both the client and the server, and then exit. .SS "Adding to the song queue" .IX Subsection "Adding to the song queue" These commands will add to the queue of items to be played. Many of these commands accept a \fIfilelist\fR argument. A \fIfilelist\fR is a list of one or more files or directories. Any directories named in the list will be replaced by a list of files produced by recursively traversing the contents of the directory (unless the \fB\-\-no\-file\-munge\fR option or \fB\-\-no\-recurse\fR option is being used). Depending on the shuffling options specified when invoking \fBmoosic\fR, the list will be shuffled before being added to the Moosic server's queue. .IP "\fBappend\fR \fIfilelist\fR" 4 .IX Item "append filelist" Add the files to be played to the end of the song queue. .IP "\fBadd\fR \fIfilelist\fR" 4 .IX Item "add filelist" An alias for \*(L"append\*(R". .IP "\fBpl-append\fR \fIplaylist-file\fR ..." 4 .IX Item "pl-append playlist-file ..." Add the items listed in the given playlist files to the end of the song queue. If \*(L"\-\*(R" (a single dash) is given as the name of a playlist file, data will be read from from standard input instead of trying to read from a file named \*(L"\-\*(R". .IP "\fBpl-add\fR \fIplaylist-file\fR ..." 4 .IX Item "pl-add playlist-file ..." An alias for \*(L"pl-append\*(R". .IP "\fBprepend\fR \fIfilelist\fR" 4 .IX Item "prepend filelist" Add the files to be played to the beginning of the song queue. .IP "\fBpre\fR \fIfilelist\fR" 4 .IX Item "pre filelist" An alias for \*(L"prepend\*(R". .IP "\fBpl-prepend\fR \fIplaylist-file\fR ..." 4 .IX Item "pl-prepend playlist-file ..." Add the items listed in the given playlist files to the beginning of the song queue. If \*(L"\-\*(R" (a single dash) is given as the name of a playlist file, data will be read from from standard input instead of trying to read from a file named \*(L"\-\*(R". .IP "\fBmixin\fR \fIfilelist\fR" 4 .IX Item "mixin filelist" Add the files to the song queue and reshuffle the entire song queue. .IP "\fBpl-mixin\fR \fIplaylist-file\fR ..." 4 .IX Item "pl-mixin playlist-file ..." Add the items listed in the given playlist files to the song queue and reshuffle the entire song queue. If \*(L"\-\*(R" (a single dash) is given as the name of a playlist file, data will be read from from standard input instead of trying to read from a file named \*(L"\-\*(R". .IP "\fBreplace\fR \fIfilelist\fR" 4 .IX Item "replace filelist" Replace the current contents of the song queue with the songs contained in the filelist. .IP "\fBpl-replace\fR \fIplaylist-file\fR ..." 4 .IX Item "pl-replace playlist-file ..." Replace the current contents of the song queue with the songs named in the given playlists. .IP "\fBinsert\fR \fIfilelist\fR \fIindex\fR" 4 .IX Item "insert filelist index" Insert the given items at a given point in the song queue. The items are inserted such that they will precede the item that previously occupied the specified index. .IP "\fBpl-insert\fR \fIplaylist-file\fR ... \fIindex\fR" 4 .IX Item "pl-insert playlist-file ... index" Insert the items specified in the given playlist files at a specified point in the song queue. If \*(L"\-\*(R" (a single dash) is given as the name of a playlist file, data will be read from from standard input instead of trying to read from a file named \*(L"\-\*(R". .IP "\fBputback\fR" 4 .IX Item "putback" Reinsert the current song at the start of the song queue. .IP "\fBstagger-add\fR \fIfilelist\fR" 4 .IX Item "stagger-add filelist" Adds the file list to the end of the song queue, but only after rearranging it into a \*(L"staggered\*(R" order. This staggered order is very similar the order created by the \fBstagger\fR command (described below). Each element of the file list (before replacing directories with their contents) specifies a category into which the expanded file list will be divided. The staggered order of the list being added is formed by taking the first item from each category in turn until all the categories are empty. This may be a bit difficult to understand without an example, so here is a typical case: .Sp Initially, the queue contains a few items. .Sp .Vb 3 \& [0] /music/a.ogg \& [1] /music/b.mp3 \& [2] /music/c.mid .Ve .Sp Additionally, there are two directories that each contain a few files: .Sp .Vb 3 \& $ ls /music/X/ /music/Y/ \& X: \& 1.ogg 2.ogg 3.ogg \& \& Y: \& 1.ogg 2.ogg 3.ogg 4.ogg .Ve .Sp After executing \f(CW\*(C`moosic \-o stagger\-add /music/Y /music/X\*(C'\fR, the queue now contains: .Sp .Vb 10 \& [0] /music/a.ogg \& [1] /music/b.mp3 \& [2] /music/c.mid \& [3] /music/Y/1.ogg \& [4] /music/X/1.ogg \& [5] /music/Y/2.ogg \& [6] /music/X/2.ogg \& [7] /music/Y/3.ogg \& [8] /music/X/3.ogg \& [9] /music/Y/4.ogg .Ve .IP "\fBstagger-merge\fR \fIfilelist\fR" 4 .IX Item "stagger-merge filelist" Adds the given file list to the queue in an interleaved fashion. More specifically, the new song queue will consist of a list that alternates between the items from the given file list and the items from the existing song queu. For example, if the queue initially contains: .Sp .Vb 3 \& [0] /music/a.ogg \& [1] /music/b.mp3 \& [2] /music/c.mid .Ve .Sp And the \fI/music/Y/\fR directory contains: .Sp .Vb 1 \& 1.ogg 2.ogg 3.ogg 4.ogg .Ve .Sp Then, after executing \f(CW\*(C`moosic \-o stagger\-merge /music/Y\*(C'\fR, the queue will contain: .Sp .Vb 7 \& [0] /music/Y/1.ogg \& [1] /music/a.ogg \& [2] /music/Y/2.ogg \& [3] /music/b.mp3 \& [4] /music/Y/3.ogg \& [5] /music/c.mid \& [6] /music/Y/4.ogg .Ve .IP "\fBinterval-add\fR \fIinterval\fR \fIfilelist\fR" 4 .IX Item "interval-add interval filelist" Inserts the given songs into the current song queue with a regular frequency that is specified with the given \fIinterval\fR argument (which must be an integer). .Sp For example, if the queue initially contains: .Sp .Vb 7 \& [0] /music/a.mod \& [1] /music/b.mod \& [2] /music/c.mod \& [3] /music/d.mod \& [4] /music/e.mod \& [5] /music/f.mod \& [6] /music/g.mod .Ve .Sp And the \fI/music/Z\fR directory contains: .Sp .Vb 1 \& aleph.wav bet.wav gimmel.wav .Ve .Sp Then, after executing \f(CW\*(C`moosic \-o interval\-add 3 /music/Z\*(C'\fR, the queue will contain: .Sp .Vb 10 \& [0] aleph.wav \& [1] /music/a.mod \& [2] /music/b.mod \& [3] bet.wav \& [4] /music/c.mod \& [5] /music/d.mod \& [6] gimmel.wav \& [7] /music/e.mod \& [8] /music/f.mod \& [9] /music/g.mod .Ve .SS "Removing from the song queue" .IX Subsection "Removing from the song queue" These commands will remove from the queue of items to be played. .IP "\fBcut\fR \fIrange\fR" 4 .IX Item "cut range" Removes all song queue items that fall within the given range. .IP "\fBdel\fR \fIrange\fR" 4 .IX Item "del range" An alias for \*(L"cut\*(R". .IP "\fBcrop\fR \fIrange\fR" 4 .IX Item "crop range" Removes all song queue items that do not fall within the given range. .IP "\fBremove\fR \fIregex\fR ..." 4 .IX Item "remove regex ..." Remove all song queue items that match the given regular expression. If multiple regular expressions are given, any song that matches any one of the expressions will be removed. .IP "\fBfilter\fR \fIregex\fR ..." 4 .IX Item "filter regex ..." Remove all song queue items that do not match the given regular expression. If multiple regular expressions are given, only those songs that match all the regular expressions will remain afterward. .IP "\fBclear\fR" 4 .IX Item "clear" Clear the song queue. .IP "\fBwipe\fR" 4 .IX Item "wipe" Clear the song queue and stop the current song. .SS "Rearranging the song queue" .IX Subsection "Rearranging the song queue" These commands let you change the order of the items in the queue. .IP "\fBmove\fR \fIrange\fR \fIindex\fR" 4 .IX Item "move range index" Moves all items in the given range to a new position in the song queue. If you want to move items to the end of the queue, use \f(CW\*(C`\`moosic length\`\*(C'\fR as the final argument. For example, to move the first 10 songs to the end of the queue, use the following command: \f(CW\*(C`moosic move 0:10 \`moosic length\`\*(C'\fR .IP "\fBmove-pattern\fR \fIregex\fR \fIindex\fR" 4 .IX Item "move-pattern regex index" Moves all items that match the given regular expression to a new position in the song queue. .IP "\fBswap\fR \fIrange\fR \fIrange\fR" 4 .IX Item "swap range range" Causes the songs contained within the two specified ranges to trade places. .IP "\fBreshuffle\fR [\fIrange\fR]" 4 .IX Item "reshuffle [range]" Reshuffle the song queue. If a range is specified, only items that fall within that range will be shuffled. .IP "\fBshuffle\fR [\fIrange\fR]" 4 .IX Item "shuffle [range]" An alias for \*(L"reshuffle\*(R". .IP "\fBsort\fR [\fIrange\fR]" 4 .IX Item "sort [range]" Rearrange the song queue in sorted order. If a range is specified, only items that fall within that range will be sorted. .IP "\fBreverse\fR [\fIrange\fR]" 4 .IX Item "reverse [range]" Reverse the order of the song queue. If a range is specified, only items that fall within that range will be reversed. .IP "\fBpartial-sort\fR \fIregex\fR ..." 4 .IX Item "partial-sort regex ..." For each specified regular expression, the items in the song queue that match that expression are removed from the queue and gathered into their own list. All of these lists (plus the list of items that did not match any regular expression) are then stitched back together through simple concatenation. Finally, this unified list replaces the contents of the song queue. .Sp The items that match a particular regular expression will remain in the same order with respect to each other. Each group of matched items will appear in the reordered song queue in the order that the corresponding regular expressions were specified on the command line. .IP "\fBstagger\fR \fIregex\fR ..." 4 .IX Item "stagger regex ..." For each specified regular expression, the items in the song queue that match that expression are removed from the queue and gathered into their own list. All of these lists are then merged together in a staggered fashion. All the leftover items (i.e. the ones that weren't matched by any regex on the command line) are appended to this unified list, which then replaces the contents of the song queue. .Sp For example, if you use \f(CW\*(C`moosic stagger red blue green\*(C'\fR and the queue originally contains only names that either contain the string \*(L"red\*(R" or \*(L"blue\*(R" or \&\*(L"green\*(R", then the members of the reordered queue will alternate between \*(L"red\*(R" items, \*(L"blue\*(R" items, and \*(L"green\*(R" items. If the queue does contain items that are neither \*(L"red\*(R" nor \*(L"green\*(R" nor \*(L"blue\*(R", then these will be collected and placed at the end of the queue, after all the \*(L"red\*(R", \*(L"green\*(R", and \*(L"blue\*(R" items. .IP "\fBsub\fR \fIpattern\fR \fIreplacement\fR [\fIrange\fR]" 4 .IX Item "sub pattern replacement [range]" Perform a regular expression substitution on all items in the song queue. More precisely, this searches each queue item for the regular expression specified by the first argument, and replaces it with the text specified by the second argument. Any backslash escapes in the replacement text will be processed, including special character translation (e.g. \*(L"\en\*(R" to newline) and backreferences to groups within the match. If a range is given, then the substitution will only be applied to the items that fall within the range, instead of all items. Only the first matching occurrence of the pattern is replaced in each item. .IP "\fBsuball\fR \fIpattern\fR \fIreplacement\fR [\fIrange\fR]" 4 .IX Item "suball pattern replacement [range]" This is identical to the \*(L"sub\*(R" command, except that all occurrences of the pattern within each queue item are replaced instead of just the first occurrence. .SS "General management" .IX Subsection "General management" These commands affect the state of the Moosic server in various ways. .IP "\fBnext\fR [\fInumber\fR]" 4 .IX Item "next [number]" Stops the current song (if any), and jumps ahead to a song that is currently in the queue. The argument specifies the number of songs to be skipped, including the currently playing song. Its default value is 1. The skipped songs are recorded in the history as if they had been played. If queue advancement is disabled, this command merely stops the current song and removes the appropriate number of songs from the queue, and does not cause a new song to be played. .IP "\fBprevious\fR [\fInumber\fR]" 4 .IX Item "previous [number]" Retreats to a previously played song (from the history list) and begins playing it if queue advancement is enabled. If a number is given as an argument, then the music daemon will retreat by that number of songs. If no argument is given, then the music daemon will retreat to the most recent song in the history. More precisely, this command stops the current song (without recording it in the song history) and returns the most recently played song or songs to the queue. This command removes songs from the history when it returns them to the queue, thus modifying the song history. .Sp When loop mode is on, this command retreats into the tail end of the queue instead of the song history. This produces wrap-around behavior that you would expect from loop mode, and does not modify the song history. .IP "\fBprev\fR" 4 .IX Item "prev" An alias for \*(L"previous\*(R". .IP "\fBgoto\fR \fIregex\fR" 4 .IX Item "goto regex" Jumps to the next song in the queue that matches the given regular expression. .IP "\fBgobackto\fR \fIregex\fR" 4 .IX Item "gobackto regex" Jumps back to the most recent previous song that matches the given regular expression. .IP "\fBnoadvance\fR" 4 .IX Item "noadvance" Tell the music daemon to stop playing any new songs, but without interrupting the current song. In other words, this halts queue advancement. .IP "\fBnoadv\fR" 4 .IX Item "noadv" An alias for \*(L"noadvance\*(R". .IP "\fBadvance\fR" 4 .IX Item "advance" Tell the music daemon to resume queue advancement (i.e. play new songs when the current one is finished). Obviously, this has no effect if queue advancement hasn't been disabled. .IP "\fBadv\fR" 4 .IX Item "adv" An alias for \*(L"advance\*(R". .IP "\fBtoggle-advance\fR" 4 .IX Item "toggle-advance" Halts queue advancement if it is enabled, and enables advancement if it is halted. .IP "\fBstop\fR" 4 .IX Item "stop" Tell the music daemon to stop playing the current song and stop processing the song queue. The current song is put back into the song queue and is not recorded in the song history. .IP "\fBpause\fR" 4 .IX Item "pause" Suspend the current song so that it can be resumed at the exact same point at a later time. Note: this often leaves the sound device locked. .IP "\fBunpause\fR" 4 .IX Item "unpause" Unpause the current song, if the current song is paused, otherwise do nothing. .IP "\fBplay\fR" 4 .IX Item "play" Tell the music daemon to resume playing. (Use after \*(L"stop\*(R", \*(L"noadv\*(R", or \&\*(L"pause\*(R".) .IP "\fBloop\fR" 4 .IX Item "loop" Turn loop mode on. When loop mode is on, songs are returned to the end of the queue when they finish playing instead of being thrown away. .IP "\fBnoloop\fR" 4 .IX Item "noloop" Turn loop mode off. .IP "\fBtoggle-loop\fR" 4 .IX Item "toggle-loop" Turn loop mode on if it is off, and turn it off if it is on. .IP "\fBreconfigure\fR" 4 .IX Item "reconfigure" Tell the music daemon to reload its configuration file. .IP "\fBreconfig\fR" 4 .IX Item "reconfig" An alias for \*(L"reconfigure\*(R". .IP "\fBshowconfig\fR" 4 .IX Item "showconfig" Query and print the music daemon's filetype associations. .IP "\fBstart-server\fR [\fIoptions\fR]" 4 .IX Item "start-server [options]" Start a new instance of the music daemon (also known as \fBmoosicd\fR). If option arguments are given, they will be used as the options for invoking \fBmoosicd\fR. The options that are accepted by \fBmoosicd\fR can be found in its own manual page, moosicd(1). .IP "\fBexit\fR" 4 .IX Item "exit" Tell the music daemon to quit. .IP "\fBquit\fR" 4 .IX Item "quit" An alias for \*(L"exit\*(R". .IP "\fBdie\fR" 4 .IX Item "die" An alias for \*(L"exit\*(R". .SH "AUDIO CD SUPPORT" .IX Header "AUDIO CD SUPPORT" If you have the takcd program installed, and you have an appropriate entry for it in the Moosic server's player configuration, then you can play audio \s-1CD\s0 tracks with Moosic. The following entry should be in \fI~/.moosic/config\fR: .PP .Vb 2 \& (?i)^cda://(\eS*) \& takcd \e1 .Ve .PP To put \s-1CD\s0 tracks into the song queue, you should name them with the prefix \&\*(L"cda://\*(R", followed immediately by the number of the track you wish to play. For example, \f(CW\*(C`moosic \-n add cda://3\*(C'\fR will add the third track on the \s-1CD\s0 to the end of the song queue. .PP The takcd program can be found at . .SH "FILES" .IX Header "FILES" .IP "\fIsocket\fR" 4 .IX Item "socket" This is a socket file which is used to allow Moosic clients to contact the Moosic server. It is generally located in the \fI~/.moosic/\fR directory, unless \&\fBmoosicd\fR was invoked with the \fB\-c\fR/\fB\-\-config\fR option. .SH "SEE ALSO" .IX Header "SEE ALSO" moosicd(1), for details on invoking the Moosic server by hand. .PP Various \fBmoosic\fR commands accept regular expressions arguments. The syntax used for these regular expressions is identical to the syntax used by Python's regular expression library. The details of this syntax are explained in the chapter entitled \*(L"Regular Expression Syntax\*(R" http://www.python.org/doc/current/lib/re\-syntax.html from the section dealing with the \fBre\fR module in the \fIPython Library Reference\fR. .SH "AUTHOR" .IX Header "AUTHOR" Daniel Pearson