;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\302\303!\210\302\304!\210\302\305!\210\302\306!\210\307\300\310\311\312DD\313\314\315\316\300&\210\317\320\321\322 \"#\210\307\323\310\311\324DD\325\314\326\316\300&\210\307\327\310\311\330DD\331\314\332\316\300&\210\307\333\310\311\334DD\335\314\336\316\300&\210\307\337\310\311\340DD\341\314\342\316\300&\210\307\343\310\311\344DD\345\314\326\316\300&\207" [emms-player-mpv emms-player-base-format-list require emms emms-player-simple json cl-lib custom-declare-variable funcall function #[0 "\300\301\302\303#\207" [emms-player emms-player-mpv-start emms-player-mpv-stop emms-player-mpv-playable-p] 4] "*Parameters for mpv player." :type (cons symbol alist) :group emms-player-set regex apply emms-player-simple-regexp emms-player-mpv-command-name #[0 "\300\207" [#1="mpv"] 1 #1#] "mpv binary to use. Can be absolute path or just binary name." file emms-player-mpv-parameters #[0 "\300\207" [("--quiet" "--really-quiet" "--no-audio-display")] 1] "Extra command-line arguments for started mpv process(es).\nEither a list of strings or function returning such list.\nExtra arguments --idle and --input-file/--input-ipc-server\nare added automatically, depending on mpv version.\nNote that unless --no-config option is specified here,\nmpv will also use options from its configuration files.\nFor mpv binary path, see `emms-player-mpv-command-name'." (choice (repeat :tag "List of mpv arguments" string) function) emms-player-mpv-environment #[0 "\300\207" [nil] 1] "List of extra environment variables (\"VAR=value\" strings) to pass on to mpv process.\nThese are added on top of `process-environment' by default.\nAdding nil as an element to this list will discard emacs\n`process-environment' and only pass variables that are specified in the list." (repeat (choice string (const :tag "Start from blank environment" nil))) emms-player-mpv-ipc-method #[0 "\300\207" [nil] 1] "Switch for which IPC method to use with mpv.\nPossible symbols: detect, ipc-server, unix-socket, file.\nDefaults to nil value, which will cause `emms-player-mpv-ipc-detect'\nto pick one based on mpv --version output.\nUsing JSON-IPC variants (ipc-server and unix-socket) enables\nsupport for various feedback and metadata options from mpv." (choice (const :tag "Auto-detect from mpv --version" nil) (const :tag "Use --input-ipc-server JSON IPC (v0.17.0 2016-04-11)" ipc-server) (const :tag "Use --input-unix-socket JSON IPC (v0.7.0 2014-10-16)" unix-socket) (const :tag "Use --input-file FIFO (any mpv version)" file)) emms-player-mpv-ipc-socket #[0 "\301!\302P\207" [emms-directory file-name-as-directory "mpv-ipc.sock"] 2] "Unix IPC socket or FIFO to use with mpv --input-* options,\ndepending on `emms-player-mpv-ipc-method' value and/or mpv version."] 8) (defvar emms-player-mpv-ipc-proc nil) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \210\300\314\302\303\315DD\316\306\307\310\317\312\313& \207" [custom-declare-variable emms-player-mpv-update-duration funcall function #[0 "\300\207" [t] 1] "Update track duration when played by mpv.\nUses `emms-player-mpv-event-functions' hook." :type boolean :set #[514 "\300\301\302\303$\207" [run-at-time 0.1 nil #[257 "\211\203 \300\301\302\"\207\303\301\302\"\207" [add-hook emms-player-mpv-event-functions emms-player-mpv-info-duration-event-func remove-hook] 4 "\n\n(fn VALUE)"]] 7 "\n\n(fn SYM VALUE)"] :group emms-player-mpv emms-player-mpv-update-metadata #[0 "\300\207" [nil] 1] "Update track info (artist, album, name, etc) from mpv events, when it is played.\nThis allows to dynamically update stream info from ICY tags, for example.\nUses `emms-player-mpv-event-connect-hook' and `emms-player-mpv-event-functions' hooks." #[514 "\300\301\302\303$\207" [run-at-time 0.1 nil #[257 "\211\203\301\302\303\"\210\301\304\305\"\210\306!\205 \303 \207\307\302\303\"\210\307\304\305\"\207" [emms-player-mpv-ipc-proc add-hook emms-player-mpv-event-connect-hook emms-player-mpv-info-meta-connect-func emms-player-mpv-event-functions emms-player-mpv-info-meta-event-func process-live-p remove-hook] 4 "\n\n(fn VALUE)"]] 7 "\n\n(fn SYM VALUE)"]] 10) #@79 Running mpv process, controlled over --input-ipc-server/--input-file sockets. (defvar emms-player-mpv-proc nil (#$ . 4528)) #@120 Delay until SIGKILL gets sent to `emms-player-mpv-proc', if it refuses to exit cleanly on `emms-player-mpv-proc-stop'. (defvar emms-player-mpv-proc-kill-delay 5 (#$ . 4659)) #@83 Unix socket network process connected to running `emms-player-mpv-proc' instance. (defvar emms-player-mpv-ipc-proc nil (#$ . 4839)) #@74 Buffer to associate with `emms-player-mpv-ipc-proc' socket/pipe process. (defvar emms-player-mpv-ipc-buffer " *emms-player-mpv-ipc*" (#$ . 4977)) #@56 Timer for connection attempts to JSON IPC unix socket. (defvar emms-player-mpv-ipc-connect-timer nil (#$ . 5129)) #@73 List of delays before initiating socket connection for new mpv process. (defvar emms-player-mpv-ipc-connect-delays '(0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.2 0.3 0.3 0.5 1.0 1.0 2.0) (#$ . 5249)) #@271 JSON command for `emms-player-mpv-ipc-sentinel' to run when it connects to mpv. I.e. last command that either initiated connection or was used while connecting to mpv. Set by `emms-player-mpv-start' and such, cleared once it gets sent by `emms-player-mpv-ipc-sentinel'. (defvar emms-player-mpv-ipc-connect-command nil (#$ . 5443)) #@303 Auto-incremented counter for unique JSON request identifiers. Use for for `request_id' and `observe_property' identifiers. Use `emms-player-mpv-ipc-id-get' to get and increment this value, instead of using it directly. Wraps-around upon reaching `emms-player-mpv-ipc-id-max' (unlikely to ever happen). (defvar emms-player-mpv-ipc-id 1 (#$ . 5781)) #@137 Max value for `emms-player-mpv-ipc-id' to wrap around after. Should be fine with both mpv and Emacs, and probably never reached anyway. (defvar emms-player-mpv-ipc-id-max (expt 2 30) (#$ . 6136)) #@80 Auto-initialized hash table of outstanding API req_ids to their handler funcs. (defvar emms-player-mpv-ipc-req-table nil (#$ . 6338)) #@265 Internal flag to track when stop command starts/finishes before next loadfile. Set to either nil, t or the playback start function to call on end-file event after stop command. This is a workaround for mpv-0.30+ behavior, where 'stop + loadfile' only runs 'stop'. (defvar emms-player-mpv-ipc-stop-command nil (#$ . 6479)) #@337 Normal hook run right after establishing new JSON IPC connection to mpv. Runs before `emms-player-mpv-ipc-connect-command', if any. Best place to send any `observe_property', `request_log_messages', `enable_event' commands. Use `emms-player-mpv-ipc-id-get' to get unique id values for these. See also `emms-player-mpv-event-functions'. (defvar emms-player-mpv-event-connect-hook nil (#$ . 6808)) #@220 List of functions to call for each event emitted from JSON IPC. One argument is passed to each function - JSON line, as sent by mpv and decoded by `json-read-from-string'. See also `emms-player-mpv-event-connect-hook'. (defvar emms-player-mpv-event-functions nil (#$ . 7211)) #@195 Non-nil if playback was stopped by call from emms. Similar to `emms-player-stopped-p', but set for future async events, to indicate that playback should stop instead of switching to next track. (defvar emms-player-mpv-stopped nil (#$ . 7494)) #@71 Timer to delay `emms-player-stopped' when mpv unexpectedly goes idle. (defvar emms-player-mpv-idle-timer (byte-code "\300\301\302\211\211\211\211\211\211\211& \207" [vector t nil] 10) (#$ . 7743)) #@77 Delay before issuing `emms-player-stopped' when mpv unexpectedly goes idle. (defvar emms-player-mpv-idle-delay 0.5 (#$ . 7946)) #@233 Non-nil to enable workaround for issue #31901 in emacs 26.1. Emacs 26.1 fails to indicate missing socket file error for unix socket network processes that were started with :nowait t, so blocking connections are used there instead. (defvar emms-player-mpv-ipc-conn-emacs-26\.1-workaround (byte-code "\302U\205 \303U\207" [emacs-major-version emacs-minor-version 26 1] 2) (#$ . 8081)) #@128 Enable to print sent/received JSON lines and process start/stop events to *Messages* buffer using `emms-player-mpv-debug-msg'. (defvar emms-player-mpv-debug nil (#$ . 8475)) #@125 Timestamp offset for `emms-player-mpv-debug-msg'. Set on first use, with intent to both shorten and obfuscate time in logs. (defvar emms-player-mpv-debug-ts-offset nil (#$ . 8656)) #@10 (fn S) (defalias 'emms-player-mpv-debug-trim #[257 "\211;\203 \300\301\302\303\211%\207\207" [replace-regexp-in-string "\\(^[ \n ]+\\|[ \n ]+$\\)" "" t] 7 (#$ . 8843)]) #@236 Print debug message to *Messages* if `emms-player-mpv-debug' is non-nil. Message is only formatted if TPL-VALUES is non-empty. Strips whitespace from start/end of TPL-OR-MSG and strings in TPL-VALUES. (fn TPL-OR-MSG &rest TPL-VALUES) (defalias 'emms-player-mpv-debug-msg #[385 "\2050\302!\262\303\302\"\262\211\204\304\305\306\307\211%\262\310 \204$\211\311\312\313P Z$\262\207" [emms-player-mpv-debug emms-player-mpv-debug-ts-offset emms-player-mpv-debug-trim seq-map replace-regexp-in-string "%" "%%" t float-time apply message "emms-player-mpv %.1f "] 8 (#$ . 9025)]) #@145 Returns non-nil if --input-file fifo should be used. Runs `emms-player-mpv-ipc-detect' to detect/set `emms-player-mpv-ipc-method' if necessary. (defalias 'emms-player-mpv-ipc-fifo-p #[0 "\204\302 !\303=\207" [emms-player-mpv-ipc-method emms-player-mpv-command-name emms-player-mpv-ipc-detect file] 2 (#$ . 9621)]) #@257 Run mpv --version and return symbol for best IPC method supported. CMD should be either name of mpv binary to use or full path to it. Return values correspond to `emms-player-mpv-ipc-method' options. Error is signaled if mpv binary fails to run. (fn CMD) (defalias 'emms-player-mpv-ipc-detect #[257 "\300\301!r\211q\210\302\303\304\305\306!\307\"\310$\216\311\312\313\312\314%\211\303U\204/\315\316\"c\210\317\315\320\321 #!\210eb\210\322\323\312\324\325$\203L\326\327\330\331\332\333\325!\334\324#\"\335#\202M\336\337\340\"\203X\341\202d\337\342\"\203c\343\202d\344\262\262*\207" [generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 call-process nil (t t) "--version" format "----- process exited with code %d -----" error "Failed to run mpv binary [%s]:\n%s" buffer-string re-search-forward "^mpv\\s-+\\(\\([0-9]+\\.?\\)+\\)" t 1 mapconcat #[257 "\300\301\"\207" [format "%03d"] 4 "\n\n(fn N)"] seq-map string-to-number split-string match-string-no-properties "\\." "." "000.000.000" string> "000.006.999" file "000.016.999" unix-socket ipc-server] 11 (#$ . 9947)]) #@248 Return whether playback in PROC or `emms-player-mpv-proc' is started, which is distinct from 'start-command sent' and 'process is running' states. Used to signal emms via `emms-player-started' and `emms-player-stopped' calls. (fn &optional PROC) (defalias 'emms-player-mpv-proc-playing-p #[256 "\211\206\211\205 \301\302\"\207" [emms-player-mpv-proc process-get mpv-playing] 5 (#$ . 11108)]) #@101 Set process mpv-playing state flag for `emms-player-mpv-proc-playing-p'. (fn STATE &optional PROC) (defalias 'emms-player-mpv-proc-playing #[513 "\211\206\211\205\301\302#\207" [emms-player-mpv-proc process-put mpv-playing] 7 (#$ . 11513)]) #@109 Get unique process-specific id integer for SYM or nil if it was already requested. (fn SYM &optional PROC) (defalias 'emms-player-mpv-proc-symbol-id #[513 "\211\206\301\302\303!P!\304\"?\205\305 \306#\210\211\262\207" [emms-player-mpv-proc intern "mpv-sym-" symbol-name process-get emms-player-mpv-ipc-id-get process-put] 9 (#$ . 11769)]) #@232 Create named pipe (fifo) socket for mpv --input-file PATH, if not exists already. Optional MODE should be 12-bit octal integer, e.g. #o600 (safe default). Signals error if mkfifo exits with non-zero code. (fn PATH &optional MODE) (defalias 'emms-player-mpv-proc-init-fifo #[513 "\300!\211\203\301\302\3038\"\204\304!\210\305\262\211?\205:\306\307\305\211\211\310\311\206)\312\"&\313U?\205:\314\310\315\"!\207" [file-attributes string-prefix-p "p" 8 delete-file nil call-process "mkfifo" format "--mode=%o" 384 0 error "Failed to run mkfifo for mpv --input-file path: %s"] 11 (#$ . 12128)]) #@16 (fn PROC EV) (defalias 'emms-player-mpv-proc-sentinel #[514 "\300!\301!\302\303%\210\304>\205\211\205\305 \207" [process-status emms-player-mpv-proc-playing-p emms-player-mpv-debug-msg "proc[%s]: %s (status=%s, playing=%s)" (exit signal) emms-player-stopped] 10 (#$ . 12742)]) #@131 initialize new mpv process as `emms-player-mpv-proc'. MEDIA-ARGS are used instead of --idle, if specified. (fn &rest MEDIA-ARGS) (defalias 'emms-player-mpv-proc-init #[128 "\306 \210\307\310!!\204\311\310!!\210\312 \203\313!\210 \314\nC\315!\203) \202*\316\317 #C\2065\320$\f\314\321\322\"?\205A \323\324\"\"\325\326\327\330\331\332\333\334\335\336&\n\"\312 \203`\337\334!\210\340\341\"#)\207" [emms-player-mpv-ipc-socket emms-player-mpv-parameters emms-player-mpv-command-name emms-player-mpv-ipc-method emms-player-mpv-environment process-environment emms-player-mpv-proc-stop file-directory-p file-name-directory make-directory emms-player-mpv-ipc-fifo-p emms-player-mpv-proc-init-fifo append functionp format "--input-%s=%s" ("--idle") seq-some not seq-filter identity make-process :name "emms-player-mpv" :buffer nil :command :noquery t :sentinel emms-player-mpv-proc-sentinel emms-player-mpv-proc-playing emms-player-mpv-debug-msg "proc[%s]: start %s" emms-player-mpv-proc] 15 (#$ . 13039)]) #@159 Stop running `emms-player-mpv-proc' instance via SIGINT, if any. `delete-process' (SIGKILL) timer is started if `emms-player-mpv-proc-kill-delay' is non-nil. (defalias 'emms-player-mpv-proc-stop #[0 "\205/\302\303\"\210\304!\204\305!\210\202+\306\307\"\210\310!\210 \203+\311 \307\312$\210\210\307\211\207" [emms-player-mpv-proc emms-player-mpv-proc-kill-delay emms-player-mpv-debug-msg "proc[%s]: stop" process-live-p delete-process emms-player-mpv-proc-playing nil interrupt-process run-at-time #[257 "\300!\207" [delete-process] 3 "\n\n(fn PROC)"]] 6 (#$ . 14070)]) #@16 (fn PROC EV) (defalias 'emms-player-mpv-ipc-sentinel #[514 "\301\302#\210\303!\304>\205 \305\306!\210\205 \307\310\307#\262\207" [emms-player-mpv-ipc-connect-command emms-player-mpv-debug-msg "ipc[%s]: %s" process-status (open run) run-hooks emms-player-mpv-event-connect-hook nil emms-player-mpv-ipc-req-send] 7 (#$ . 14660)]) #@15 (fn PROC S) (defalias 'emms-player-mpv-ipc-filter #[514 "\300\301!!\205Or\301!q\210`\302!U\212\302!b\210c\210\302!`\303\223\210)\211\203-\302!b\210\210e\211b\210\303\210g\304\232\205L`{T|\210\305!\266\202/\262)\207" [buffer-live-p process-buffer process-mark nil 10 emms-player-mpv-ipc-recv] 7 (#$ . 15007)]) #@293 Make IPC connection attempt, rescheduling if there's no socket by (car DELAYS). (cdr DELAYS) gets passed to next connection attempt, so it can be rescheduled further until function runs out of DELAYS values. Sets `emms-player-mpv-ipc-proc' value to resulting process on success. (fn DELAYS) (defalias 'emms-player-mpv-ipc-connect #[257 "\304\305@\"\210?\3061(\307\310\311\312\313\314 \315\316\317\320\321\n!\322\323\324\325\326\327&0\202*\210\330\331 !\2043\330 \203@\211\204@\327 \332\"\210\210 ?\205R\211\205R\333@\330\334A$\207" [emms-player-mpv-ipc-conn-emacs-26\.1-workaround emms-player-mpv-ipc-socket emms-player-mpv-ipc-buffer emms-player-mpv-ipc-proc emms-player-mpv-debug-msg "ipc: connect-delay %s" (file-error) make-network-process :name "emms-player-mpv-ipc" :family local :service :nowait :coding (utf-8 . utf-8) :buffer get-buffer-create :noquery t :filter emms-player-mpv-ipc-filter :sentinel emms-player-mpv-ipc-sentinel nil process-live-p open run-at-time emms-player-mpv-ipc-connect] 21 (#$ . 15344)]) #@113 Set `emms-player-mpv-ipc-proc' to process wrapper for writing to a named pipe (fifo) file/node or signal error. (defalias 'emms-player-mpv-ipc-connect-fifo #[0 "\303\304\305\306\307\310!\"#\311 \305\"\210 \204\312\306\313\"!\210\n\205(\n\305\314 \"\262\207" [emms-player-mpv-ipc-socket emms-player-mpv-ipc-proc emms-player-mpv-ipc-connect-command start-process-shell-command "emms-player-mpv-input-file" nil format "cat > \"%s\"" shell-quote-argument set-process-query-on-exit-flag error "Failed to start cat-pipe to fifo: %s" emms-player-mpv-ipc-fifo-cmd] 7 (#$ . 16389)]) #@66 Initialize new mpv ipc socket/file process and associated state. (defalias 'emms-player-mpv-ipc-init #[0 "\305 \210\306\307!\210\310 \203\311 \207\203\312!\210r\313 !q\210\314 \210)\315\316\211\317\f@\316\320\fA$\211\207" [emms-player-mpv-ipc-connect-timer emms-player-mpv-ipc-buffer emms-player-mpv-ipc-id emms-player-mpv-ipc-req-table emms-player-mpv-ipc-connect-delays emms-player-mpv-ipc-stop emms-player-mpv-debug-msg "ipc: init" emms-player-mpv-ipc-fifo-p emms-player-mpv-ipc-connect-fifo cancel-timer get-buffer-create erase-buffer 1 nil run-at-time emms-player-mpv-ipc-connect] 6 (#$ . 16978)]) (defalias 'emms-player-mpv-ipc-stop #[0 "\205\301\302!\210\303!\210\304\211\207" [emms-player-mpv-ipc-proc emms-player-mpv-debug-msg "ipc: stop" delete-process nil] 2]) #@237 Return open IPC socket/fifo process or nil, (re-)starting mpv/connection if necessary. Return nil when starting async process/connection, and any follow-up command should be stored to `emms-player-mpv-ipc-connect-command' in this case. (defalias 'emms-player-mpv-ipc #[0 "\302!?\205 \303 ?\205,\302!\204\304 \210\302 !\204\305 \210 \205,\306 !\307>\205, \207" [emms-player-mpv-proc emms-player-mpv-ipc-proc process-live-p emms-player-mpv-ipc-fifo-p emms-player-mpv-proc-init emms-player-mpv-ipc-init process-status (open run)] 2 (#$ . 17772)]) #@75 Get new connection-unique id value, tracked via `emms-player-mpv-ipc-id'. (defalias 'emms-player-mpv-ipc-id-get #[0 "\211 W\203\fT\202 \302\211\207" [emms-player-mpv-ipc-id emms-player-mpv-ipc-id-max 1] 3 (#$ . 18332)]) #@633 Send JSON IPC request and assign HANDLER to response for it, if any. CMD value is encoded via `json-encode'. HANDLER func will be called with decoded response JSON as (handler data err), where ERR will be either nil on "success", 'connection-error or whatever is in JSON. If HANDLER is nil, default `emms-player-mpv-ipc-req-error-printer' will be used to at least log errors. Multiple commands can be batched in one list as '(batch (cmd1 . handler1) ...), in which case common HANDLER argument is ignored. PROC can be specified to avoid `emms-player-mpv-ipc' call (e.g. from sentinel/filter funcs). (fn CMD &optional HANDLER PROC) (defalias 'emms-player-mpv-ipc-req-send #[769 "<\203@\301=\203A\202BC\211\205\202\211@\211\211\203)\211A\262\242\2020\302\303\304GD\"\305 \2068\306 \206=\307\204D\310 \311\312\313F!\314P\315\316\"\210\3171_\320\"0\202m\321 \210\304\322\"\210\304\211\262\262\266\211\203y\323#\210\266A\266\202\202\207" [emms-player-mpv-ipc-req-table batch signal wrong-number-of-arguments nil emms-player-mpv-ipc-id-get emms-player-mpv-ipc emms-player-mpv-ipc-req-error-printer make-hash-table json-encode :command :request_id "\n" emms-player-mpv-debug-msg "json >> %s" (error) process-send-string emms-player-mpv-proc-stop connection-error puthash] 15 (#$ . 18564)]) #@62 Run handler-func for specified req-id. (fn REQ-ID DATA ERR) (defalias 'emms-player-mpv-ipc-req-resolve #[771 "\205\301\"\302\230?\205\303\"\210\205\"\266\202\207" [emms-player-mpv-ipc-req-table gethash "success" remhash] 8 (#$ . 19898)]) #@93 Simple default `emms-player-mpv-ipc-req-send' handler to log errors, if any. (fn DATA ERR) (defalias 'emms-player-mpv-ipc-req-error-printer #[514 "\211\205\300\301\"\207" [message "emms-player-mpv ipc-error: %s"] 5 (#$ . 20160)]) #@143 Handler for all JSON lines from mpv process. Only used with JSON IPC, never called with --input-file as there's no feedback there. (fn JSON) (defalias 'emms-player-mpv-ipc-recv #[257 "\300\301\"\210\302!\303\304\"\303\305\"\203\"\306\303\307\"\303\310\"#\210\211\205.\311!\210\312\313\"\207" [emms-player-mpv-debug-msg "json << %s" json-read-from-string alist-get request_id event emms-player-mpv-ipc-req-resolve data error emms-player-mpv-event-handler run-hook-with-args emms-player-mpv-event-functions] 10 (#$ . 20401)]) #@142 Send --input-file command string for older mpv versions. PROC can be specified to avoid `emms-player-mpv-ipc' call. (fn CMD &optional PROC) (defalias 'emms-player-mpv-ipc-fifo-cmd #[513 "\211\206\300 \301\302\303#\304P\305\306\"\210\307\"\207" [emms-player-mpv-ipc mapconcat #[257 "\300\301\"\207" [format "%s"] 4 "\n\n(fn S)"] " " "\n" emms-player-mpv-debug-msg "fifo >> %s" process-send-string] 7 (#$ . 20947)]) #@203 Send mpv observe_property command for property identified by SYM. Only sends command once per process, removing any potential duplication if used for same properties from different functions. (fn SYM) (defalias 'emms-player-mpv-observe-property #[257 "\300!\211\205 \301\302E!\207" [emms-player-mpv-proc-symbol-id emms-player-mpv-ipc-req-send observe_property] 6 (#$ . 21376)]) #@75 Delayed check for switching tracks when mpv goes idle for no good reason. (defalias 'emms-player-mpv-event-idle #[0 "\301\302\"\210?\205\f\303 \207" [emms-player-mpv-stopped emms-player-mpv-debug-msg "idle-check (stopped=%s)" emms-player-stopped] 3 (#$ . 21765)]) #@163 Handler for supported mpv events, including property changes. Called before `emms-player-mpv-event-functions' and does same thing as these hooks. (fn JSON-DATA) (defalias 'emms-player-mpv-event-handler #[257 "\304\305\"\211\306\232\203\307 ?\205b\310\311!\210\312!\202b\211\313\232\203?\307 \203,\310\314!\210\315 \210 \205b \311=\2049 \210\314\211\202b\211\316\232\203U\317\n!\210\320 \314\321#\314\211\202b\211\322\232\203a\317\n!\202b\314\207" [emms-player-mpv emms-player-mpv-ipc-stop-command emms-player-mpv-idle-timer emms-player-mpv-idle-delay alist-get event "playback-restart" emms-player-mpv-proc-playing-p emms-player-mpv-proc-playing t emms-player-started "end-file" nil emms-player-stopped "idle" cancel-timer run-at-time emms-player-mpv-event-idle "start-file"] 6 (#$ . 22039)]) #@85 Hook function for `emms-player-mpv-event-connect-hook' to update metadata from mpv. (defalias 'emms-player-mpv-info-meta-connect-func #[0 "\300\301!\207" [emms-player-mpv-observe-property metadata] 2 (#$ . 22858)]) #@98 Hook function for `emms-player-mpv-event-functions' to update metadata from mpv. (fn JSON-DATA) (defalias 'emms-player-mpv-info-meta-event-func #[257 "\300\301\"\302\230\205\300\303\"\304\230\205\300\305\"\211\205\306!\262\207" [alist-get event "property-change" name "metadata" data emms-player-mpv-info-meta-update-track] 4 (#$ . 23079)]) #@141 Update TRACK with mpv metadata from INFO-ALIST. `emms-playlist-current-selected-track' is used by default. (fn INFO-ALIST &optional TRACK) (defalias 'emms-player-mpv-info-meta-update-track #[513 "\300\301\"\210\211\204 \302 \262\303\304\"\206\303\305\"\211\203\"\306\307#\210\210\303\310\"\2065\303\311\"\2065\303\312\"\211\203?\306\313#\210\210\303\314\"\211\203N\306\315#\210\210\303\316\"\211\203]\306\317#\210\210\303\320\"\211\203l\306\321#\210\210\303\322\"\211\203{\306\323#\210\210\303\324\"\211\203\212\306\325#\210\210\326!\207" [mapc #[257 "\211\300\301@!\227!\240\207" [intern symbol-name] 5 "\n\n(fn CC)"] emms-playlist-current-selected-track alist-get title icy-title emms-track-set info-title artist album_artist icy-name info-artist album info-album track info-tracknumber date info-year genre info-genre comment info-note emms-track-updated] 7 (#$ . 23439)]) #@104 Hook function for `emms-player-mpv-event-functions' to update track duration from mpv. (fn JSON-DATA) (defalias 'emms-player-mpv-info-duration-event-func #[257 "\300\301\"\302\230\205 \303 \207" [alist-get event "playback-restart" emms-player-mpv-info-duration-check] 4 (#$ . 24363)]) #@76 Check whether current mpv track has reliable duration info and request it. (defalias 'emms-player-mpv-info-duration-check #[0 "\300\301\302\"\207" [emms-player-mpv-ipc-req-send (get_property stream-end) #[514 "\211\203\211;\205\f\211\300\230?\205\301\"\207\205\302\303\304\"\207" ["property unavailable" emms-player-mpv-ipc-req-error-printer emms-player-mpv-ipc-req-send (get_property duration) emms-player-mpv-info-duration-handler] 5 "\n\n(fn PTS-END ERR)"]] 3 (#$ . 24657)]) #@91 Duration property request handler to update it for current emms track. (fn DURATION ERR) (defalias 'emms-player-mpv-info-duration-handler #[514 "\211\203 \300\301\"\207\247\2050\302V\2050\303!\304 \305\306#\210\305\307\310\245#\210\305\311\310\246#\266\202\207" [emms-player-mpv-debug-msg "duration-req-error: %s" 0 round emms-playlist-current-selected-track emms-track-set info-playing-time info-playing-time-min 60 info-playing-time-sec] 9 (#$ . 25151)]) #@337 Send mpv command to process/connection if both are running, or otherwise schedule start/connect and set `emms-player-mpv-ipc-connect-command' for `emms-player-mpv-ipc-sentinel'. Multiple commands can be batched in one list as '(batch (cmd1 . handler1) ...), in which case common HANDLER argument is ignored. (fn CMD &optional HANDLER) (defalias 'emms-player-mpv-cmd #[513 "\301\302 \211\203\303 \203\304\"\202\305#\202\211\207" [emms-player-mpv-ipc-connect-command nil emms-player-mpv-ipc emms-player-mpv-ipc-fifo-p emms-player-mpv-ipc-fifo-cmd emms-player-mpv-ipc-req-send] 7 (#$ . 25629)]) #@492 Obsolete macro around `emms-player-mpv-cmd' that creates handler callback (see `emms-player-mpv-ipc-req-send') from HANDLER-BODY forms, which have following bindings: - mpv-cmd for CMD. - mpv-data for response data (decoded json, nil if none). - mpv-error for response error (nil if no error, decoded json or 'connection-error). Do not use it with new code - it will raise warnings when used with lexical bindings, and will be removed in a future EMMS version. (fn CMD &rest HANDLER-BODY) (defalias 'emms-player-mpv-cmd-prog '(macro . #[385 "\300\301\302\303BBEE\207" [emms-player-mpv-cmd apply-partially lambda (mpv-cmd mpv-data mpv-error)] 8 (#$ . 26245)])) (make-obsolete 'emms-player-mpv-cmd-prog nil "Emms 7") #@14 (fn TRACK) (defalias 'emms-player-mpv-playable-p #[257 "\300!\301>\207" [emms-track-type (file url streamlist playlist)] 3 (#$ . 26971)]) #@14 (fn TRACK) (defalias 'emms-player-mpv-start #[257 "\303\304\303!\210\305\306\"\305\307\"\310>\311 \203+\312 \210\313\203!\314\202\"\315\"\210\316 !\202\\\317\2034\320\2025\321\322BBC\323BB\324\325\326\327\330\331\332!\333\"\334\335%#\n\203X\211\211\202Z\211 \266\202\207" [emms-player-mpv-stopped emms-player-mpv emms-player-mpv-ipc-stop-command nil emms-player-mpv-proc-playing emms-track-get name type (streamlist playlist) emms-player-mpv-ipc-fifo-p emms-player-mpv-ipc-stop emms-player-mpv-proc-init "--playlist" "--" emms-player-started batch loadlist loadfile (replace) (((set pause no))) apply-partially emms-player-mpv-cmd make-byte-code 514 "\211\301=\205 \302\300!\207" vconcat vector [connection-error emms-player-mpv-cmd] 4 "\n\n(fn MPV-DATA MPV-ERROR)"] 13 (#$ . 27118)]) (defalias 'emms-player-mpv-stop #[0 "\302\211\303\304!\210\305\306!\210\307 \207" [emms-player-mpv-stopped emms-player-mpv-ipc-stop-command t emms-player-mpv-proc-playing nil emms-player-mpv-cmd (stop) emms-player-stopped] 3]) (defalias 'emms-player-mpv-pause #[0 "\300\301!\207" [emms-player-mpv-cmd (set pause yes)] 2]) (defalias 'emms-player-mpv-resume #[0 "\300\301!\207" [emms-player-mpv-cmd (set pause no)] 2]) #@12 (fn SEC) (defalias 'emms-player-mpv-seek #[257 "\300\301\302BB!\207" [emms-player-mpv-cmd seek (relative)] 5 (#$ . 28350)]) #@12 (fn SEC) (defalias 'emms-player-mpv-seek-to #[257 "\300\301\302BB!\207" [emms-player-mpv-cmd seek (absolute)] 5 (#$ . 28483)]) (byte-code "\301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\312\300!\207" [emms-player-mpv emms-player-set pause emms-player-mpv-pause resume emms-player-mpv-resume seek emms-player-mpv-seek seek-to emms-player-mpv-seek-to provide] 4)