;ELC ;;; Compiled by heimdall@localhost on Sat Feb 16 09:41:37 2008 ;;; from file /home/heimdall/repos/emms/emms-player-mpd.el ;;; in Emacs version 23.0.60.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`emms-player-mpd.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313&\207" [require emms-player-simple emms-source-playlist tq custom-declare-group emms-player-mpd nil "EMMS player for MusicPD." :group emms-player :prefix "emms-player-mpd-"] 8) #@37 *Parameters for the MusicPD player. (custom-declare-variable 'emms-player-mpd '(emms-player 'emms-player-mpd-start 'emms-player-mpd-stop 'emms-player-mpd-playable-p) '(#$ . -857) :type '(cons symbol alist) :group 'emms-player-mpd) #@157 The value of 'music_directory' in your MusicPD configuration file. You need this if your playlists use absolute file names, otherwise leave it set to nil. (custom-declare-variable 'emms-player-mpd-music-directory 'nil '(#$ . 1095) :type '(choice :format "%{%t%}:\n %[Value Menu%] %v" (const nil) directory) :group 'emms-player-mpd) #@95 Returns a regexp of file extensions that MusicPD supports, or nil if we cannot figure it out. (defalias 'emms-player-mpd-get-supported-regexp #[nil "\303\304\305!\306\"\307\211\211@\2038\n@\310\230\203\311\2021\n@\312\230\203(\307\2021 \2031\n@P\nA\211\202\f;\205O\312\230?\205O\313\314\315\307\303!\"!\316Q+\207" [supported found-start out split-string shell-command-to-string "mpd --version" "\n" nil "Supported formats:" t "" "\\`http://\\|\\.\\(m3u\\|pls\\|" regexp-opt delq "\\)\\'"] 7 (#$ . 1436)]) #@31 Formats supported by MusicPD. (custom-declare-variable 'emms-player-mpd-supported-regexp '(or (emms-player-mpd-get-supported-regexp) (concat "\\`http://\\|" "\\.\\(m3u\\|ogg\\|flac\\|mp3\\|wav\\|mod\\|au\\|aiff\\)\\'")) '(#$ . 1968) :type 'regexp :set #[(sym value) " L\210\303\n\304 #\207" [sym value emms-player-mpd emms-player-set regex] 4] :group 'emms-player-mpd) #@115 Function used to initiate the connection to MusicPD. It should take same arguments as `open-network-stream' does. (custom-declare-variable 'emms-player-mpd-connect-function ''open-network-stream '(#$ . 2345) :type 'function :group 'emms-player-mpd) #@47 The MusicPD server that we should connect to. (custom-declare-variable 'emms-player-mpd-server-name '(or (getenv "MPD_HOST") "localhost") '(#$ . 2600) :type 'string :group 'emms-player-mpd) #@59 The port of the MusicPD server that we should connect to. (custom-declare-variable 'emms-player-mpd-server-port '(or (getenv "MPD_PORT") "6600") '(#$ . 2796) :type '(choice number string) :group 'emms-player-mpd) #@64 The password for the MusicPD server that we should connect to. (custom-declare-variable 'emms-player-mpd-server-password 'nil '(#$ . 3015) :type '(choice (const :tag "None" nil) string) :group 'emms-player-mpd) #@191 How often to check to see whether MusicPD has advanced to the next song. This may be an integer or a floating point number. This is used only if `emms-player-mpd-sync-playlist' is non-nil (custom-declare-variable 'emms-player-mpd-check-interval '1 '(#$ . 3233) :type 'number :group 'emms-player-mpd) #@75 Whether to provide notifications for server connection events and errors. (custom-declare-variable 'emms-player-mpd-verbose 'nil '(#$ . 3541) :type 'boolean :group 'emms-player-mpd) #@230 Whether to synchronize the EMMS playlist with the MusicPD playlist. If your EMMS playlist contains music files rather than playlists, leave this set to non-nil. If your EMMS playlist contains stored playlists, set this to nil. (custom-declare-variable 'emms-player-mpd-sync-playlist 't '(#$ . 3730) :type 'boolean :group 'emms-player-mpd) (byte-code "\303\304 #\210\303\305\306#\210\303\307\306#\210\303\310\311#\210\303\312\313#\210\314\nB\315\314!\204-\316\314\317\"\210\320\nB\315\320!\204<\316\320\317\"\210\321\nB\315\321!\204K\316\321\317\"\210\322\321!\210\323\nB\315\323!\204^\316\323\317\"\210\324\nB\315\324!\204m\316\324\317\"\210\317\207" [emms-player-mpd emms-player-mpd-supported-regexp current-load-list emms-player-set regex pause emms-player-mpd-pause resume seek emms-player-mpd-seek seek-to emms-player-mpd-seek-to emms-player-mpd-process default-boundp set-default nil emms-player-mpd-queue emms-player-mpd-playlist-id make-variable-buffer-local emms-player-mpd-current-song emms-player-mpd-status-timer] 4) #@95 Regexp that matches the valid status strings that MusicPD can return at the end of a request. (defvar emms-player-mpd-status-regexp "^\\(OK\\( MPD \\)?\\|ACK \\[\\([0-9]+\\)@[0-9]+\\] \\(.+\\)\\)\n+\\'" (#$ . 4781)) #@35 The process sentinel for MusicPD. (defalias 'emms-player-mpd-sentinel #[(proc event) "\304!\305\306\n\"\203 \205B\307\310!\202B \311>\203)\312\313!\210 \205B\307\314!\202B \315>\2039 \205B\307\316!\202B \205B\307\317 \n#)\207" [proc status event emms-player-mpd-verbose process-status string-match "^deleted" message "MusicPD process was deleted" (exit signal closed) emms-player-mpd-close-process t "Closed MusicPD process" (run open) "MusicPD process started successfully" "Other MusicPD status change: %s, %s"] 4 (#$ . 5003)]) #@55 Make sure that a MusicPD process is currently active. (defalias 'emms-player-mpd-ensure-process #[nil "\205\306!\205\307!\310>?\205G \311\312\n $\313\314\"\210\315!\316\317!\2031\317\312\"\210\2025\320!\210 ;\205G\321\f\322 \323Q\312\324\325&\207" [emms-player-mpd-process emms-player-mpd-connect-function emms-player-mpd-server-name emms-player-mpd-server-port emms-player-mpd-queue emms-player-mpd-server-password processp process-status (run open) "mpd" nil set-process-sentinel emms-player-mpd-sentinel tq-create fboundp set-process-query-on-exit-flag process-kill-without-query tq-enqueue "password " "\n" ignore t emms-player-mpd-status-regexp] 7 (#$ . 5552)]) #@169 Terminate the current MusicPD client process. FROM-SENTINEL indicates whether this was called by the process sentinel, in which case certain checks should not be made. (defalias 'emms-player-mpd-close-process #[(&optional from-sentinel) "\204\303 !\205\304 !\305>\205\306\n!\210\307\211\211\207" [from-sentinel emms-player-mpd-process emms-player-mpd-queue processp process-status (run open) tq-close nil] 3 (#$ . 6246)]) #@105 Send the given QUESTION to the MusicPD server. When a reply comes, call FN with CLOSURE and the result. (defalias 'emms-player-mpd-send #[(question closure fn) "\305 \210\306\307O\310\230\204\310P\311 \n \f\312&\207" [question emms-player-mpd-queue emms-player-mpd-status-regexp closure fn emms-player-mpd-ensure-process -1 nil "\n" tq-enqueue t] 7 (#$ . 6684)]) #@94 Turn FILE into something that MusicPD can understand. This usually means removing a prefix. (defalias 'emms-player-mpd-get-mpd-filename #[(file) "\203 \302H\303=\203\304\305 \"\203 \207\306 \"\207" [emms-player-mpd-music-directory file 0 47 string-match "\\`http://" file-relative-name] 3 (#$ . 7060)]) #@89 Turn FILE into something that EMMS can understand. This usually means adding a prefix. (defalias 'emms-player-mpd-get-emms-filename #[(file) "\203 \302H\303=\204\304\305 \"\203 \207\306 \"\207" [emms-player-mpd-music-directory file 0 47 string-match "\\`http://" expand-file-name] 3 (#$ . 7378)]) #@236 Convert the given MusicPD response into a list. The car of the list is special: If an error has occurred, it will contain a cons cell whose car is an error number and whose cdr is the corresponding message. Otherwise, it will be nil. (defalias 'emms-player-mpd-parse-response #[(response) ";\205^\306 \307\216\310\311\"\312\n\313\"\211\211A@)\314\230\203$ @\202* \211A@) \315\241\210\n@;\203@\316\317\n@\"\203@\nA ;\203Z\316\320 \"\203Z\321\322 \"\321\323 \"B\nB\202]\315\nB-\207" [response save-match-data-internal data cruft x status match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) split-string "\n" last 3 "" nil string-match "^OK\\( MPD \\)?" "^ACK \\[\\([0-9]+\\)@[0-9]+\\] \\(.+\\)" match-string 1 2] 5 (#$ . 7691)]) #@95 Turn the given LINE from MusicPD into a cons cell. The format of the cell is (name . value). (defalias 'emms-player-mpd-parse-line #[(line) "\303\304\"\205 \305\306\"\305\307\"\211\205 \205\n\227\211 B*\207" [line value name string-match "\\`\\([^:\n]+\\):\\s-*\\(.+\\)" match-string 1 2] 5 (#$ . 8487)]) #@56 Turn the given parsed INFO from MusicPD into an alist. (defalias 'emms-player-mpd-get-alist #[(info) "\205I@?\205IA\205I\306\211\211A\306\211\203F @\307\f!\211\203?\310\n@ \"\211\203; \nA\241\210\202?\n B A\211\204* +\207" [info old-cell cell alist line --dolist-tail-- nil emms-player-mpd-parse-line assoc] 4 (#$ . 8810)]) #@101 Turn the given parsed INFO from MusicPD into an list of alists. The list will be in reverse order. (defalias 'emms-player-mpd-get-alists #[(info) "\205Q@?\205QA\205Q\306\211\211A\306\211\203F @\307\f!\211\203?\310 @\n\"\203;\n B C\202? \nB A\211\204*\n\203O\n B +\207" [info cell alist alists line --dolist-tail-- nil emms-player-mpd-parse-line assoc] 4 (#$ . 9164)]) (defalias 'emms-player-mpd-get-tracks-1 #[(closure response) "\306\307!!\310\211\203O\n\310\211\203N\f@\311\312 \"A\211\203F\313 !\314\315 \"\2030\316\2021\305\317 \"\320 \"\210 B*)\fA\211\204*@A \"*\207" [response tracks songs song-info --dolist-tail-- file emms-player-mpd-get-alists emms-player-mpd-parse-response nil assoc "file" emms-player-mpd-get-emms-filename string-match "\\`http://" url emms-track emms-info-mpd type track closure] 4]) #@145 Get the current playlist from MusicPD in the form of a list of EMMS tracks. Call CALLBACK with CLOSURE and result when the request is complete. (defalias 'emms-player-mpd-get-tracks #[(closure callback) "\302\303 B\304#\207" [callback closure emms-player-mpd-send "playlistinfo" emms-player-mpd-get-tracks-1] 4 (#$ . 10044)]) (defalias 'emms-player-mpd-get-status-1 #[(closure response) "@A\302\303 !!\"\207" [closure response emms-player-mpd-get-alist emms-player-mpd-parse-response] 5]) #@168 Get status information from MusicPD. It will be returned in the form of an alist by calling CALLBACK with CLOSURE as its first argument, and the status as the second. (defalias 'emms-player-mpd-get-status #[(closure callback) "\302\303 B\304#\207" [callback closure emms-player-mpd-send "status" emms-player-mpd-get-status-1] 4 (#$ . 10543)]) #@196 Get ITEM from the current MusicPD status. Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-get-status-part #[(closure callback item &optional info) "\203 \n\304 \"A\"\207\305 \n BB\306\"\207" [info callback closure item assoc emms-player-mpd-get-status #[(closure info) "@\211A@)\211AA)\211 \306\n \"A\"+\207" [closure x item close fn info assoc] 6]] 5 (#$ . 10894)]) #@196 Get the current playlist ID from MusicPD. Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-get-playlist-id #[(closure callback &optional info) "\203\303\304\n \305$\207" [info callback closure #[(closure id) "\207" [id] 1] emms-player-mpd-get-status-part "playlist"] 5 (#$ . 11412)]) #@191 Get the current volume from MusicPD. Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-get-volume #[(closure callback &optional info) "\203\303\304\n \305$\207" [info callback closure #[(closure volume) "\207" [volume] 1] emms-player-mpd-get-status-part "volume"] 5 (#$ . 11840)]) #@287 Get the current song from MusicPD. This is in the form of a number that indicates the position of the song on the current playlist. Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-get-current-song #[(closure callback &optional info) "\203\303\304\n \305$\207" [info callback closure #[(closure id) "\207" [id] 1] emms-player-mpd-get-status-part "song"] 5 (#$ . 12264)]) #@243 Get the current state of the MusicPD server. This is either "play", "stop", or "pause". Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-get-mpd-state #[(closure callback &optional info) "\203\303\304\n \305$\207" [info callback closure #[(closure id) "\207" [id] 1] emms-player-mpd-get-status-part "state"] 5 (#$ . 12780)]) #@266 Get the number of seconds that the current song has been playing, or nil if we cannot obtain this information. Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-get-playing-time #[(closure callback &optional info) "\203 \303\304\305\306$\207\303 \nB\307\306$\207" [info callback closure emms-player-mpd-get-status-part nil #[(closure time) "\205\301\302\"\205\303\304\305\"!\207" [time string-match "\\`\\([0-9]+\\):" string-to-number match-string 1] 4] "time" #[(closure time) "@A \205\302\303 \"\205\304\305\306 \"!\"\207" [closure time string-match "\\`\\([0-9]+\\):" string-to-number match-string 1] 6]] 5 (#$ . 13250)]) #@314 Move to the given song position. The amount to move is the number difference between PREV-SONG and NEW-SONG. NEW-SONG should be a string containing a number. PREV-SONG may be either a string containing a number or nil, which indicates that we should start from the beginning of the buffer and move to NEW-SONG. (defalias 'emms-player-mpd-select-song #[(prev-song new-song) "\203\n\306!\204 \307 \210 \206prq\210\310 ;\203,\f\203,\311\f!\203,\f\202-eb\210 ;\203>\312 !\312 !Z\202A\312 !\313\314\315\217,\207" [emms-playlist-buffer emms-source-old-buffer inhibit-read-only prev-song emms-playlist-selected-marker new-song buffer-live-p emms-playlist-current-clear t marker-position string-to-number nil (byte-code "\301V\203\302`!\204\303 \210\301V\203\303 \210S\211\202\301W\203/\304 \210T\211\202 \305 ?\2058\306`!\207" [diff 0 emms-playlist-track-at emms-playlist-next emms-playlist-previous emms-playlist-selected-track-at-p emms-playlist-select] 3) ((error (concat "Could not move to position " new-song))) diff] 3 (#$ . 14030)]) (defalias 'emms-player-mpd-sync-from-emms-1 #[(closure) "\301\302\"\207" [closure emms-player-mpd-get-playlist-id #[(closure id) "@A\304 !\205 \n \"*\207" [closure fn buffer id functionp] 3]] 3]) #@221 Synchronize the MusicPD playlist with the contents of the current EMMS playlist. If CALLBACK is provided, call it with the current EMMS playlist buffer and MusicPD playlist ID when we are done, if there were no errors. (defalias 'emms-player-mpd-sync-from-emms #[(&optional callback) "\305 \210\203 \306!\204\307 \210 \206prq\210\310\311\212\312ed\"\237)\313 p\fB\314#,\207" [emms-playlist-buffer emms-source-old-buffer inhibit-read-only tracks callback emms-player-mpd-clear buffer-live-p emms-playlist-current-clear t nil emms-playlist-tracks-in-region emms-player-mpd-add-several-tracks emms-player-mpd-sync-from-emms-1] 4 (#$ . 15310)]) (defalias 'emms-player-mpd-sync-from-mpd-2 #[(closure info) "@\211A@)\211AA)\306\307\310\n#\311\307\310\n#\312!\205k\211\2035\312!\2048\313 \210\206>prq\210\314\f\315\307!\210 \203[\316\307 \"\210\202^eb\210,\317!\205k \n\"-\207" [closure x info song id close emms-player-mpd-get-playlist-id nil ignore emms-player-mpd-get-current-song buffer-live-p emms-playlist-current-clear t set-buffer-modified-p emms-player-mpd-select-song functionp fn buffer emms-playlist-buffer emms-source-old-buffer inhibit-read-only emms-player-mpd-playlist-id] 9]) (defalias 'emms-player-mpd-sync-from-mpd-1 #[(closure tracks) "@\n\2055\306 !\2055 \211\203\306 !\204\307 \210\f\206!pr q\210\310\311 \210\312\313\n\"\210,\314\315\")\207" [closure buffer tracks emms-playlist-buffer emms-source-old-buffer inhibit-read-only buffer-live-p emms-playlist-current-clear t emms-playlist-clear mapc emms-playlist-insert-track emms-player-mpd-get-status emms-player-mpd-sync-from-mpd-2] 4]) #@275 Synchronize the EMMS playlist with the contents of the current MusicPD playlist. Namely, clear the EMMS playlist buffer and add tracks to it that are present in the MusicPD playlist. If the current buffer is an EMMS playlist buffer, make it the main EMMS playlist buffer. (defalias 'emms-player-mpd-sync-from-mpd #[(&optional closure callback) "\203p =\204\306p!\210 \203\307 !\204\310 \210\n\206 pr q\210\311\312 \f BB\313\"+\207" [emms-playlist-buffer-p emms-playlist-buffer emms-source-old-buffer inhibit-read-only callback closure emms-playlist-set-playlist-buffer buffer-live-p emms-playlist-current-clear t emms-player-mpd-get-tracks emms-player-mpd-sync-from-mpd-1] 4 (#$ . 16987)]) (defalias 'emms-player-mpd-detect-song-change-1 #[(closure info) "\306\307\310#\311\307\310#\312\307\310#\313\314\"A ;\203*\315\316 \"\210\317\320\307\310#\202\203 \321\230\203E\322\323!\210\f\203@\323\324 )\202\203\324 \202\203 \325\230\203O\307\202\203 \326\230\205\203\f?\206d;\205d\f\230?\205\203\323\324 \210)\327\f\"\210\f\330\331!\210\n\205\203\332\333\n\",\207" [info err-msg time status song emms-player-stopped-p emms-player-mpd-get-current-song nil ignore emms-player-mpd-get-mpd-state emms-player-mpd-get-playing-time assoc "error" message "MusicPD error: %s" emms-player-mpd-send "clearerror" "stop" emms-player-mpd-disconnect t emms-player-stopped "pause" "play" emms-player-mpd-select-song emms-player-started emms-player-mpd run-hook-with-args emms-player-time-set-functions emms-player-mpd-current-song] 6]) #@165 Detect whether a song change has occurred. This is usually called by a timer. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. (defalias 'emms-player-mpd-detect-song-change #[(&optional info) "\203 \301\302\"\207\303\302\301\"\207" [info emms-player-mpd-detect-song-change-1 nil emms-player-mpd-get-status] 3 (#$ . 18554)]) #@66 Escape special characters in FILE and surround in double-quotes. (defalias 'emms-player-mpd-quote-file #[(file) "\301\302\301\303\302\304\305##\301Q\207" [file "\"" emms-replace-regexp-in-string "\\\\\"" "\\\\" "\\\\\\\\"] 8 (#$ . 18924)]) #@29 Clear the MusicPD playlist. (defalias 'emms-player-mpd-clear #[nil "\203\n\301!\210\302\303\304\302\305#\207" [emms-player-mpd-status-timer emms-cancel-timer nil emms-player-mpd-send "clear" ignore] 4 (#$ . 19171) nil]) #@155 Add FILE to the current MusicPD playlist. Execute CALLBACK with CLOSURE as its first argument when done. If an error occurs, display a relevant message. (defalias 'emms-player-mpd-add-file #[(file closure callback) "\303!\304\305\306!P \nBB\307#\207" [file callback closure emms-player-mpd-get-mpd-filename emms-player-mpd-send "add " emms-player-mpd-quote-file #[(closure response) "\306! @ \211A@) \211AA)\211\n@\203)\307\310 \n\211@A)#\2022\311\f!\2052\f !,\207" [response closure x close callback file emms-player-mpd-parse-response message "MusicPD error: %s: %s" functionp output] 5]] 5 (#$ . 19402)]) #@169 Load contents of BUFFER into MusicPD by adding each line. Execute CALLBACK with CLOSURE as its first argument when done. This handles both m3u and pls type playlists. (defalias 'emms-player-mpd-add-buffer-contents #[(buffer closure callback) "rq\210eb\210\304 \211\205\305\306 !\n #*\207" [buffer format closure callback emms-source-playlist-determine-format emms-player-mpd-add-several-files emms-source-playlist-files] 5 (#$ . 20034)]) #@171 Load contents of PLAYLIST into MusicPD by adding each line. Execute CALLBACK with CLOSURE as its first argument when done. This handles both m3u and pls type playlists. (defalias 'emms-player-mpd-add-playlist #[(playlist closure callback) "\304\305!\306\216rq\210\307 !\210\310p\n #+\207" [#1=#:temp-buffer playlist closure callback generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents emms-player-mpd-add-buffer-contents] 4 (#$ . 20484)]) #@126 Download contents of URL and then add its feeds into MusicPD. Execute CALLBACK with CLOSURE as its first argument when done. (defalias 'emms-player-mpd-add-streamlist #[(url closure callback) "\304\305!\203%\306\307!\210\310\311!\312\216rq\210\305\313 !!\210\314p!\210\315p\n #+\207\316\317\320!!\207" [#1=#:temp-buffer url closure callback fboundp url-insert-file-contents require emms-url generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) emms-url-quote-entire emms-http-decode-buffer emms-player-mpd-add-buffer-contents error message "You need to install url.el so that Emms can retrieve this stream"] 4 (#$ . 21012)]) #@99 Add TRACK to the MusicPD playlist. Execute CALLBACK with CLOSURE as its first argument when done. (defalias 'emms-player-mpd-add #[(track closure callback) "\305\302\"\305\301\" \306=\203\307\n \f#\202F \310=\203&\311\n \f#\202F \312=\2043\313\314\n\"\203;\315\n \f#\202F \316=\205F\307\n \f#*\207" [track type name closure callback emms-track-get url emms-player-mpd-add-file streamlist emms-player-mpd-add-streamlist playlist string-match "\\.\\(m3u\\|pls\\)\\'" emms-player-mpd-add-playlist file] 4 (#$ . 21703)]) #@100 Add TRACKS to the MusicPD playlist. Execute CALLBACK with CLOSURE as its first argument when done. (defalias 'emms-player-mpd-add-several-tracks #[(tracks closure callback) ":\205A\203\303@\304\305#\210A\211\202\303@ \n#\207" [tracks closure callback emms-player-mpd-add nil ignore] 5 (#$ . 22240)]) #@99 Add FILES to the MusicPD playlist. Execute CALLBACK with CLOSURE as its first argument when done. (defalias 'emms-player-mpd-add-several-files #[(files closure callback) ":\205A\203\303@\304\305#\210A\211\202\303@ \n#\207" [files closure callback emms-player-mpd-add-file nil ignore] 5 (#$ . 22558)]) #@45 Return non-nil when we can play this track. (defalias 'emms-player-mpd-playable-p #[(track) "\302!\303>\205\304\305 \306\"\307!\"\205\310\311\312\217\207" [track emms-player-mpd emms-track-type (file url playlist streamlist) string-match emms-player-get regex emms-track-name nil (byte-code "\300 \210\301\207" [emms-player-mpd-ensure-process t] 1) ((error))] 4 (#$ . 22877)]) #@127 Play whatever is in the current MusicPD playlist. If ID is specified, play the song at that position in the MusicPD playlist. (defalias 'emms-player-mpd-play #[(&optional id) "\203;\204 \301!\302\303P\304\305#\207\302\306\304\307#\207" [id number-to-string emms-player-mpd-send "play " nil #[(closure response) "\303\304\305 \306#\211\207" [emms-player-mpd-current-song emms-player-mpd-check-interval emms-player-mpd-status-timer nil run-at-time t emms-player-mpd-detect-song-change] 4] "play" #[(closure response) "\300\301!\207" [emms-player-started emms-player-mpd] 2]] 4 (#$ . 23267)]) (defalias 'emms-player-mpd-start-and-sync-2 #[(buffer id) "\306!\205J\211\203\306 !\204\307 \210\n\206pr q\210\310\f\311\312!\210\313\212\203<\314!\203<\202=eb\210\312\315\316\217\210)\317!-\207" [buffer emms-playlist-buffer emms-source-old-buffer inhibit-read-only id emms-player-mpd-playlist-id buffer-live-p emms-playlist-current-clear t set-buffer-modified-p nil 0 marker-position (byte-code "\301 \210T\202" [track-cnt emms-playlist-previous] 1) ((error)) emms-player-mpd-play track-cnt emms-playlist-selected-marker] 4]) (defalias 'emms-player-mpd-start-and-sync-1 #[(closure id) "\203\n\306!\204 \307 \210 \206prq\210\310 +\311!\2044\f;\2034\f \230\2034\312 \"\2027\313\312!)\207" [emms-playlist-buffer emms-source-old-buffer inhibit-read-only emms-player-mpd-playlist-id buf-id id buffer-live-p emms-playlist-current-clear t buffer-modified-p emms-player-mpd-start-and-sync-2 emms-player-mpd-sync-from-emms] 3]) #@164 Ensure that MusicPD's playlist is up-to-date with EMMS's playlist, and then play the current track. This is called if `emms-player-mpd-sync-playlist' is non-nil. (defalias 'emms-player-mpd-start-and-sync #[nil "\203\n\301!\210\302\303\304\302\305#\207" [emms-player-mpd-status-timer emms-cancel-timer nil emms-player-mpd-send "clearerror" #[(closure response) "\300\301\302\"\207" [emms-player-mpd-get-playlist-id nil emms-player-mpd-start-and-sync-1] 3]] 4 (#$ . 24840)]) (defalias 'emms-player-mpd-connect-1 #[(closure info) "\306\307\306\310 #\211\311\230\204\312\n\313\230\203\314\n\311\230?\205+\315 !\210\316\314 \315#\211)\207" [emms-player-mpd-current-song info state emms-player-playing-p emms-player-paused-p emms-player-mpd-check-interval nil emms-player-mpd-get-mpd-state ignore "stop" emms-player-mpd "pause" t emms-player-mpd-detect-song-change run-at-time emms-player-mpd-status-timer] 5]) #@334 Connect to MusicPD and retrieve its current playlist. Afterward, the status of MusicPD will be tracked. This also has the effect of changing the current EMMS playlist to be the same as the current MusicPD playlist. Thus, this function is useful to call if the contents of the EMMS playlist buffer get out-of-sync for some reason. (defalias 'emms-player-mpd-connect #[nil "\203\n\301!\210\302\303\302\304\"\207" [emms-player-mpd-status-timer emms-cancel-timer nil emms-player-mpd-sync-from-mpd emms-player-mpd-connect-1] 3 (#$ . 25768) nil]) #@33 Starts a process playing TRACK. (defalias 'emms-player-mpd-start #[(track) "\203\302 \303\"\304>\204\305 \207\306 \210\307 \310\311#\207" [emms-player-mpd-sync-playlist track emms-track-get type (streamlist playlist) emms-player-mpd-start-and-sync emms-player-mpd-clear emms-player-mpd-add nil emms-player-mpd-play] 4 (#$ . 26322) nil]) #@211 Terminate the MusicPD client process and disconnect from MusicPD. If NO-STOP is non-nil, do not indicate to EMMS that we are stopped. This argument is meant to be used when calling this from other functions. (defalias 'emms-player-mpd-disconnect #[(&optional no-stop) "\304!\210\305\211\306 \210\n?\205\307\310 )\207" [emms-player-mpd-status-timer emms-player-mpd-current-song no-stop emms-player-stopped-p emms-cancel-timer nil emms-player-mpd-close-process t emms-player-stopped] 3 (#$ . 26671) nil]) #@34 Stop the currently playing song. (defalias 'emms-player-mpd-stop #[nil "\301\302\303\217\210\304\305!\210\305\306 )\207" [emms-player-stopped-p nil (byte-code "\300\301\302\303#\207" [emms-player-mpd-send "stop" nil ignore] 4) ((error)) emms-player-mpd-disconnect t emms-player-stopped] 3 (#$ . 27188) nil]) #@35 Pause the currently playing song. (defalias 'emms-player-mpd-pause #[nil "\300\301\302\303#\207" [emms-player-mpd-send "pause" nil ignore] 4 (#$ . 27503) nil]) #@74 Seek backward or forward by AMOUNT seconds, depending on sign of AMOUNT. (defalias 'emms-player-mpd-seek #[(amount) "\301\302\"\207" [amount emms-player-mpd-get-status #[(amount info) "\304\305\306#\307\305\306#\211\205! \205!\310\311\n\312\313 \\!R\305\306#*\207" [info secs song amount emms-player-mpd-get-current-song nil ignore emms-player-mpd-get-playing-time emms-player-mpd-send "seek " " " number-to-string] 8]] 3 (#$ . 27669) nil]) #@58 Seek to POS seconds from the start of the current track. (defalias 'emms-player-mpd-seek-to #[(pos) "\301\302\"\207" [pos emms-player-mpd-get-current-song #[(pos song) "\205 \205\302\303\304\305 !R\306\307#\207" [song pos emms-player-mpd-send "seek " " " number-to-string nil ignore] 6]] 3 (#$ . 28124) nil]) #@59 Move forward by one track in MusicPD's internal playlist. (defalias 'emms-player-mpd-next #[nil "\300\301\302\303#\207" [emms-player-mpd-send "next" nil ignore] 4 (#$ . 28446) nil]) #@60 Move backward by one track in MusicPD's internal playlist. (defalias 'emms-player-mpd-previous #[nil "\300\301\302\303#\207" [emms-player-mpd-send "previous" nil ignore] 4 (#$ . 28634) nil]) #@86 Change volume up or down by AMOUNT, depending on whether it is positive or negative. (defalias 'emms-volume-mpd-change #[(amount) "\301\302\"\207" [amount emms-player-mpd-get-volume #[(change volume) "\303! \\\304\305\306\n!\307Q\310\311#)\207" [volume change new-volume string-to-number emms-player-mpd-send "setvol \"" number-to-string "\"" nil ignore] 4]] 3 (#$ . 28831) "MVolume change amount (+ increase, - decrease): "]) (defalias 'emms-player-mpd-show-1 #[(closure response) "\306\307!!\n@\n\211A@)\n\211AA)\"\310\311 \"A\310\312 \"A\313#\314\315!\203P ;\203P \230\203Pr\"q\210\316\317!\205L\317 \")\202\372 \203\265\203]#\203\265\320C\313$%\321\322\"\203{\323%\324\325#\210\202\202\323%\324\326#\210\323%\327#\210\330% \"\210\331%!\211$;\203\264$\332\230\204\264#\203\260#\333$Q\202\262$#*#\204\307\334 !?\205\372\335\336!\202\372\337&#\"#\334 !\203\336 \"#\"\202\372 \203\365\340\"!\205\372r\"q\210#c)\202\372\335\341#\".\207" [response info closure insertp x callback emms-player-mpd-get-alist emms-player-mpd-parse-response assoc "name" "file" nil boundp emms-lastfm-radio-stream-url fboundp emms-lastfm-np *track* string-match "\\`http://" emms-track-set type url file name emms-info-mpd emms-track-description "" ": " functionp message "Nothing playing right now" format buffer-live-p "%s" buffer desc track-desc track emms-show-format] 5]) #@437 Describe the current EMMS track in the minibuffer. If INSERTP is non-nil, insert the description into the current buffer instead. If CALLBACK is a function, call it with the current buffer and description as arguments instead of displaying the description or inserting it. This function uses `emms-show-format' to format the current track. It differs from `emms-show' in that it asks MusicPD for the current track, rather than EMMS. (defalias 'emms-player-mpd-show #[(&optional insertp callback) "\302\303 pBB\304#\207" [insertp callback emms-player-mpd-send "currentsong" emms-player-mpd-show-1] 5 (#$ . 30271) "P"]) (defalias 'emms-info-mpd-process #[(track info) "\306\211\205\204\n@\211@ A\211\307\230\203\310\202p\f\311\230\203%\312\202p\f\313\230\203/\314\202p\f\315\230\2039\316\202p\f\317\230\203C\320\202p\f\321\230\203M\322\202p\f\323\230\203W\324\202p\f\325\230\203a\326\202p\f\327\230\203o\330 !\331\202p\306\211\203{\332 \f #\210*\nA\211\204\306*\207" [info data --dolist-tail-- value name track nil "artist" info-artist "composer" info-composer "performer" info-performer "title" info-title "album" info-album "track" info-tracknumber "date" info-year "genre" info-genre "time" string-to-number info-playing-time emms-track-set] 5]) (defalias 'emms-info-mpd-1 #[(track response) "\303\304!!\211\205\305\n \"\210\306\n!)\207" [response info track emms-player-mpd-get-alist emms-player-mpd-parse-response emms-info-mpd-process emms-track-updated] 4]) #@171 Add track information to TRACK. If INFO is specified, use that instead of acquiring the necessary info from MusicPD. This is a useful addition to `emms-info-functions'. (defalias 'emms-info-mpd #[(track &optional info) "\203 \305 \"\207\306 !\302=\2053\307\310\n\"?\2053\311\312 !! \204.\n\2052\307\f\n\"\2052\313\314\315\217)\207" [info track file emms-player-mpd-music-directory emms-player-mpd-supported-regexp emms-info-mpd-process emms-track-type string-match "\\`http://" emms-player-mpd-get-mpd-filename emms-track-name nil (byte-code "\302\303\304!P \305#\207" [file track emms-player-mpd-send "find filename " emms-player-mpd-quote-file emms-info-mpd-1] 4) ((error))] 3 (#$ . 31781)]) #@104 Dump TRACK-INFO into the EMMS cache. The track should be an alist as per `emms-player-mpd-get-alist'. (defalias 'emms-cache-set-from-mpd-track #[(track-info) "\205,\304C\305\306 \"A\n\205+\307\n!\310 \311\312#\210\310 \302\n#\210\313 \"\210\312\n #*\207" [emms-cache-set-function track-info name track *track* assoc "file" emms-player-mpd-get-emms-filename emms-track-set type file emms-info-mpd-process] 4 (#$ . 32493)]) #@118 Dump all MusicPD data from DIR into the EMMS cache. This is useful to do when you have recently acquired new music. (defalias 'emms-cache-set-from-mpd-directory #[(dir) "\302\230\204\n\303! \203\304\305!\210\306\307P\310\311#\207\312\313!\207" [dir emms-cache-set-function "" emms-player-mpd-get-mpd-filename message "Dumping MusicPD data to cache..." emms-player-mpd-send "listallinfo " nil #[(closure response) "\304\305!\210\306\307!!\211\310\211\203 @\311\n!\210 A\211\204*\304\312!)\207" [response info track-info --dolist-tail-- message "Dumping MusicPD data to cache...processing" emms-player-mpd-get-alists emms-player-mpd-parse-response nil emms-cache-set-from-mpd-track "Dumping MusicPD data to cache...done"] 4] error "Caching is not enabled"] 4 (#$ . 32931) (list (if emms-player-mpd-music-directory (emms-read-directory-name "Directory: " emms-player-mpd-music-directory) (read-string "Directory: ")))]) #@136 Dump all MusicPD data into the EMMS cache. This is useful to do once, just before using emms-browser.el, in order to prime the cache. (defalias 'emms-cache-set-from-mpd-all #[nil "\300\301!\207" [emms-cache-set-from-mpd-directory ""] 2 (#$ . 33873) nil]) #@64 Cause the tracks in DIR to be updated in the MusicPD database. (defalias 'emms-player-mpd-update-directory #[(dir) "\301\230\204\n\302!\303\304P\305\306#\207" [dir "" emms-player-mpd-get-mpd-filename emms-player-mpd-send "update " nil #[(closure response) "\302\303\304\305!!\"A\211\203\306\307 \"\202\306\310!)\207" [response id assoc "updating_db" emms-player-mpd-get-alist emms-player-mpd-parse-response message "Updating DB with ID %s" "Could not update the DB"] 6]] 4 (#$ . 34135) (list (if emms-player-mpd-music-directory (emms-read-directory-name "Directory: " emms-player-mpd-music-directory) (read-string "Directory: ")))]) #@88 Cause all tracks in the MusicPD music directory to be updated in the MusicPD database. (defalias 'emms-player-mpd-update-all #[nil "\300\301!\207" [emms-player-mpd-update-directory ""] 2 (#$ . 34785) nil]) (provide 'emms-player-mpd)