;ELC ;;; Compiled by heimdall@baldur on Fri Feb 1 18:35:01 2008 ;;; from file /home/heimdall/repos/emms/ogg-comment.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 "`ogg-comment.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #@51 The string indicating the start of an Ogg stream. (defconst oggc-ogg-header "OggS" (#$ . 585)) #@67 The string indicating the start of the Ogg identification header. (defconst oggc-identification-header "vorbis" (#$ . 686)) #@60 The string indicating the start of the Ogg comment header. (defconst oggc-comment-header "vorbis" (#$ . 817)) #@58 The string indicating the start of the Ogg setup header. (defconst oggc-setup-header "vorbis" (#$ . 934)) #@54 The string indicating the start of an Ogg code book. (defconst oggc-code-book-pattern "BCV" (#$ . 1047)) #@31 Ogg-comment's version number. (defconst oggc-version "$Revision: 1.5 $" (#$ . 1158)) #@144 Execute BODY in a buffer containing part of FILE. BEG and END are as `insert-file-contents' (q.v.). (fn (FILE &optional BEG END) &rest BODY) (defalias 'with-part-of-file '(macro . #[(file-spec &rest body) "\305\211\211 \211A@ \203 \211A@ \203 \211A@\306\307\n\305 \257\310\f+BBB\207" [end beg file file-spec body nil with-temp-buffer insert-file-contents-literally (goto-char (point-min))] 6 (#$ . 1250)])) #@175 Like `if', but with `it' bound to the result of TEST-FORM. `it' is accessible in the THEN and ELSE clauses. Warning, non-hygienic by design. (fn TEST-FORM THEN &rest ELSE) (defalias 'aif '(macro . #[(test-form then &rest else) "\303\304DC\305\304 \nBBBE\207" [test-form then else let it if] 6 (#$ . 1681)])) #@240 Split Ogg COMMENT into a (name, value) pair. If possible (`ccl-execute-on-string' and `ccl-decode-mule-utf-8' available), COMMENT is decoded into utf-8. The name-part is converted to lowercase, to make sure case-differences are ignored. (defalias 'oggc-split-comment #[(comment) "\302\303\"\211@\227\304\211A@)\206\305!D\207" [comment x split-string "=" oggc-decode-utf-8 ""] 4 (#$ . 1999)]) #@27 Encode STRING into utf-8. (defalias 'oggc-encode-utf-8 #[(string) "\302\303!\203\304\300!\203\303\305\306\307\" #\207 \207" [ccl-encode-mule-utf-8 string fboundp ccl-execute-on-string boundp make-vector 9 nil] 5 (#$ . 2405)]) #@27 Decode STRING from utf-8. (defalias 'oggc-decode-utf-8 #[(string) "\302\303!\203\304\300!\203\303\305\306\307\" #\207 \207" [ccl-decode-mule-utf-8 string fboundp ccl-execute-on-string boundp make-vector 9 nil] 5 (#$ . 2642)]) #@83 Read a string from `point' of LENGTH characters. Advances to (+ LENGTH (point)). (defalias 'oggc-read-string #[(length) "\301``\\b\"\207" [length buffer-substring-no-properties] 4 (#$ . 2879)]) #@74 Return non-nil if the current buffer contains a valid Ogg-Vorbis stream. (defalias 'oggc-valid-ogg-stream-p #[nil "\302\303d^\304#\204\305\306!\210\302 \307d^\304#\206\305\310!\207" [oggc-ogg-header oggc-identification-header search-forward 100 t error "File does not appear to be a valid ogg stream" 300 "Not a valid ogg stream"] 4 (#$ . 3081)]) #@77 Return the value of `point' where comments are found in the current buffer. (defalias 'oggc-comment-exists-p #[nil "\212\303\304\305#\210`)\303\n \305#\205`)\207" [oggc-setup-header max oggc-comment-header search-forward nil t] 4 (#$ . 3439)]) #@32 Read N bytes as a LSB integer. (defalias 'oggc-bytes-to-lsb-int #[(n) "\304 \304\nW\203 \305\306\"\307f\310u\210_\\T\211\202 +\207" [i n #1=#:--cl-var-- #2=#:--cl-var-- 0 expt 256 nil 1] 5 (#$ . 3693)]) #@57 Return a list of N bytes encoding INT as a LSB integer. (defalias 'oggc-int-to-lsb-bytes #[(int n) "S\305\211 \306Y\203*\307\310 \"\311\f\n\" B\n\fX\203#\f\n\245 S\211\202 \237+\237\207" [n i exp #1=#:--cl-var-- int nil 0 expt 256 floor] 4 (#$ . 3914)]) #@310 Construct an Ogg-Vorbis comment header from COMMENT-LIST. COMMENT-LIST should be of the form (TITLE VALUE). VALUE is encoded into UTF-8 if possible (`ccl-execute-on-string' and `ccl-decode-mule-utf-8' available). The length of the thus ensuing comment header is prepended to the string as a 4-byte lsb int. (defalias 'oggc-construct-comment-field #[(comment-list) "\211A@\211A@ \303\304\n!Q\305 G\306\" P*\207" [comment-list title value "=" oggc-encode-utf-8 oggc-int-to-lsb-bytes 4] 4 (#$ . 4187)]) #@40 Construct a vendor string from VENDOR. (defalias 'oggc-construct-vendor #[(vendor) "\301G\302\"P\207" [vendor oggc-int-to-lsb-bytes 4] 3 (#$ . 4702)]) #@92 Write COMMENTS to FILE. COMMENTS should be as for `oggc-construct-comment-string' (q.v.). (defalias 'oggc-write-comments #[(file comments) "\304\305!\306\216rq\210\307 !\210\310 \2054\311 \203/\212\312 )`\313`!\210`|\210\314\n!\315 !\261\210)\316\317\211 #+\207" [#1=#:temp-buffer file vendor comments generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents-literally oggc-valid-ogg-stream-p oggc-comment-exists-p oggc-read-vendor oggc-read-comments oggc-construct-vendor oggc-construct-comment-string write-region nil] 4 (#$ . 4861)]) #@149 Construct a string off Ogg-Vorbis comment headers from COMMENTS. COMMENTS should be an alist of the form: ((TITLE-1 VALUE-1) (TITLE-2 VALUE-2)) (defalias 'oggc-construct-comment-string #[(comments) "\301G\302\"\303\304\305#P\207" [comments oggc-int-to-lsb-bytes 4 mapconcat oggc-construct-comment-field ""] 5 (#$ . 5486)]) #@59 Read an Ogg-Vorbis vendor string from the current buffer. (defalias 'oggc-read-vendor #[nil "\301\302!\303!)\207" [length oggc-bytes-to-lsb-int 4 oggc-read-string] 2 (#$ . 5821)]) #@64 Read Ogg-Vorbis comments, starting POS bytes from `point-min'. (defalias 'oggc-read-comments #[(pos) "b\210\306 \307\310!\311\n\311\211 \fS\211\312Y\203/\307\310!\313 ! \314 ! B\202+ \237+D\207" [pos comments length vendor #1=#:--cl-var-- this-length oggc-read-vendor oggc-bytes-to-lsb-int 4 nil 0 oggc-read-string oggc-split-comment c] 3 (#$ . 6009)]) #@38 Read an Ogg-Vorbis header from FILE. (defalias 'oggc-read-header #[(file) "\303\304!\305\216rq\210\306 \307\310\311\310\\$\210eb\210\312 \205&\313 \211\205%\314\n!)+\207" [#1=#:temp-buffer file it generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents-literally nil 0 28672 oggc-valid-ogg-stream-p oggc-comment-exists-p oggc-read-comments] 7 (#$ . 6384)]) #@50 Print Ogg HEADER readably in a temporary buffer. (defalias 'oggc-pretty-print-header #[(header) "@\211A@)\304\305\306!!\210\307 \210\310 \311\261\210\312\313\n\"*\207" [header x comments vendor switch-to-buffer get-buffer-create "*comments*" erase-buffer "Vendor: " "\n" mapc #[(s) "@\302\211A@)\303\261\207" [s x ": " "\n"] 5]] 4 (#$ . 6827)]) #@67 Show a pretty printed representation of the Ogg Comments in FILE. (defalias 'oggc-show-header #[(file) "\301\302!!\207" [file oggc-pretty-print-header oggc-read-header] 3 (#$ . 7188) "FFile: "]) (provide 'ogg-comment)