;ELC ;;; Compiled by heimdall@baldur on Fri Feb 1 18:35:00 2008 ;;; from file /home/heimdall/repos/emms/jack.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 "`jack.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306\307%\207" [require emms-compat custom-declare-group jack nil "Jack Audio Connection Kit" :group processes] 6) #@26 *JACK run control paths. (custom-declare-variable 'jack-rc ''("~/.jackdrc" "/etc/jackd.conf") '(#$ . -727) :group 'jack :type 'repeat) #@204 *If non-nil, try to retrieve jack startup arguments from run control files listed in `jack-rc'. If no rc file is found or this variable is set to nil, use the Emacs variables to build the startup args. (custom-declare-variable 'jack-use-jack-rc 't '(#$ . -869) :group 'jack :type 'boolean) #@24 *JACK executable path. (custom-declare-variable 'jack-program '(executable-find "jackd") '(#$ . -1166) :group 'jack :type 'file) #@34 *Default sampling rate for JACK. (custom-declare-variable 'jack-sample-rate '44100 '(#$ . -1301) :group 'jack :type 'integer) #@54 *Period size to use when launching new JACK process. (custom-declare-variable 'jack-period-size '128 '(#$ . -1433) :group 'jack :type 'integer) #@25 *ALSA soundcard to use. (custom-declare-variable 'jack-alsa-device 'nil '(#$ . -1583) :group 'jack :type '(choice (const :tag "Ask" nil) string)) #@48 Read an ALSA device name using the minibuffer. (defalias 'jack-read-alsa-device #[nil "\302\303\304!\305\216r q\210\306\307!\210m\204,\310\311!\203&\312\313\314!\313\315!BC\"\315y\210\202+\316\317\320\321\302\322$\"AP)\207" [cards #1=#:temp-buffer nil generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents "/proc/asound/cards" looking-at "^\\([0-9]\\) \\[.+\\]: \\(.+\\)\n +\\(.*\\)$" append match-string 3 1 "hw:" assoc completing-read "Card: " t] 7 (#$ . 1735)]) (defalias 'jack-alsa-device #[nil "\206\301 \207" [jack-alsa-device jack-read-alsa-device] 1]) #@22 *Output buffer name. (custom-declare-variable 'jack-output-buffer-name '"*JACK output*" '(#$ . -2391) :group 'jack :type 'string) #@82 Return a list of startup arguments to use. First element is the executable path. (defalias 'jack-args #[nil "\203\n\304\305\215\206 \306\307\310\311\312\313 \"\311\314\n\"\311\315 \"\257\207" [jack-use-jack-rc jack-program jack-sample-rate jack-period-size rc-found (byte-code "\303\304\"\211\2037\305 @!\2030\306\307!\310\216r\nq\210\311 @!\210\312 \313V\203/\314\315\316\317 \320\"\"\210+ A\211\204 )\321\207" [jack-rc files #1=#:temp-buffer mapcar expand-file-name file-exists-p generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents buffer-size 0 throw rc-found split-string buffer-string "[\n ]+" nil] 6) "-v" "-R" "-dalsa" format "-d%s" jack-alsa-device "-r%d" "-p%d"] 9 (#$ . 2527)]) #@100 *Use set_rtlimits (if available) to gain realtime priorities if -R is given in jackd command-line. (custom-declare-variable 'jack-set-rtlimits 't '(#$ . -3315) :group 'jack :type 'boolean) #@24 *Path to set_rtlimits. (custom-declare-variable 'jack-set-rtlimits-program '(executable-find "set_rtlimits") '(#$ . -3510) :group 'jack :type 'file) (defalias 'jack-maybe-rtlimits #[(args) "\203\303 \235\204\304 \235\203\305\n!\203\306\n\307D \"\207 \207" [jack-set-rtlimits args jack-set-rtlimits-program "-R" "--realtime" file-exists-p append "-r"] 3]) (byte-code "\301B\302\301!\204\303\301\304\"\210\305B\302\305!\204\303\305\306\"\210\307B\302\307!\204-\303\307\306\"\210\310B\302\310!\204<\303\310\306\"\210\304\207" [current-load-list jack-process default-boundp set-default nil jack-load 0 jack-max-usecs jack-spare] 3) (defalias 'jack-output-buffer #[nil "\304!\206#r\305!q\210\306\307\310 !\311 \233\312\240\210\313\314\315\316\317$\210p)\207" [jack-output-buffer-name major-mode mode-name mode-line-format get-buffer get-buffer-create jack-mode "JACK" copy-tree 16 (:eval (format "load:%.2f" jack-load)) add-hook kill-buffer-hook jack-kill nil t] 5]) (byte-code "\301B\302\301!\204\303\301\304\"\210\304\207" [current-load-list jack-xruns default-boundp set-default nil] 3) (defalias 'jack-filter #[(proc string) "r\306!q\210`\307!U\212\310 \311\216\312\313 \"\2032\314\315\316 \"!\314\315\317 \"!\314\315\320 \"!\202V\312\321 \"\203G\314\315\316 \"!B\202V\307!b\210 c\210\307!`\322\223\210+ \205_\307!b*\207" [proc moving save-match-data-internal string jack-load jack-max-usecs process-buffer process-mark match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) string-match "^load = \\([^ ]+\\) max usecs: \\([^,]+\\), spare = \\(.+\\)$" string-to-number match-string 1 2 3 "^**** alsa_pcm: xrun of at least \\([^ ]+\\) msecs$" nil jack-spare jack-xruns] 4]) (defalias 'jack-running-p #[nil "\205\301!\205\302!\303=\207" [jack-process processp process-status run] 2]) #@70 *Hook run when `jack-start' successfully started a new JACK intance. (custom-declare-variable 'jack-started-hook 'nil '(#$ . -5399) :group 'jack :type 'hook) #@25 Start the JACK process. (defalias 'jack-start #[nil "\301 \203 \302\303!\207\304\305\306\307 \310\311 !$\312\313\"\210\314\315!\210\316\307 !\207" [jack-process jack-running-p error "JACK already running" apply start-process "jack" jack-output-buffer jack-maybe-rtlimits jack-args set-process-filter jack-filter run-hooks jack-started-hook switch-to-buffer] 6 (#$ . 5563) nil]) #@42 Kill the currently running JACK process. (defalias 'jack-kill #[nil "\301 \203 \302!\210\303\211\207" [jack-process jack-running-p delete-process nil] 2 (#$ . 5950) nil]) #@15 Restart JACK. (defalias 'jack-restart #[nil "\300 \203\301 \210\302\303!\210\304 \207" [jack-running-p jack-kill sit-for 0 jack-start] 2 (#$ . 6130) nil]) #@40 Retrieve a list of JACK clients/ports. (defalias 'jack-list #[nil "\305\306!\307\216rq\210\310\311\312\313\312\314%\210eb\210\312\211m\204\262\315\316!\203V\317\320!\317\321!\322\f\n\"\203G\322\f\n\"\323\322\f\n\"A C\211C\"\241\210\202R\323\f C\211DC\n\"*\202\254\315\324!\203\221\322\325 A\"\203}\322\325 A\"\323\322\325 \"A\317\320!\317\321!DC\"\241\210\202\254 \323\325\317\320!\317\321!DDC A\"\241\210\202\254\315\326!\203\254 \323\211\327C\330\331\332\317\320!\333\"\"\"C A\"\241\210\320y\210\202\n-\207" [#1=#:temp-buffer current-port result port program generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) call-process "jack_lsp" nil t "-cpl" looking-at "^\\([^ :]+\\):\\(.+\\)$" match-string 1 2 assoc append "^ \\([^ :]+\\):\\(.+\\)$" connections "^ properties: \\(.+\\),$" properties mapcar intern split-string ","] 9 (#$ . 6293)]) (defalias 'jack-ports #[(program) "\301\302 \"A\207" [program assoc jack-list] 3]) (defalias 'jack-get-port-connections #[(program port) "\302\303\302\304 !\"A\"A\207" [port program assoc connections jack-ports] 6]) (defalias 'jack-get-port-properties #[(program port) "\302\303\302\304 !\"A\"A\207" [port program assoc properties jack-ports] 6]) (defalias 'jack-get-direction #[(program port) "\303 \"\304\n\235@\206\305\n\235@\206\306\307!)\207" [program port props jack-get-port-properties output input error "Neither input nor output port"] 3]) (defalias 'jack-read-program #[(prompt &optional predicate) "\304!\203\305\306 \"\202\306 \211\204\307\310!\210 G\311W\203) \211@@)\202/\312 \313\314$)\207" [predicate progs x prompt functionp emms-remove-if-not jack-list error "No matching JACK clients found" 2 completing-read nil t] 6]) (defalias 'jack-unique-port-name #[(strings) "\303\304\305\306\307\"\"\211G W\203#\310\311\215\203#@\312\nGTO\211\202 \n*\207" [strings maxlen start "" apply min mapcar length not-ok (byte-code "@ G GTO\303\304\"\210)\305\207" [strings start nextchar mapc #[(str) " P\n\303GTO\230?\205\304\305\306\"\207" [start nextchar str 0 throw not-ok nil] 4] t] 3) 0] 7]) (defalias 'jack-read-port #[(program prompt &optional predicate) "\305!\203\306\307 !\"\202\307 !\211G\310W\203#\n\211@@)\202/\311\f\n\312\313\314\315\316\n\"!%)\207" [predicate program ports x prompt functionp emms-remove-if-not jack-ports 2 completing-read nil t jack-unique-port-name mapcar car] 10]) #@138 Connect FROM-PROGRAM's output port FROM-PORT to TO-PROGRAM's input port TO-PORT. If called interactively, the direction does not matter. (defalias 'jack-connect #[(from-program from-port to-program to-port) "\305\306\307\211\211\310\311 #\310\311\n #&\211\312U\205\313\314 \n %)\207" [from-program from-port to-program to-port result call-process "jack_connect" nil format "%s:%s" 0 message "JACK: Connected %s:%s to %s:%s"] 11 (#$ . 8776) (byte-code "\305\306!\307\310\311\"\"\312 \"\313=\203\314\202\313\305\310\315 #\316\"\307 \310\317 $\320#\n\313=\203= \fF\202B \f F-\207" [prog port to-type to-prog to-port jack-read-program "Connect: " jack-read-port format "Connect %s port: " jack-get-direction input output "Connect %s port %s to: " #[(prog) "\301\302A\"\207" [prog emms-find-if #[(port) "\302\303 A\"\235\207" [to-type port assoc properties] 4]] 3] "Connect %s port %s to %s port: " #[(port) "\302\303 A\"A\235\207" [to-type port assoc properties] 4]] 7)]) #@143 Disconnect FROM-PROGRAM's output port FROM-PORT from TO-PROGRAM's input port TO-PORT. If called interactively, the direction is not relevant. (defalias 'jack-disconnect #[(from-program from-port to-program to-port) "\305\306\307\211\211\310\311 #\310\311\n #&\211\312U\205\313\314 \n %)\207" [from-program from-port to-program to-port result call-process "jack_disconnect" nil format "%s:%s" 0 message "JACK: Disconnected %s:%s from %s:%s"] 11 (#$ . 9780) (byte-code "\306\307\310\"\311\312\313\"\314#\315 \" D\nG\316W\203#\n@\202v\317\320\321\n\"\210\322\323\f\")\211G\316W\203A \211@@)\202K\324\312\325 # \317\326$\327\330\n\"\211G\316W\203^\n@\202u\324\312\331 $\322\332\n\"\317\326$  )D*!\333 \"\334=\203\211\335 !\"\202\216\335! \"-\207" [prog port connections from result to-progs jack-read-program "Disconnect: " #[(prog) "\301\302A\"\207" [prog emms-find-if #[(port) "\301\302A\"\207" [port assoc connections] 3]] 3] jack-read-port format "Disconnect %s port: " #[(port) "\301\302A\"\207" [port assoc connections] 3] jack-get-port-connections 2 nil mapc #[(conn) "@ \235?\205\302@C \"\211\207" [conn result append] 3] mapcar list completing-read "Disconnect %s port %s from: " t emms-remove-if-not #[(conn) "@ \230\207" [conn to-prog] 2] "Disconnect %s port %s from %s port: " cdr jack-get-direction output append x to-prog to-port to] 7)]) (provide 'jack)