;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@31 libmpdee version information. (defvar libmpdee-version "2.1" (#$ . 87)) (byte-code "\300\301!\210\300\302!\207" [require custom wid-edit] 2) #@54 Widget format handler for the MPD connection widget. (defalias 'widget-mpd-format-handler #[(widget esc) "\302=\203\303 \304\305#\210\306c\210\307\310\311\312\313$\207\314\315\316!\317\" \"\207" [esc widget 108 widget-create-child-and-convert documentation-string "This variable specifies a MPD connection.\nThe value is a list of the mpd host name, port number, and the timeout for\nserver replies. See `mpd-conn-new' for more details." "To know more about libmpdee, read " widget-create emacs-commentary-link :tag "this" "libmpdee" widget-get widget-convert lazy :format-handler] 5 (#$ . 234)]) #@127 Initialize unset parameters for a MPD connection. Replace parameters in the MPD connection VAL with sane defaults and return. (defalias 'mpd-connection-tidy #[(val) "\204\301\211<\203@@\204\302\303!\206\304\240\203@A\211\203@@\2040\305\240\203@A\211\203@@\204@\306\240\210)\207" [val (nil nil nil) getenv "MPD_HOST" "localhost" 6600 10.0] 4 (#$ . 842)]) (byte-code "\300\301\302\303\304\305\306\307\310\311\312\313\314\315& \210\316\317\320\321\322\323\322\324\325\326& \210\327\330\331\332\314\333\322\317&\210\327\334\335\336\314\301\322\317&\210\337\340\341\342\322\317%\210\337\343\344\345\322\317%\210\337\346\347\350\322\317%\210\337\351\352\353\322\317%\207" [define-widget mpd-connection lazy "A widget for a MPD connection." :tag "MPD Connection" :format "%{%t%}:\n\n%l\n\n%v" :format-handler widget-mpd-format-handler :value-to-internal (lambda (wid val) (mpd-connection-tidy val)) :type (list :format "%v" (string :format "%t: %v\n" :tag "Hostname" :size 15) (integer :format "%t: %v\n" :tag "Port" :size 5 :match (lambda (widget value) (> value 0)) :type-error "Port must be a natural number") (float :format "%t: %v\n\n" :tag "Timeout" :size 10 :match (lambda (widget value) (> value 0)) :type-error "Timeout must be a positive number")) custom-declare-group mpd nil "The client end library for MPD, the music playing daemon." :group external multimedia :link (emacs-commentary-link "libmpdee") custom-declare-variable mpd-db-root (getenv "MPD_DB_ROOT") "*MPD database directory root." directory mpd-interactive-connection-parameters (mpd-connection-tidy nil) "Parameters for the interactive mpd connection.\nThese determine the connection used by interactive functions in `libmpdee'." custom-declare-face mpd-separator-face ((((background dark)) (:foreground "lightyellow")) (((background light)) (:foreground "darkgreen"))) "Face for display of separator lines in interactive mpd queries." mpd-header-face ((((background dark)) (:foreground "gold")) (((background light)) (:foreground "brown"))) "Face for display of header lines in interactive mpd queries." mpd-first-field-face ((((background dark)) (:foreground "cyan")) (((background light)) (:foreground "orange"))) "Face for display of the first field in interactive mpd queries.\nMost lines in interactive displays are split into two fields." mpd-second-field-face ((((background dark)) (:foreground "lightgreen")) (((background light)) (:foreground "blue"))) "Face for display of the second field in interactive mpd queries.\nMost lines in interactive displays are split into two fields."] 14) (defconst mpd-welcome-message " MPD ") (defalias 'mpd-welcome-length '(macro . #[nil "G\207" [mpd-welcome-message] 1])) (defconst mpd-ver-string-length 3) #@185 Ensure that OBJ succeeds on type checking with predicate FUNC. The function emits a "Wrong type argument" signal on failure. Note that the arguments are evalled twice in this process. (defalias 'mpd-assert-type '(macro . #[(obj func) "\302 D\303\304\305\306D EEE\207" [func obj or signal 'wrong-type-argument list quote] 7 (#$ . 3607)])) (defalias 'mpd-assert-string '(macro . #[(obj) "\301\302BB\207" [obj mpd-assert-type (stringp)] 3])) (defalias 'mpd-assert-wholenump '(macro . #[(obj) "\301\302BB\207" [obj mpd-assert-type (wholenump)] 3])) (defalias 'mpd-assert-numberp '(macro . #[(obj) "\301\302BB\207" [obj mpd-assert-type (numberp)] 3])) #@139 Convert string STR to a number strictly. Return nil if there are any unmatched characters. Allow negative numbers if ALLOWNEG is non-nil. (defalias 'mpd-string-to-number-strict #[(str &optional allowneg) "\303!\n\203 \247\202\304 !\205\305 !\230\205 )\207" [str num allowneg string-to-number wholenump number-to-string] 3 (#$ . 4266)]) (put 'mpd-string-to-number-strict 'side-effect-free t) #@130 Split STR into newline separated lines. Differ from `split-string' in that tokens are created for leading and trailing newlines. (defalias 'mpd-get-lines #[(str) "\302\303\"\211\205'\304H\305U\203\306 B\211GSH\305U\203& \306C\244\202' )\207" [str packets split-string "\n" 0 10 ""] 4 (#$ . 4675)]) #@111 Sort and remove multiples in list L. Use LESSP and EQP as predicates for the "lesser" and "equal" operations. (defalias 'mpd-sort-uniq-list #[(l lessp eqp) "\304 \"\211\211\203*\nA\203# \n@\nA@\"\203#\n\211AA\241\210\202 \nA\211\204 )\207" [l lessp m eqp sort] 4 (#$ . 4990)]) #@62 Evaluate ARGS while temporarily widening the current buffer. (defalias 'with-mpd-temp-widen '(macro . #[(&rest args) "\301\302BB\207" [args save-restriction (widen)] 3 (#$ . 5283)])) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put with-mpd-temp-widen lisp-indent-function 0 edebug-form-spec (body)] 4) #@60 Evaluate ARGS with temporary widening and saved excursion. (defalias 'with-mpd-free-buffer '(macro . #[(&rest args) "\301\302BD\207" [args save-excursion with-mpd-temp-widen] 3 (#$ . 5605)])) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put with-mpd-free-buffer lisp-indent-function 0 edebug-form-spec (body)] 4) #@90 Reverse LIST if it is a list, leave alone otherwise. Note that LIST is evaluated thrice. (defalias 'mpd-safe-nreverse '(macro . #[(list) "\301\302D\303DF\207" [list if listp nreverse] 4 (#$ . 5937)])) #@203 Operate the sequence SEQ on SPEC depending on its type. Add a copy of SEQ to SPEC, if it's a list and call it with SEQ as an argument followed by other ARGS specified, if it is a function. Return SPEC. (defalias 'mpd-seq-add #[(seq &optional spec &rest args) "\303!\204\f\304 !B\207\305 \n#\210\207" [spec seq args functionp copy-sequence apply] 4 (#$ . 6148)]) #@191 Operate the object ELT on SPEC depending on its type. Add ELT to SPEC, if it's a list and call it with ELT as an argument followed by other ARGS specified, if it is a function. Return SPEC. (defalias 'mpd-elt-add #[(elt &optional spec &rest args) "\303!\204\n B\207\304 \n#\210\207" [spec elt args functionp apply] 4 (#$ . 6522)]) #@101 Parse line STR of form "KEY: VALUE" to a cons (KEY . VALUE). Return (STR . nil) on a parse failure. (defalias 'mpd-parse-line #[(str) "\301\302\"\203\303\304\"\303\305\"B\207C\207" [str string-match "^\\([^:]*\\): ?\\(.*\\)$" match-string 1 2] 4 (#$ . 6865)]) #@60 Quote and escape string STR for sending to the mpd server. (defalias 'mpd-safe-string #[(str) "\205!\302\303\304 #\203\302\225T\305\306\307\310$\202\311\311Q)\207" [str start 0 string-match "[\\\"]" replace-match "\\\\\\&" t nil "\""] 5 (#$ . 7137)]) #@53 Return t if CONN is a connection to the mpd server. (defalias 'mpd-connp #[(conn) "\301!\205\nG\302U\207" [conn vectorp 10] 2 (#$ . 7406)]) (put 'mpd-connp 'side-effect-free 'error-free) (defalias 'mpd-conn-strongp #[(conn) "\302!\205E\303\304H!\205E\304HG U\205E\305H\203%\306\305H!\205E\307H;\205E\310H\2039\310H\247\205E\311H;\205E\312\313H!\207" [conn mpd-ver-string-length mpd-connp vectorp 0 1 processp 2 6 7 wholenump 8] 3]) (put 'mpd-conn-strongp 'side-effect-free 'error-free) (defalias 'mpd-assert-mpd-conn '(macro . #[(conn) "\301\302BB\207" [conn mpd-assert-type (mpd-connp)] 3])) #@61 Assert mpd connection CONN to be free to receive a command. (defalias 'mpd-assert-idle #[(conn) "\301!\204 \302\303\301D\"\210\304H;\206\"\305\304H<\203 \306\202!\307!\207" [conn mpd-connp signal wrong-type-argument 4 error "Command list mode has not ended" "Not done processing current command"] 4 (#$ . 8028)]) #@87 Abort mpd conection CONN and signal error. `format' error message using FMT and ARGS. (defalias 'mpd-end-conn #[(conn fmt &rest args) "\303H\203\304\303H!\210\303\305I\210\306\307\310\311 \n#C\"\207" [conn fmt args 1 delete-process nil signal error apply format] 6 (#$ . 8355)]) #@108 Abort current mpd command for connection CONN and signal error. `format' error message using FMT and ARGS. (defalias 'mpd-end-cmd #[(conn fmt &rest args) "\303\304I\210\305\306\307 \n#I\210\310\311\306\307 \n#C\"\207" [conn fmt args 5 nil 4 apply format signal error] 6 (#$ . 8646)]) #@237 Filter replies received from the mpd server. CONN represents the connection object for which the filter is invoked. STR is the packet received from the server to be processed. This is an internal function, do not use this in your code. (defalias 'mpd-process-filter #[(conn str) "\306H\307=\203\310\310HG\311\211\211\312W\203\313\202 \312Z\310\310H\fPI\210\314\315\310H \311O\"\211\203:\n \\\316H\307=\204\271\n\313=?\205V\317\310H\313\n\205T\nSO!\n\203j\310\310H\n\311OI\210\313\202\216 A\203\206\320 \310\"\310A@I\210\311\241\210)\202\216\310 @I\210\311\321\316H!\203\236\322\323 \"\210\202\270\316H<\203\264\316\322\324 \"\316H\244I\210\202\270\325\326!\210)\n\205\306\306\nI\210\327\330\"+\207\306H\247\205\310\310H\fPI\210\306H\314\331\310H#\211\205\306\310H\312\310HH\332=I\203\310\202\306\\OI\210\310\310H\313OI\210\333\334\311\"*\207" [conn case-fold-search status start str packets 4 t 2 nil 5 0 string-match "^\\(ACK:? \\|OK\\)" 3 mpd-get-lines last functionp mapcar (lambda (str) (funcall (_mpdgl) conn (mpd-parse-line str))) mpd-parse-line error "Invalid line mode filter" mpd-process-filter "" "\n" 79 throw mpd-response-over resp-end bufend] 9 (#$ . 8939)]) #@268 Do an I/O transacton with the mpd server. Use connection CONN for contacting the server. MODE is as described in `mpd-execute-command'. Send INPUT, if non-nil, to the server before waiting for the response. This is an internal function, do not use this in your code. (defalias 'mpd-transact #[(conn &optional mode input) "\304\305I\210\306 I\210\307\310I\210\311\216\312H \203 \313\314H \"\210\307H;?\205U\3152Q\316\314H\n\2057\n\317\245\n\205?\320\n\317\"#\206P\316\314H\321\211#\206P\322\323!0\210\202 *\207" [conn mode timeout input 2 #1="" 3 4 t #[nil "\301H;?\205\302\303I\210\301\304I\210\305\304I\207" [conn 4 5 nil #1# 2] 3] 6 process-send-string 1 mpd-response-over accept-process-output 1000 mod 0 error "Timed out getting a response from the mpd server"] 6 (#$ . 10201)]) #@520 Construct a mpd connection object from given parameters. Connections made using this object are made to host HOST at port number PORT. TIMEOUT is a floating-point value specifying the number of seconds to wait before giving up waiting for a reply from the server. Unspecified or zero TIMEOUT correspond to infinite timeout. Set automatic mode if NOAUTO is nil, hooked automatic function if NOAUTO is a function, and do not set automatic mode otherwise. See `mpd-set-automatic-mode' for a description of automatic mode. (defalias 'mpd-conn-new #[(host port &optional timeout noauto) ";\203\305 !\203\n\203\n\247\204\306\307!\210\n\2031\n\310U\203'\311\2021\n\310V\2041\306\312!\210\313\314 \311\"\311\315\311\315\311\n\205D\316\n\317_! \f\203T\320\f!\205U\f\202U\321&\n\207" [host port timeout mpd-ver-string-length noauto wholenump error "Invalid parameters passed for making new connection" 0 nil "Invalid (negative) timeout value" vector make-vector "" floor 1000 functionp t] 12 (#$ . 11014)]) #@306 Connect to the mpd server using the connection object CONN. The connection object is constructed using `mpd-conn-new'. Note that this function doesn't need to be explicitly called when the connection is in automatic mode (the default). Close the connection using `mpd-close-connection' when you are done. (defalias 'mpd-connect #[(conn) "\306\211\211\307\310\306 \311H \312H$\206\313\314! \315H\203#\316 \315H!\210 \315\nI\210\317\n\306\"\210\320\n\321\211#\210\322\n\323\324\325 \326BBE\"\210\327\216\330 \331\"\210) \332H\211\333\334O\f\230\204_\335 \336 \312H \311H$\210\337\334\306O\340\"\211G%U\204t\335 \341\"\210\333\211&%W\203\234 \333H&\342 \211A\242!I\204\223\335 \341\"\210&T\211&\202x-\343\344!\207" [welc rt proc conn mpd-welcome-message verlist nil open-network-stream "mpd" 7 8 error "Unable to open connection with mpd" 1 delete-process set-process-query-on-exit-flag set-process-coding-system utf-8-unix set-process-filter lambda (proc str) mpd-process-filter (str) #[nil "\301H\206 \302\303\304H#\207" [conn 5 mpd-end-conn "Handshake failed, server returned: %s" 4] 5] mpd-transact t 4 0 5 mpd-end-conn "Process mpd not running on port %d in host \"%s\"" split-string "[\\.\n]" "Error parsing version information from server" mpd-string-to-number-strict message "Opened connection with mpd" mpd-ver-string-length i] 8 (#$ . 12037)]) (make-obsolete 'mpd-new-connection "use `mpd-conn-new' to create a connection object. If automatic mode is not used, a call to `mpd-connect' might be necessary." "2.1") #@453 Create a new connection and connect using it to the mpd server. Return a connection object, which could be used for further transactions with the server. See `mpd-conn-new' for a description of the parameters. Close the connection using `mpd-close-connection' when you are done. This function is deprecated since version 2.1. Use `mpd-conn-new' to create a connection object. If automatic mode is not used, a call to `mpd-connect' might be necessary. (defalias 'mpd-new-connection #[(host port &optional timeout noauto) "\305 \n $\306\f!\210\f)\207" [host port timeout noauto conn mpd-conn-new mpd-connect] 5 (#$ . 13590)]) #@73 Try to ensure that the MPD connection is alive, when in automatic mode. (defalias 'mpd-conn-wakeup #[(conn) "\301!\210\302H\205\303\302H!\304=?\205I\305H\205I\306\305H!\205)\305H\307\"?\205I\302H\2037\310\311!\210\312!\210\306\305H!\205I\305H\313\"\207" [conn mpd-assert-idle 1 process-status open 9 functionp pre message "Connection with mpd broken, attempting reconnect" mpd-connect post] 3 (#$ . 14223)]) #@879 Send the command CMD to the mpd server using CONN. Append a newline to CMD before sending to the server. Use the value of MODE to decide how the response of the command is processed. MODE could take one of the following values: - A list, usually nil, to which cons-cells got by formatting each line of the response, except the last one, using `mpd-parse-line', are appended. The new list thus got is the result of the function. - t, by which all response before the last line, as a string, is the result of the function. - A function, by which each cons-cell, got as described above, is sent to this function. Two parameters are passed to the function, the connection object and this cons-cell. An empty string is the result. Return a cons-cell, whose car is non-nil if the server succeeds, and cdr is the result as specified in the description of MODE above. (defalias 'mpd-execute-command #[(conn cmd &optional mode) "\303!\210\304 \n\305P#\210\306H\211\306H\203.\307H\310=\204&\311\307H!\203*\312\202/\307\202/\313HB\312\314I\210\207" [conn mode cmd mpd-conn-wakeup mpd-transact "\n" 5 3 t functionp 2 4 ""] 5 (#$ . 14658)]) #@247 Execute mpd command CMD using CONN ignoring response. Note that an OK/ACK message still has to come. Return non-nil iff the command succeeds. `mpd-get-last-error' gives the server error message in case of failure. See also `mpd-execute-command'. (defalias 'mpd-simple-exec #[(conn cmd) "\302H<\204\303 \304#@\207\302 \302HBI\210\304\207" [conn cmd 4 mpd-execute-command t] 5 (#$ . 15823)]) #@48 Close the mpd server connection given by CONN. (defalias 'mpd-close-connection #[(conn) "\301!\210\302H\205\303\302H!\210\302\304I\207" [conn mpd-assert-idle 1 delete-process nil] 3 (#$ . 16225)]) #@57 The global mpd connection used for interactive queries. (defvar mpd-inter-conn (byte-code "\301\302\303\304!\305\"\"\207" [mpd-interactive-connection-parameters apply mpd-conn-new append mpd-connection-tidy (nil)] 5) (#$ . 16434)) #@139 Get version information for the mpd server CONN is connected to. Return a vector of three numbers, for the major, minor and patch levels. (defalias 'mpd-get-version #[(conn) "\301!\204 \302\303\301D\"\210\304H\304H\204\305!\210\304H\207" [conn mpd-connp signal wrong-type-argument 0 mpd-conn-wakeup] 4 (#$ . 16673)]) (byte-code "\300\301\302\303#\304\301\305\306#\210\304\301\307\310#\207" [function-put mpd-get-version speed -1 put byte-optimizer byte-compile-inline-expand side-effect-free t] 5) #@109 Get the last server error message for mpd connection CONN. Return nil in case of a successful last command. (defalias 'mpd-get-last-error #[(conn) "\301!\204 \302\303\301D\"\210\304H?\205\305H\207" [conn mpd-connp signal wrong-type-argument 5 4] 4 (#$ . 17186)]) (byte-code "\300\301\302\303#\304\301\305\306#\210\304\301\307\310#\207" [function-put mpd-get-last-error speed -1 put byte-optimizer byte-compile-inline-expand side-effect-free t] 5) #@91 Get the timeout of mpd connection CONN. Return nil if CONN isn't a mpd connection object. (defalias 'mpd-get-connection-timeout #[(conn) "\301!\204 \302\303\301D\"\210\304H\207" [conn mpd-connp signal wrong-type-argument 6] 4 (#$ . 17646)]) (byte-code "\300\301\302\303#\304\301\305\306#\210\304\301\307\310#\207" [function-put mpd-get-connection-timeout speed -1 put byte-optimizer byte-compile-inline-expand side-effect-free t] 5) #@90 Set the timeout of mpd connection object CONN to TIMEOUT. See also `mpd-new-connection'. (defalias 'mpd-set-connection-timeout #[(conn timeout) "\302!\203 \203 \247\204\303\304!\207 \305U\203\306\307 I\207" [conn timeout mpd-connp error "Invalid parameters used to set connection timeout" 0 nil 6] 3 (#$ . 18089) (list mpd-inter-conn (string-to-number (read-string "Connection timeout (None): " (let ((timeout (mpd-get-connection-timeout mpd-inter-conn))) (and timeout (number-to-string timeout))))))]) #@182 Return the automatic mode value for mpd connection CONN. See `mpd-set-automatic-mode' for a description of automatic mode. Return value is like the MODE parameter of that function. (defalias 'mpd-get-automatic-mode #[(conn) "\301!\204 \302\303\301D\"\210\304H\207" [conn mpd-connp signal wrong-type-argument 9] 4 (#$ . 18610)]) (byte-code "\300\301\302\303#\304\301\305\306#\210\304\301\307\310#\207" [function-put mpd-get-automatic-mode speed -1 put byte-optimizer byte-compile-inline-expand side-effect-free t] 5) #@859 Set the automatic mode for mpd connection CONN. Set automatic mode iff MODE is non-nil. Set to hooked automatic mode if the non-nil MODE is a function. The connection is said to be in automatic mode if it connects on demand (usually as a result of a server request using the connection) and takes care of reconnecting whenever the connection gets broken. The automatic mode could be hooked by specifying a function. In this case, the function is called with two parameters, the connection object and the second parameter being the symbol 'pre or 'post. The function is called with 'pre when reconnection is needed. If the function returns a non-nil value, it is assumed that the function has done the reconnection. Else, the library reconnects by itself, and the function is once again called after that, with the parameter 'post (Return value is ignored). (defalias 'mpd-set-automatic-mode #[(conn mode) "\302!\204 \303\304\302D\"\210\305 I\207" [conn mode mpd-connp signal wrong-type-argument 9] 4 (#$ . 19137)]) (byte-code "\300\301\302\303#\304\301\305\306#\210\307\310\311\312#\210\313\310\311\314#\210\307\315\301\312#\207" [function-put mpd-set-automatic-mode speed -1 put byte-optimizer byte-compile-inline-expand make-obsolete mpd-get-reconnectible mpd-get-automatic-mode "2.1" defalias "Return t if CONN reconnects when its mpd connection breaks.\nThis function is deprecated since version 2.1.\nUse `mpd-get-automatic-mode' instead." mpd-make-reconnectible] 5) #@201 Make CONN reconnectible when its mpd connection breaks. Unset the reconnectibility on non-nil prefix arg NORECONN. This function is deprecated since version 2.1. Use `mpd-set-automatic-mode' instead. (defalias 'mpd-make-reconnectible #[(conn &optional noreconn) " ?\303!\204\304\305\303D\"\210\306\nI*\207" [conn noreconn mode mpd-connp signal wrong-type-argument 9] 4 (#$ . 20621)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put mpd-make-reconnectible speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@401 Force the mpd connection CONN to accept the next command. *WARNING* DON'T use this unless you are really desperate. Shelf this off for debugging purposes. Normally, the package should signal correctly whether it is safe to receive the next command. Doing this could mean losing out on the response of the current command, and worse, the response of the current command could creep into the next one. (defalias 'mpd-force-accept-command #[(conn) "\301!\203\n\302\303!\207\304\305I\210\306\307I\210\310\307I\207" [conn mpd-command-list-mode-p error "Command list mode has not ended" 5 nil 4 "" 2] 3 (#$ . 21168)]) #@328 Start the command-list mode for CONN. Only commands that can be used with `mpd-simple-exec' are allowed in command-list mode. Commands can be issued as they are usually done. Always return t, as the commands are queued up and not sent to the server. `mpd-command-list-end' ends the command-list and executes the list built up. (defalias 'mpd-command-list-begin #[(conn) "\301!\210\302\303I\210\304\303I\207" [conn mpd-assert-idle 5 nil 4] 3 (#$ . 21792)]) #@64 Return non-nil if mpd connection CONN is in command list mode. (defalias 'mpd-command-list-mode-p #[(conn) "\301!\204 \302\303\301D\"\210\304H<\207" [conn mpd-connp signal wrong-type-argument 4] 4 (#$ . 22257)]) (put 'mpd-command-list-mode-p 'side-effect-free t) #@107 End command-list mode for CONN. This function needs to be preceded by a call to `mpd-command-list-begin'. (defalias 'mpd-command-list-end #[(conn) "\302!\204\n\303\304!\210\305\306\307\310\311H\237\312#\313Q\311\314I\210\315 \")\207" [conn str mpd-command-list-mode-p error "The connection is not in command-list mode" nil "command_list_begin\n" mapconcat (lambda (item) item) 4 "\n" "\ncommand_list_end" "" mpd-simple-exec] 5 (#$ . 22531)]) #@183 Get the status of mpd connection CONN. Return one of 'busy for being in the midst of a request, 'ready for the ready state, and 'command-list to indicate being in command-list mode. (defalias 'mpd-connection-status #[(conn) "\301!\204 \302\303\301D\"\210\304H<\203\305\207\304H;\203\306\207\307\207" [conn mpd-connp signal wrong-type-argument 4 command-list ready busy] 4 (#$ . 22987)]) (put 'mpd-connection-status 'side-effect-free t) (defalias 'with-mpd-timeout-disabled '(macro . #[(&rest args) "\301\302\303\304\305\301\306BB\307BBEE\207" [args progn (mpd-assert-mpd-conn conn) let ((timeout (_mpdgt))) unwind-protect (_mpdst nil) ((_mpdst timeout))] 8])) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put with-mpd-timeout-disabled lisp-indent-function 0 edebug-form-spec (body)] 4) #@174 Handle song data response from the mpd server. See `mpd-execute-command' for a description of response handlers. This is an internal function, do not use this in your code. (defalias 'mpd-song-receiver #[(conn cell) "@\211\305\230\206\f \306\230?\205= \307\230\203&\310\n\311\"\203$\312\313\n \f$\314\315\n\316 ! \317\235\2038\320A!\202:A#\211)\207" [cell key mpd-song-receiver foreach mpd-song-receiver-args "directory" "playlist" "file" plist-get file apply mpd-seq-add nil plist-put intern ("Time" "Pos" "Id") string-to-number] 6 (#$ . 23802)]) #@636 Get details of songs from the mpd server using connection CONN. Use command CMD to get the songs. Call function FOREACH, if specified, for each song, with the song provided as the argument. Return list of all songs if FOREACH is not specified and FOREACH otherwise. When a list is returned, each element of the list is a property list, some known keys being `file', `Pos' and `Id'. The last two keys, along with `Time' if present, have integers as their value. `Time' refers to the total length of the song. `Pos' and `Id' are present only when the song retrieved is a part of a playlist. Other song tag data might be present as well. (defalias 'mpd-get-songs #[(conn cmd &optional foreach) "\305!\204\306\306\211\307 \f\302#\210\n\203\310\n\"<\203%\237\202&*\207" [foreach mpd-song-receiver-args mpd-song-receiver conn cmd functionp nil mpd-execute-command mpd-seq-add] 4 (#$ . 24370)]) #@343 Make mpd command string using command CMD and argument ARG. ARG could be a string or a list of strings. If NORMAL-NIL is non-nil, do nothing if ARG is nil, and return CMD for nil NORMAL-NIL and ARG. Use command list mode implicitly for lists. Sanitize arguments before composition. This is an internal function, do not use this in your code. (defalias 'mpd-make-cmd-concat #[(cmd arg &optional normal-nil) "\204\n \204\n\n\207<\203\303\304\305\306#\307Q\207\n\310\311!Q\207" [arg normal-nil cmd "command_list_begin\n" mapconcat (lambda (item) (concat cmd " " (mpd-safe-string item))) "\n" "\ncommand_list_end" " " mpd-safe-string] 5 (#$ . 25280)]) (put 'mpd-make-cmd-concat 'side-effect-free t) #@281 Make mpd command string with format CMD and arguments ARG1, ARG2. ARG1/ARG2 could be a list of arguments each. Use command list mode implicitly for lists. Send each of the arguments pairs to VALIDATE before composition. This is an internal function, do not use this in your code. (defalias 'mpd-make-cmd-format #[(cmd validate arg1 &optional arg2) "<\203!  \203G GU\204\305\306!\210\307\310\311\312#\313Q)\207 \203*  \"\210\314\f #\207" [arg1 arg2 tail2 validate cmd error "Argument lists are of unequal lengths" "command_list_begin\n" mapconcat (lambda (item) (and validate (funcall validate item (car tail2))) (prog1 (format cmd item (car tail2)) (setq tail2 (cdr tail2)))) "\n" "\ncommand_list_end" format] 5 (#$ . 25990)]) #@49 Insert STR as a line to the mpd display buffer. (defalias 'mpd-line-to-buffer #[(str) "r\301\302!q\210\212\214~\210db\210\303Pc\210\304p!+\207" [str get-buffer-create "*mpd-display*" "\n" display-buffer] 2 (#$ . 26735)]) #@126 Make a separator line for insertion to the mpd display buffer. The number of columns used is 80, unless specified using NUM. (defalias 'mpd-separator-line #[(&optional num) "\301\302\206\303\304\"\305P\306\307#\207" [num propertize make-string 80 42 "\n" face mpd-separator-face] 4 (#$ . 26964)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put mpd-separator-line speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@210 Initialize the mpd display buffer using strings STR1, STR2, STR3. Layout as follows: STR1 if non-empty ***...*** if STR1 is non-nil STR2 if non-empty ***...*** if STR2 is non-nil STR3 if non-empty (defalias 'mpd-init-buffer #[(&optional str1 str2 str3) "G G]\nG]r\305\306!q\210\307 \210\310\205%\311\230?\205%\312\310P\313\314#\205: \312\315\f\2062\316\317\"\310P\313\320#) \205E\312 \310P\313\314#\n\205Z \312\315\f\206R\316\317\"\310P\313\320#)\n\205l\n\311\230?\205l\312\n\310P\313\314#\310\260c*\207" [str1 str2 str3 max num get-buffer-create "*mpd-display*" erase-buffer "\n" "" propertize face mpd-header-face make-string 80 42 mpd-separator-face] 9 (#$ . 27415)]) #@105 Format to a colorized line of form "\nDESC: VAL". Include the separating colon unless NOSEP is non-nil. (defalias 'mpd-render-field #[(desc val &optional nosep) "\205\303\230?\205\304 \305\306#\n?\205\307\304\305\310#\311R\207" [val desc nosep "" propertize face mpd-first-field-face ": " mpd-second-field-face "\n"] 6 (#$ . 28123)]) (put 'mpd-render-field 'side-effect-free t) #@423 Display property list PLIST as a pretty table in the display buffer. TABLE is a list of entries is used to translate between keys and strings displayed. Each entry of the table is a list of the key symbol, the corresponding string to display, and optionally a function to call with the value to get the string to display as the value. If the string to display is nil, then those keys are ignored and not displayed at all. (defalias 'mpd-render-plist #[(plist table) "\205\203\306\307\211\211\211\211\211\203h@A@ \203^\f\203^ \236\211\2038 A@\202;\310 ! AA@\n\203^\311\312\313\n\"\312\314 \203X \f!\202Y\f\"\"PAA\211\204\315\316\307\317\320\206w\321\322\"\316P\323\324#)Q!.\207" [plist filter trans entry value key "" nil symbol-name mpd-render-field format "%-13s" "%s" mpd-line-to-buffer "\n" propertize make-string 80 42 face mpd-separator-face str ptr table num] 8 (#$ . 28517)]) (defconst mpd-display-song-key-table '((Time "Length" (lambda (time) (format "%s seconds" time))) (file "Filename") (Pos) (Id))) #@55 Display mpd song data SONG in the mpd display buffer. (defalias 'mpd-display-song #[(song) "\302 \"\207" [song mpd-display-song-key-table mpd-render-plist] 3 (#$ . 29584)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put mpd-display-song speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@63 Display playlist item with TITLE and index NUM in mpd buffer. (defalias 'mpd-display-playlist-item #[(title num) "\302\303\304\305T\"\306\307#\303 \306\310#P!\207" [num title mpd-line-to-buffer propertize format "%4d " face mpd-first-field-face mpd-second-field-face] 6 (#$ . 29906)]) #@62 Display mpd directory information to the mpd display buffer. (defalias 'mpd-display-dir-info #[(item type) "\305=\203 \306\n \")\207\307\310\311=\203\312\202\313 \"\314\315\316\317\f\206'\320\321\"\314P\322\323#)Q!\207" [type item song mpd-display-song-key-table num file mpd-render-plist mpd-line-to-buffer mpd-render-field playlist "Playlist " "Directory " "\n" nil propertize make-string 80 42 face mpd-separator-face] 7 (#$ . 30199)]) #@58 Display mpd directory listing to the mpd display buffer. (defalias 'mpd-display-dir-listing #[(item dir) "\303\304\203\n\305\202 \306 \"\307\310\311\312\n\206\313\314\"\307P\315\316#)Q!\207" [dir item num mpd-line-to-buffer mpd-render-field "Directory " "File " "\n" nil propertize make-string 80 42 face mpd-separator-face] 7 (#$ . 30660)]) #@52 Display a bulleted line to the mpd display buffer. (defalias 'mpd-display-bullet #[(str) "\301\302\303\304\305\"\306#!\207" [str mpd-line-to-buffer mpd-render-field " o " format "%s" t] 6 (#$ . 31019)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put mpd-display-bullet speed -1 put byte-optimizer byte-compile-inline-expand] 5) (defconst mpd-display-output-key-table '((outputid "ID") (outputname "Name") (outputenabled "Enabled" (lambda (enabled) (cond ((eq enabled t) "Yes") ((eq enabled nil) "No") (t enabled)))))) #@54 Display mpd output OUTPUT in the mpd display buffer. (defalias 'mpd-display-output #[(output) "\302 \"\207" [output mpd-display-output-key-table mpd-render-plist] 3 (#$ . 31563)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put mpd-display-output speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@319 Read a number from the minibuffer. Display PROMPT as the prompt string prefix. Append the DEFAULT value, if present, in brackets. Return the number read. Unless ZERO is non-nil, add default value by one before operation, and decrement number read by 1 before returning. If ALLOWNEG is non-nil, allow negative numbers. (defalias 'mpd-read-item #[(prompt &optional default zero allowneg) "\306\211\n\203\307 \203\n\202\nT!\310\311\f\n\205 \312\313Q\314Q\306\211$ \"\211\2036 \2046 S\2027 *\207" [str num default zero prompt allowneg nil number-to-string mpd-string-to-number-strict read-string " (" ")" ": "] 7 (#$ . 31895)]) #@187 Handle response for the 'status' command to the mpd server. See `mpd-execute-command' for a description of response handlers. This is an internal function, do not use this in your code. (defalias 'mpd-status-receiver #[(lsym cell) "@\211\303\235\203\304\n\305 !\306A!#\202\224 \307\230\2030A\310\235\205\224\304\n\305 !\305A!#\202\224 \311\230\203X\312\313A\"\205\224\304\n\314\306\315\316A\"!#\210\304\n\317\306\315\320A\"!#\202\224 \321\230\203\214\312\322A\"\205\224\304\n\323\306\315\316A\"!#\210\304\n\324\306\315\320A\"!#\210\304\n\325\306\315\326A\"!#\202\224\304\n\305 !A#)\207" [cell sym lsym ("volume" "repeat" "random" "playlist" "playlistlength" "bitrate" "song" "songid" "xfade" "updating_db") put intern string-to-number "state" ("play" "pause" "stop") "time" string-match "^\\([0-9]*\\):\\([0-9]*\\)$" time-elapsed match-string 1 time-total 2 "audio" "^\\([0-9]*\\):\\([0-9]*\\):\\([0-9]*\\)$" sample-rate bits-per-sample channels 3] 8 (#$ . 32542)]) #@2074 Get status of the mpd server, using connection CONN. Return a property list, the known keys being `volume', `repeat', `random', `playlist', `playlistlength', `bitrate', `song', `songid', `xfade', `state', `time-elapsed', `time-total', `sample-rate', `bits-per-sample', `channels' and `error'. Other keys might be present in the plist depending on the version of MPD used. Some of the less obvious descriptions are: +-----------+------------------------------------------------------------------+ | playlist |The playlist version number - a 'checksum' for the current | | |playlist, guaranteed to change after a change in the playlist. | +-----------+------------------------------------------------------------------+ | xfade |The crossfade time in seconds between two songs occurs. This value| | |could be zero in case of no crossfade. | +-----------+------------------------------------------------------------------+ | song |Position of the current song in the playlist. | +-----------+------------------------------------------------------------------+ | songid |Song ID of the current song in the playlist. | +-----------+------------------------------------------------------------------+ | state |Could be one of 'play, 'pause or 'stop | +-----------+------------------------------------------------------------------+ |updating_db|The updating job id, displayed when there is a update taking | | |place. | +-----------+------------------------------------------------------------------+ | error |A description of the error, if one occurs. Could be nil, in case | | |there is no error. | +-----------+------------------------------------------------------------------+ All fields except error and state are whole numbers. `repeat' and `random' are in addition, bi-state variables (0/1) (defalias 'mpd-get-status #[(conn) "\301\302\303\"\210\304\305\306#\210\307\302!\207" [conn setplist mpd-get-status-local-sym nil mpd-execute-command "status" (lambda (conn cell) (mpd-status-receiver 'mpd-get-status-local-sym cell)) symbol-plist] 4 (#$ . 33541)]) #@186 Handle response for the 'stats' command to the mpd server. See `mpd-execute-command' for a description of response handlers. This is an internal function, do not use this in your code. (defalias 'mpd-stats-receiver #[(lsym cell) "@\211\303\235\203\304\n\305 !\306A!#\202\304\n\305 !A#)\207" [cell sym lsym ("artists" "albums" "songs" "uptime" "playtime" "db_playtime" "db_update") put intern string-to-number] 6 (#$ . 35886)]) #@542 Get statistics for the mpd server connected using CONN. Return a property list, the known keys being `artists', `albums', `songs', `db_playtime' corresponding to the number of artists, albums and songs and the total time in seconds of all songs in the database respectively; `db_update', the time stamp of the last update to the database; `playtime', the total time for which music has been played in seconds and `uptime', the server uptime, in seconds as well. Other keys might be present in the plist depending on the version of MPD used. (defalias 'mpd-get-stats #[(conn) "\301\302\303\"\210\304\305\306#\210\307\302!\207" [conn setplist mpd-get-stats-local-sym nil mpd-execute-command "stats" (lambda (conn cell) (mpd-stats-receiver 'mpd-get-stats-local-sym cell)) symbol-plist] 4 (#$ . 36328)]) #@110 Get all songs in the current playlist managed by the mpd server. CONN and FOREACH are as in `mpd-get-songs'. (defalias 'mpd-get-playlist #[(conn &optional foreach) "\302!\204\303\304 \305\306#\210<\203\237\207\207" [foreach conn functionp nil mpd-execute-command "playlist" (lambda (conn cell) (setq foreach (mpd-elt-add (cdr cell) foreach (string-to-number (car cell)))))] 4 (#$ . 37136) (progn (mpd-init-buffer #1="" "Current MPD Playlist" #1#) (list mpd-inter-conn 'mpd-display-playlist-item))]) #@332 Get song data for entr(y/ies) ITEM in the current mpd playlist. CONN, FOREACH and the return value are as in `mpd-get-songs'. ITEM is the item position/id or a list of it. Note that ITEM as nil fetches data for all entries in the current playlist rather than not doing anything. Interpret ITEM as song id(s) iff USE-ID is non-nil. (defalias 'mpd-get-playlist-entry #[(conn &optional item foreach use-id) "\203\304\202 \305\306 \n\203\307\310P\311\n#\202 #\207" [use-id conn item foreach "playlistid" "playlistinfo" mpd-get-songs mpd-make-cmd-format " %d" (lambda (item item2) (mpd-assert-wholenump item))] 6 (#$ . 37651) (let ((item (mpd-read-item "Enter item number" (plist-get (mpd-get-status mpd-inter-conn) 'song)))) (mpd-init-buffer #1="" (format "MPD Playlist Item # %d" (1+ item)) #1#) (list mpd-inter-conn item 'mpd-display-song))]) #@201 Get song data for the current song in mpd. CONN and FOREACH are as in `mpd-get-songs'. Return FOREACH if specified, and the current song (see `mpd-get-songs' for how a song is represented) otherwise. (defalias 'mpd-get-current-song #[(conn &optional foreach) "\302\303 #\304 !\204 @ \207" [conn foreach mpd-get-songs "currentsong" functionp] 4 (#$ . 38510) (progn (mpd-init-buffer #1="" "Current MPD Song" #1#) (list mpd-inter-conn 'mpd-display-song))]) #@330 Get a list of changed song entries in the current mpd playlist. CONN, FOREACH and the return value are as in `mpd-get-songs'. Calculate the change between the current playlist and the playlist with version number VERSION. Do not fetch complete metadata (only position and song id is returned for each song) if NOMETA is non-nil. (defalias 'mpd-get-playlist-changes #[(conn version &optional foreach nometa) "\247\204\f\304\305\306D\"\210\307 \310\311\n\203\312\202\313# #\207" [version conn nometa foreach signal wrong-type-argument numberp mpd-get-songs format "%s %d" "plchangesposid" "plchanges"] 6 (#$ . 38976)]) #@379 Get all songs in a directory of the mpd database. CONN, FOREACH and the return value are as in `mpd-get-songs'. DIRECTORY is the relative directory path wrt the database root. DIRECTORY could be a list as well, the action then corresponds to all songs in all the directories. Note that the nil value for DIRECTORY corresponds to the database toplevel rather than an empty list. (defalias 'mpd-get-directory-songs #[(conn &optional directory foreach) "\303\304\305 \"\n#\207" [conn directory foreach mpd-get-songs mpd-make-cmd-concat "listallinfo"] 5 (#$ . 39608) (let ((str (read-string "Enter relative directory: "))) (progn (mpd-init-buffer #1="" (concat "Songs in directory " str) #1#) (list mpd-inter-conn str 'mpd-display-song)))]) #@729 Get directory info for DIRECTORY in the mpd database. Use CONN as the mpd connection for the purpose and call function FOREACH, if specified, with each information field. The arguments passed to FOREACH is a song object, directory string or playlist string and one of the symbols 'file, 'playlist or 'directory describing the data sent. DIRECTORY could be a list as well, the action then corresponds information for all the directories. Note that a nil for DIRECTORY corresponds to the database toplevel rather than an empty list. Return FOREACH, if non-nil; else a vector of three elements: a list of songs in the directory (see `mpd-get-songs' for how a song is represented), a list of playlists and a list of subdirectories. (defalias 'mpd-get-directory-info #[(conn &optional directory foreach) "\306!\204\307\307\211\310\307\311\312\313\"\314#\210 \203'\315 \316#\306!\2031\2029\317\237\f\237 \237#-\207" [foreach mpd-song-receiver mpd-song-receiver-args dir pl filemode functionp nil (file) mpd-execute-command mpd-make-cmd-concat "lsinfo" (lambda (conn cell) (if (string-equal (car cell) "directory") (setq dir (mpd-elt-add (cdr cell) dir 'directory)) (if (string-equal (car cell) "playlist") (setq pl (mpd-elt-add (cdr cell) pl 'playlist)) (mpd-song-receiver conn cell)))) mpd-seq-add file vector conn directory] 5 (#$ . 40353) (let ((str (read-string "Enter relative directory: "))) (progn (mpd-init-buffer #1="" (concat "Information on directory " str) #1#) (list mpd-inter-conn str 'mpd-display-dir-info)))]) #@411 Get the file-directory hierarchy of a directory in the mpd database. Use CONN for the connection and use function FOREACH to report each entry, along with a non-nil second argument if the entry is a directory. DIRECTORY could be a list as well, the action then corresponds to listing of all the directories. Note that the nil value for DIRECTORY corresponds to the database toplevel rather than an empty list. (defalias 'mpd-list-directory-recursive #[(conn foreach &optional directory) "\303!\204 \304\305\303D\"\210\306 \307\310\n\"\311#\207" [foreach conn directory functionp signal wrong-type-argument mpd-execute-command mpd-make-cmd-concat "listall" (lambda (conn cell) (funcall foreach (cdr cell) (string-equal (car cell) "directory")))] 5 (#$ . 41902) (let ((str (read-string "Enter relative directory: "))) (progn (mpd-init-buffer #1="" (concat "Recursive listing of directory " str) #1#) (list mpd-inter-conn 'mpd-display-dir-listing str)))]) #@278 Search for songs in the mpd database. CONN, FOREACH and the return values are as in `mpd-get-songs'. The valid values for BY are 'artist, 'album and 'title; indicating the field to search for; and FOR is the search string. If FOR is a non-empty list, search by BY for all FOR. (defalias 'mpd-search #[(conn by for &optional foreach) "\304=\204\305=\204\306=\204\307\310\"\210\311 \312\313\314!P\n\315# #\207" [by conn for foreach artist album title error "Invalid mpd search field %s" mpd-get-songs mpd-make-cmd-concat "find " symbol-name t] 6 (#$ . 42865) (let ((reqb (intern-soft (completing-read "Search by: " '(("artist") ("album") ("title")) nil t))) (reqf (read-string "Search for: "))) (mpd-init-buffer #1="" (format "Search results for %s %s" reqb reqf) #1#) (list mpd-inter-conn reqb reqf 'mpd-display-song))]) #@231 Get the names of all artists whose songs are in the mpd database. Use CONN for the connection, and call function FOREACH, if specified, with each name. If FOREACH is a function, return FOREACH, else return a list of artist names. (defalias 'mpd-get-artists #[(conn &optional foreach) "\302!\204\303\304 \305\306#\210<\203\237\207\207" [foreach conn functionp nil mpd-execute-command "list artist" (lambda (conn cell) (and (string-equal (car cell) "Artist") (setq foreach (mpd-elt-add (cdr cell) foreach))))] 4 (#$ . 43703) (progn (mpd-init-buffer #1="" "List of artists" #1#) (list mpd-inter-conn 'mpd-display-bullet))]) #@336 Get all albums in the mpd database featuring artist(s) ARTIST. Get all albums if ARTIST is not specified. If ARTIST is a list, find the albums of all the artists in the list. Use CONN for the connection, and call function FOREACH, if specified, with each name. If FOREACH is a function, return FOREACH, else return the list of albums. (defalias 'mpd-get-artist-albums #[(conn &optional artist foreach) "\303!\204\304\305 \306\307\n\"\310#\210<\203\237\207\207" [foreach conn artist functionp nil mpd-execute-command mpd-make-cmd-concat "list album" (lambda (conn cell) (and (string-equal (car cell) "Album") (setq foreach (mpd-elt-add (cdr cell) foreach))))] 5 (#$ . 44340) (let ((str (read-string "Name of the artist (All): "))) (and (string-equal str #1="") (setq str nil)) (mpd-init-buffer #1# (if str (concat "Albums of artist " str) "List of albums") #1#) (list mpd-inter-conn str 'mpd-display-bullet))]) #@193 Use CONN to query remote URL prefixes handled by the mpd server. Call function FOREACH, if specified, with each prefix. If FOREACH is a function, return FOREACH, else return the URL prefixes. (defalias 'mpd-get-handled-remote-url-prefixes #[(conn &optional foreach) "\302!\204\303\304 \305\306#\210<\203\237\207\207" [foreach conn functionp nil mpd-execute-command "urlhandlers" (lambda (conn cell) (and (string-equal (car cell) "handler") (setq foreach (mpd-elt-add (cdr cell) foreach))))] 4 (#$ . 45266) (progn (mpd-init-buffer #1="" "List of remote URL prefixes handled" #1#) (list mpd-inter-conn 'mpd-display-bullet))]) #@175 Handle output descriptions from the mpd server. See `mpd-execute-command' for a description of response handlers. This is an internal function, do not use this in your code. (defalias 'mpd-output-receiver #[(conn cell) "@\211\304\230\203\305\n\306\"\203\307\310\n #\311\312\n\313 ! \304\230\203*\314A!\202M \315\230\203KA\316\230\203;\311\202MA\317\230\203F\320\202MA\202MA#\211)\207" [cell key mpd-output-receiver foreach "outputid" plist-get outputid apply mpd-seq-add nil plist-put intern string-to-number "outputenabled" "0" "1" t] 6 (#$ . 45906)]) #@409 Get output descriptions from the mpd server using connection CONN. Call function FOREACH, if specified, for each output, with the output provided as the argument. Return list of all outputs if FOREACH is not specified and FOREACH otherwise. When a list is returned, each element of the list is a property list, some known keys being `outputid' (integer), `outputname' (string) and `outputenabled' (boolean). (defalias 'mpd-get-outputs #[(conn &optional foreach) "\303!\204\304\304\305\n\306\301#\210 \203\307 \"<\203#\237\202$)\207" [foreach mpd-output-receiver conn functionp nil mpd-execute-command "outputs" mpd-seq-add] 4 (#$ . 46488) (progn (mpd-init-buffer #1="" "List of outputs" #1#) (list mpd-inter-conn 'mpd-display-output))]) #@54 Convert FILE to a resource string understood by mpd. (defalias 'mpd-file-to-mpd-resource #[(file) "\305!\306\30724\n\203/\n@G G Y\203( \310 O\n@\230\203(\311\307 \"\210\nA\211\204\312 \f\"0*\207" [mpd-inter-conn length prefixes file mpd-db-root mpd-get-handled-remote-url-prefixes nil mpd-enqueue-is-url 0 throw file-relative-name] 4 (#$ . 47245)]) #@133 Enqueue resource RES (or list of RES) to the mpd playlist. Each of RES can be a file or a directory in the mpd database, or an URL. (defalias 'mpd-enqueue #[(conn res) "\302\303\304 \"\"\207" [conn res mpd-simple-exec mpd-make-cmd-concat "add"] 5 (#$ . 47612) (list mpd-inter-conn (if (and (stringp mpd-db-root) (not (string-equal mpd-db-root ""))) (mpd-file-to-mpd-resource (read-file-name "Enqueue what: " (file-name-as-directory mpd-db-root))) (read-string "Enqueue what: ")))]) #@438 Delete song at position/id POS from the mpd playlist. Interpret POS as a list of song id's if USE-ID is non-nil. POS could be a list to delete as well. If POS is a list and USE-ID is nil, sort it in descending order and remove duplicates before proceeding, unless NEVER-SORT is non-nil. Note that this is necessary for the correctness of the deletion, and NEVER-SORT is only provided in case the arguments already satisfy the condition. (defalias 'mpd-delete #[(conn pos &optional use-id never-sort) "\204 <\203\n\204\304 \305\306#\307 \310\203\311\202\312\313 #\"\207" [use-id pos never-sort conn mpd-sort-uniq-list > = mpd-simple-exec mpd-make-cmd-format "deleteid %d" "delete %d" (lambda (item ig) (mpd-assert-wholenump item))] 6 (#$ . 48102) (list mpd-inter-conn (mpd-read-item "Enter item to be deleted"))]) #@54 Save current mpd playlist to FILE (or list of FILE). (defalias 'mpd-save-playlist #[(conn file) "\302\303\304 \305#\"\207" [conn file mpd-simple-exec mpd-make-cmd-concat "save" t] 6 (#$ . 48934) (list mpd-inter-conn (read-string "Save playlist to: "))]) #@61 Load playlist PLNAME (or list of PLNAME) to the mpd server. (defalias 'mpd-load-playlist #[(conn plname) "\302\303\304 \305#\"\207" [conn plname mpd-simple-exec mpd-make-cmd-concat "load" t] 6 (#$ . 49195) (list mpd-inter-conn (read-string "Load playlist: "))]) #@107 Remove playlist PLNAME from the mpd playlist directory. PLNAME could as well be a list of playlist names. (defalias 'mpd-remove-playlist #[(conn plname) "\302\303\304 \305#\"\207" [conn plname mpd-simple-exec mpd-make-cmd-concat "rm" t] 6 (#$ . 49465) (list mpd-inter-conn (read-string "Remove playlist: "))]) #@53 Shuffle current mpd playlist using connection CONN. (defalias 'mpd-shuffle-playlist #[(conn) "\301\302\"\207" [conn mpd-simple-exec "shuffle"] 3 (#$ . 49782) (list mpd-inter-conn)]) #@51 Clear current mpd playlist using connection CONN. (defalias 'mpd-clear-playlist #[(conn) "\301\302\"\207" [conn mpd-simple-exec "clear"] 3 (#$ . 49971) (list mpd-inter-conn)]) #@117 Play song at position/id POS (default first) in the mpd playlist. Interpret POS as a song id iff USE-ID is non-nil. (defalias 'mpd-play #[(conn &optional pos use-id) "\203\303!\204\304\305\303D\"\210\306 \n\203\307\202\310\205%\311\312!PP\"\207" [pos conn use-id wholenump signal wrong-type-argument mpd-simple-exec "playid" "play" " " number-to-string] 6 (#$ . 50155) (list mpd-inter-conn (mpd-read-item "Enter item to play" 0))]) #@40 Stop playing the current mpd playlist. (defalias 'mpd-stop #[(conn) "\301\302\"\207" [conn mpd-simple-exec "stop"] 3 (#$ . 50607) (list mpd-inter-conn)]) #@144 Toggle the pause state of the current mpd playlist. If prefix argument ARG is non-nil, pause iff ARG is positive and resume playing otherwise. (defalias 'mpd-pause #[(conn &optional arg) "\302 \203\303\304\305 !\306V\203\307\202\306\"\202\310\"\207" [conn arg mpd-simple-exec format "pause %d" prefix-numeric-value 0 1 "pause"] 6 (#$ . 50769) (list mpd-inter-conn current-prefix-arg)]) #@45 Play next song in the current mpd playlist. (defalias 'mpd-next #[(conn) "\301\302\"\207" [conn mpd-simple-exec "next"] 3 (#$ . 51170) (list mpd-inter-conn)]) #@49 Play previous song in the current mpd playlist. (defalias 'mpd-prev #[(conn) "\301\302\"\207" [conn mpd-simple-exec "previous"] 3 (#$ . 51336) (list mpd-inter-conn)]) #@372 Move item from position/id FROM in the current mpd playlist to TO. For lists of FROM and TO, do action in that order for each pair of items. Interpret FROM as a list of song ids iff USE-ID is non-nil. Retain TO as a list of positions irrespective of the value of USE-ID. If sending a list for FROM and TO, note that every move changes the order of items in the playlist. (defalias 'mpd-move #[(conn from to &optional use-id) "\205 \205\304\n\305 \203\306\202\307\310P\311 $\"\207" [from to conn use-id mpd-simple-exec mpd-make-cmd-format "moveid" "move" " %d %d" (lambda (i j) (mpd-assert-wholenump i) (mpd-assert-wholenump j))] 7 (#$ . 51511) (list mpd-inter-conn (mpd-read-item "Source item number") (mpd-read-item "Destination item number"))]) #@223 Swap positions/ids FIRST and SECOND in the current mpd playlist. For lists of FROM and TO, do action in that order for each pair of items. Interpret FIRST and SECOND as song ids iff USE-ID is non-nil. See also `mpd-move'. (defalias 'mpd-swap #[(conn first second &optional use-id) "\205 \205\304\n\305 \203\306\202\307\310P\311 $\"\207" [first second conn use-id mpd-simple-exec mpd-make-cmd-format "swapid" "swap" " %d %d" (lambda (i j) (mpd-assert-wholenump i) (mpd-assert-wholenump j))] 7 (#$ . 52275) (list mpd-inter-conn (mpd-read-item "Swap item at number") (mpd-read-item "With item at number"))]) #@147 Seek to song position/id SONG and time TIME in the mpd playlist. Take TIME to be 0 by default. Interpret SONG as a song id iff USE-ID is non-nil. (defalias 'mpd-seek #[(conn song &optional time use-id) "\304!\204 \305\306\304D\"\210 \203!\304 !\204#\305\306\304 D\"\210\202#\307\310\n\311\312 \203/\313\2020\314 $\"\207" [song time conn use-id wholenump signal wrong-type-argument 0 mpd-simple-exec format "%s %d %d" "seekid" "seek"] 7 (#$ . 52897) (let (status) (and (eq (mpd-connection-status mpd-inter-conn) 'ready) (setq status (mpd-get-status mpd-inter-conn))) (list mpd-inter-conn (mpd-read-item "Seek to song" (and status (plist-get status 'song))) (mpd-read-item "Time in seconds" (and status (plist-get status 'time-elapsed)) t)))]) #@95 Change random mode of mpd using connection CONN. With ARG, set random on iff ARG is positive. (defalias 'mpd-toggle-random #[(conn &optional arg) "\203\f\302!\303V\202\304\305 !\306\"\303U\307 \310\203 \311\202!\312P\"\207" [arg conn prefix-numeric-value 0 plist-get mpd-get-status random mpd-simple-exec "random " "1" "0"] 4 (#$ . 53655) (list mpd-inter-conn current-prefix-arg)]) #@95 Change repeat mode of mpd using connection CONN. With ARG, set repeat on iff ARG is positive. (defalias 'mpd-toggle-repeat #[(conn &optional arg) "\203\f\302!\303V\202\304\305 !\306\"\303U\307 \310\203 \311\202!\312P\"\207" [arg conn prefix-numeric-value 0 plist-get mpd-get-status repeat mpd-simple-exec "repeat " "1" "0"] 4 (#$ . 54052) (list mpd-inter-conn current-prefix-arg)]) #@84 Change single mode of mpd using CONN. With ARG, set single on iff ARG is positive. (defalias 'mpd-toggle-single #[(conn &optional arg) "\203\f\302!\303V\202\304\305 !\306\"\307\230\310 \311\203 \312\202!\307P\"\207" [arg conn prefix-numeric-value 0 plist-get mpd-get-status single "0" mpd-simple-exec "single " "1"] 4 (#$ . 54449) (list mpd-inter-conn current-prefix-arg)]) #@50 Set the volume for the mpd player to volume VOL. (defalias 'mpd-set-volume #[(conn vol) "\302!\204 \303\304\302D\"\210\305 \306\307\"\"\207" [vol conn wholenump signal wrong-type-argument mpd-simple-exec format "setvol %d"] 5 (#$ . 54838) (list mpd-inter-conn (mpd-read-item "New volume" (and (eq (mpd-connection-status mpd-inter-conn) 'ready) (plist-get (mpd-get-status mpd-inter-conn) 'volume)) t))]) #@118 Adjust the volume for the mpd player by volume VOL. If VOL is positive, increase the volume, and decrease otherwise. (defalias 'mpd-adjust-volume #[(conn vol) "\247\204\f\302\303\304D\"\210\305 \306\307\"\"\207" [vol conn signal wrong-type-argument numberp mpd-simple-exec format "volume %d"] 5 (#$ . 55252) (list mpd-inter-conn (mpd-string-to-number-strict (read-string "Adjust volume by: ") t))]) #@98 Set cross-fading time for the mpd player to TIME in seconds. Turn off cross-fading if TIME is 0. (defalias 'mpd-set-crossfade #[(conn time) "\302!\204 \303\304\302D\"\210\305 \306\307\"\"\207" [time conn wholenump signal wrong-type-argument mpd-simple-exec format "crossfade %d"] 5 (#$ . 55661) (list mpd-inter-conn (mpd-read-item "New crossfade time in seconds" (plist-get (mpd-get-status mpd-inter-conn) 'xfade) t))]) (defvar mpd-inter-password-remember-queried nil) (defvar mpd-inter-password nil) (defvar mpd-inter-password-inhibit-update nil) (defalias 'mpd-inter-password-update #[(conn when) "\305=\205< ?\205<\n\306\211\204\307\310!\311\f \"\206;\312\313\f\314\f!\204/\315\316\314\fD\"\210\f\317H?\2059\f\320H)\"*\207" [when mpd-inter-password-inhibit-update mpd-inter-password passwd conn post t read-passwd "Enter MPD password: " mpd-set-password message "Unable to set password: %s" mpd-connp signal wrong-type-argument 5 4] 7]) #@435 Set the password for access to the mpd server. *WARNING* The password is sent to the server in plaintext. The processing done by libmpdee to send the command for setting the password also has its data as plaintext. When called interactively, offer to store and set the password on reconnection. Note that this is not done when the call is not interactive. Use hooked automatic mode (see `mpd-set-automatic-mode') to achieve the same. (defalias 'mpd-set-password #[(conn pass) ";\204\f\302\303\304D\"\210\305 \306\307!P\"\207" [pass conn signal wrong-type-argument stringp mpd-simple-exec "password " mpd-safe-string] 5 (#$ . 56624) (let ((password (read-passwd "Enter password: "))) (let ((mpd-inter-password-inhibit-update t)) (mpd-conn-wakeup mpd-inter-conn)) (if mpd-inter-password-remember-queried (and mpd-inter-password (setq mpd-inter-password password)) (if (yes-or-no-p "Do you want the password to be set again if we happen to reconnect? ") (progn (mpd-set-automatic-mode mpd-inter-conn 'mpd-inter-password-update) (if (yes-or-no-p "Would you like me to remember your password for this session, in case it needs to be set again? ") (progn (setq mpd-inter-password password))))) (setq mpd-inter-password-remember-queried t)) (list mpd-inter-conn password))]) #@104 Internal function instructing the mpd server to update. Please use `mpd-update' for updation purposes. (defalias 'mpd-update-1 #[(conn path) "\303\304\305 \"\"\211@\205\306\307\310\nA\"A!)\207" [conn path response mpd-execute-command mpd-make-cmd-concat "update" string-to-number assoc "updating_db"] 6 (#$ . 57903)]) #@330 Instruct the mpd server using CONN to update its database. PATH is the path or a list of paths to be updated. Note that PATH as nil updates the root directory rather than not updating at all. Ignore connection timeout, if IGNORE-TIMEOUT is non-nil and the connection is not in command list mode. Return update job id on success. (defalias 'mpd-update #[(conn &optional path ignore-timeout) "\203\n\304 !\203\305 \n\"\207\306 !\204\307\310\306 D\"\210 \311H\312\216 \311\313I\210\305 \n\"*\207" [ignore-timeout conn path timeout mpd-command-list-mode-p mpd-update-1 mpd-connp signal wrong-type-argument 6 #[nil "\302 I\207" [conn timeout 6] 3] nil] 4 (#$ . 58232) (list mpd-inter-conn (read-string "Enter relative path: "))]) #@46 Use connection CONN to enable mpd output ID. (defalias 'mpd-output-enable #[(conn id) "\302!\204 \303\304\302D\"\210\305 \306\307\"\"\207" [id conn wholenump signal wrong-type-argument mpd-simple-exec format "enableoutput %d"] 5 (#$ . 58971) (list mpd-inter-conn (mpd-read-item "Output ID" 0 t))]) #@47 Use connection CONN to disable mpd output ID. (defalias 'mpd-output-disable #[(conn id) "\302!\204 \303\304\302D\"\210\305 \306\307\"\"\207" [id conn wholenump signal wrong-type-argument mpd-simple-exec format "disableoutput %d"] 5 (#$ . 59279) (list mpd-inter-conn (mpd-read-item "Output ID" 0 t))]) #@72 Use connection CONN to ping the mpd server. Return non-nil on success. (defalias 'mpd-ping #[(conn) "\301\302\"\207" [conn mpd-simple-exec "ping"] 3 (#$ . 59590)]) #@93 Use connection CONN to clear the error status of the mpd server. Return non-nil on success. (defalias 'mpd-clear-status-error #[(conn) "\301\302\"\207" [conn mpd-simple-exec "clearerror"] 3 (#$ . 59761)]) #@53 Interactively submit a bug report about `libmpdee'. (defalias 'mpd-libmpdee-submit-bug-report #[nil "\302\303!\210\302\304!\210\305 \210\306\307\310P\311\312\313\314\"\315\"\316\211\317&\210\320\321!\211\203/db\210\322c\210\323 !\210)eb\210\324\325!\207" [libmpdee-version backtrace require reporter sendmail delete-other-windows reporter-submit-bug-report "andyetitmoves@gmail.com" "libmpdee " append apropos-internal "" (lambda (sym) (and (boundp sym) (mpd-conn-strongp (symbol-value sym)))) (emacs-version features) nil "Please change the Subject header to a concise bug description.\nIn this report, remember to cover the basics, that is,\nwhat you expected to happen and what in fact did happen.\nIf you got an error, please enable debugging by\n M-x set-variable debug-on-error t\nor if you have `dbfrobs', M-x debug-on-interesting-errors\nThen reproduce the error and immediately call\n M-x mpd-libmpdee-submit-bug-report\nThe backtrace will be automatically included with the report.\nPlease remove these instructions from your message." get-buffer "*Backtrace*" "\nPossible backtrace for libmpdee:\n\n" insert-buffer-substring mail-position-on-field "Subject"] 8 (#$ . 59973) nil]) (provide 'libmpdee)