;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\207" [require bindat cl-lib emms-info seq subr-x] 2) #@485 Maximum buffer size for metadata decoding. Functions called by `emms-info-native' read certain amounts of data into a temporary buffer while decoding metadata. This variable controls the maximum size of that buffer: if more than `emms-info-native--max-peek-size' bytes are needed, an error is signaled. Technically metadata blocks can have almost arbitrary lengths, but in practice processing must be constrained to prevent memory exhaustion in case of garbled or malicious inputs. (defconst emms-info-native--max-peek-size 2097152 (#$ . 215)) #@114 Last decoded Opus channel count. This is a kludge; it is needed because bindat spec cannot refer outside itself. (defvar emms-info-native--opus-channel-count 0 (#$ . 768)) #@109 Last decoded id3v2 version. This is a kludge; it is needed because bindat spec cannot refer outside itself. (defvar emms-info-native--id3v2-version 0 (#$ . 947)) #@351 Maximum number of Vorbis comment fields in a stream. Technically a single Vorbis stream may have up to 2^32 comments, but in practice processing must be constrained to prevent memory exhaustion in case of garbled or malicious inputs. This limit is used with Opus and FLAC streams as well, since their comments have almost the same format as Vorbis. (defconst emms-info-native--max-num-vorbis-comments 1024 (#$ . 1116)) #@355 Maximum length for a single Vorbis comment field. Technically a single Vorbis comment may have a length up to 2^32 bytes, but in practice processing must be constrained to prevent memory exhaustion in case of garbled or malicious inputs. This limit is used with Opus and FLAC streams as well, since their comments have almost the same format as Vorbis. (defconst emms-info-native--max-vorbis-comment-size 65536 (#$ . 1543)) #@331 Maximum length of Vorbis vendor string. Technically a vendor string can be up to 2^32 bytes long, but in practice processing must be constrained to prevent memory exhaustion in case of garbled or malicious inputs. This limit is used with Opus and FLAC streams as well, since their comments have almost the same format as Vorbis. (defconst emms-info-native--max-vorbis-vendor-length 1024 (#$ . 1975)) #@59 EMMS info fields that are extracted from Vorbis comments. (defconst emms-info-native--accepted-vorbis-fields '("album" "albumartist" "albumartistsort" "albumsort" "artist" "artistsort" "composer" "composersort" "date" "discnumber" "genre" "label" "originaldate" "originalyear" "performer" "title" "titlesort" "tracknumber" "year") (#$ . 2382)) #@123 Specification for first two Vorbis header packets. They are always an identification header followed by a comment header. (defconst emms-info-native--vorbis-headers-bindat-spec '((identification-header struct emms-info-native--vorbis-identification-header-bindat-spec) (comment-header struct emms-info-native--vorbis-comment-header-bindat-spec)) (#$ . 2733)) #@45 Vorbis identification header specification. (defconst emms-info-native--vorbis-identification-header-bindat-spec '((packet-type u8) (eval (unless (= last 1) (error "Vorbis header type mismatch: expected 1, got %s" last))) (vorbis vec 6) (eval (unless (equal last emms-info-native--vorbis-magic-array) (error "Vorbis framing mismatch: expected `%s', got `%s'" emms-info-native--vorbis-magic-array last))) (vorbis-version u32r) (eval (unless (= last 0) (error "Vorbis version mismatch: expected 0, got %s" last))) (audio-channels u8) (audio-sample-rate u32r) (bitrate-maximum u32r) (bitrate-nominal u32r) (bitrate-minimum u32r) (blocksize u8) (framing-flag u8) (eval (unless (= last 1)) (error "Vorbis framing bit mismatch: expected 1, got %s" last))) (#$ . 3098)) #@39 Header packet magic pattern `vorbis'. (defconst emms-info-native--vorbis-magic-array [118 111 114 98 105 115] (#$ . 3867)) #@38 Vorbis comment header specification. (defconst emms-info-native--vorbis-comment-header-bindat-spec '((packet-type u8) (eval (unless (= last 3) (error "Vorbis header type mismatch: expected 3, got %s" last))) (vorbis vec 6) (eval (unless (equal last emms-info-native--vorbis-magic-array) (error "Vorbis framing mismatch: expected `%s', got `%s'" emms-info-native--vorbis-magic-array last))) (vendor-length u32r) (eval (when (> last emms-info-native--max-vorbis-vendor-length) (error "Vorbis vendor length %s is too long" last))) (vendor-string vec (vendor-length)) (user-comments-list-length u32r) (eval (when (> last emms-info-native--max-num-vorbis-comments) (error "Vorbis user comment list length %s is too long" last))) (user-comments repeat (user-comments-list-length) (struct emms-info-native--vorbis-comment-field-bindat-spec)) (framing-bit u8) (eval (unless (= last 1)) (error "Vorbis framing bit mismatch: expected 1, got %s" last))) (#$ . 3996)) #@37 Vorbis comment field specification. (defconst emms-info-native--vorbis-comment-field-bindat-spec '((length u32r) (eval (when (> last emms-info-native--max-vorbis-comment-size) (error "Vorbis comment length %s is too long" last))) (user-comment vec (length))) (#$ . 4958)) #@472 Return a decoded list of comments from USER-COMMENTS. USER-COMMENTS should be a list of Vorbis comments according to `user-comments' field in `emms-info-native--vorbis-comment-header-bindat-spec', `emms-info-native--opus-comment-header-bindat-spec' or `emms-info-native--flac-comment-block-bindat-spec'. Return comments in a list of (FIELD . VALUE) cons cells. Only FIELDs that are listed in `emms-info-native--accepted-vorbis-fields' are returned. (fn USER-COMMENTS) (defalias 'emms-info-native--extract-vorbis-comments #[257 "\300\211\203\211@\301\236A\302!\211B\262\266A\266\202\202\210\303\304\"\207" [nil user-comment emms-info-native--split-vorbis-comment seq-filter #[257 "\211@\235\207" [emms-info-native--accepted-vorbis-fields] 3 "\n\n(fn ELT)"]] 8 (#$ . 5237)]) #@344 Split Vorbis comment to a field-value pair. Vorbis comments are of form `FIELD=VALUE'. FIELD is a case-insensitive field name with a restricted set of ASCII characters. VALUE is an arbitrary UTF-8 encoded octet stream. Return a cons cell (FIELD . VALUE), where FIELD is converted to lower case and VALUE is the decoded value. (fn COMMENT) (defalias 'emms-info-native--split-vorbis-comment #[257 "\300\301\302\303#\304\"\305\306\"\205\307\310\"\227\307\311\"B\207" [decode-coding-string mapconcat byte-to-string nil utf-8 string-match "^\\(.+?\\)=\\(.+?\\)$" match-string 1 2] 6 (#$ . 6033)]) #@121 Specification for two first Opus header packets. They are always an identification header followed by a comment header. (defconst emms-info-native--opus-headers-bindat-spec '((identification-header struct emms-info-native--opus-identification-header-bindat-spec) (comment-header struct emms-info-native--opus-comment-header-bindat-spec)) (#$ . 6642)) #@43 Opus identification header specification. (defconst emms-info-native--opus-identification-header-bindat-spec '((opus-head vec 8) (eval (unless (equal last emms-info-native--opus-head-magic-array) (error "Opus framing mismatch: expected `%s', got `%s'" emms-info-native--opus-head-magic-array last))) (opus-version u8) (eval (unless (< last 16) (error "Opus version mismatch: expected < 16, got %s" last))) (channel-count u8) (eval (setq emms-info-native--opus-channel-count last)) (pre-skip u16r) (sample-rate u32r) (output-gain u16r) (channel-mapping-family u8) (union (channel-mapping-family) (0 nil) (t (struct emms-info-native--opus-channel-mapping-table)))) (#$ . 6999)) #@54 Opus identification header magic pattern `OpusHead'. (defconst emms-info-native--opus-head-magic-array [79 112 117 115 72 101 97 100] (#$ . 7681)) #@43 Opus channel mapping table specification. (defconst emms-info-native--opus-channel-mapping-table '((stream-count u8) (coupled-count u8) (channel-mapping vec (eval emms-info-native--opus-channel-count))) (#$ . 7834)) #@36 Opus comment header specification. (defconst emms-info-native--opus-comment-header-bindat-spec '((opus-tags vec 8) (eval (unless (equal last emms-info-native--opus-tags-magic-array) (error "Opus framing mismatch: expected `%s', got `%s'" emms-info-native--opus-tags-magic-array last))) (vendor-length u32r) (eval (when (> last emms-info-native--max-vorbis-vendor-length) (error "Opus vendor length %s is too long" last))) (vendor-string vec (vendor-length)) (user-comments-list-length u32r) (eval (when (> last emms-info-native--max-num-vorbis-comments) (error "Opus user comment list length %s is too long" last))) (user-comments repeat (user-comments-list-length) (struct emms-info-native--vorbis-comment-field-bindat-spec))) (#$ . 8056)) #@47 Opus comment header magic pattern `OpusTags'. (defconst emms-info-native--opus-tags-magic-array [79 112 117 115 84 97 103 115] (#$ . 8803)) #@47 Maximum size for a single Ogg container page. (defconst emms-info-native--ogg-page-size 65307 (#$ . 8949)) #@35 Ogg page structure specification. (defconst emms-info-native--ogg-page-bindat-spec '((capture-pattern vec 4) (eval (unless (equal last emms-info-native--ogg-magic-array) (error "Ogg framing mismatch: expected `%s', got `%s'" emms-info-native--ogg-magic-array last))) (stream-structure-version u8) (eval (unless (= last 0) (error ("Ogg version mismatch: expected 0, got %s") last))) (header-type-flag u8) (granule-position vec 8) (stream-serial-number vec 4) (page-sequence-no vec 4) (page-checksum vec 4) (page-segments u8) (segment-table vec (page-segments)) (payload vec (eval (seq-reduce #'+ last 0)))) (#$ . 9062)) #@42 Ogg format magic capture pattern `OggS'. (defconst emms-info-native--ogg-magic-array [79 103 103 83] (#$ . 9687)) #@300 Read and decode comments from Ogg file FILENAME. The file is assumed to contain a single stream of type STREAM-TYPE, which must either `vorbis' or `opus'. Return comments in a list of (FIELD . VALUE) cons cells. See `emms-info-native--split-vorbis-comment' for details. (fn FILENAME STREAM-TYPE) (defalias 'emms-info-native--decode-ogg-comments #[514 "\300\301\"\302\"\303\304\305#\306!\207" [emms-info-native--decode-ogg-packets 2 emms-info-native--decode-ogg-headers bindat-get-field comment-header user-comments emms-info-native--extract-vorbis-comments] 8 (#$ . 9808)]) #@708 Read and decode packets from Ogg file FILENAME. Read in data from the start of FILENAME, remove Ogg packet frames, and concatenate payloads until at least PACKETS number of packets have been decoded. Return the decoded packets in a vector, concatenated. Data is read in `emms-info-native--ogg-page-size' chunks. If the total length of concatenated packets becomes greater than `emms-info-native--max-peek-size', an error is signaled. Only elementary streams are supported, that is, FILENAME should contain only a single logical stream. Note that this assumption is not verified: with non-elementary streams packets from different streams will be mixed together without an error. (fn FILENAME PACKETS) (defalias 'emms-info-native--decode-ogg-packets #[514 "\301\211\302 W\203:\303\"\304\305\"\206\301\\\262\304\306\"\\\262\307\304\310\"\"\262GV\2036\311\312!\210\210\202\207" [emms-info-native--max-peek-size 0 vector emms-info-native--decode-ogg-page plist-get :num-packets :num-bytes vconcat :stream error "Ogg payload is too large"] 11 (#$ . 10397)]) #@336 Read and decode a single Ogg page from FILENAME. Starting reading data from byte offset OFFSET. Return a plist (:num-packets N :num-bytes B :stream S), where N is the number of packets in the page, B is the size of the page in bytes, and S is the unframed logical bitstream in a vector. Note that N can be zero. (fn FILENAME OFFSET) (defalias 'emms-info-native--decode-ogg-page #[514 "\302\303\304\"r\211q\210\305\306\"\216\307\310!\210\311\310\211\\$\210\312 \313 \"\314!\315 \"\316\317\"\320\321\322\257\266\204*\207" [emms-info-native--ogg-page-size emms-info-native--ogg-page-bindat-spec generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil insert-file-contents-literally bindat-unpack buffer-string emms-info-native--num-of-packets bindat-length bindat-get-field payload :num-packets :num-bytes :stream] 13 (#$ . 11484)]) #@125 Return the number of packets in Ogg page PAGE. PAGE must correspond to `emms-info-native--ogg-page-bindat-spec'. (fn PAGE) (defalias 'emms-info-native--num-of-packets #[257 "\300\301\302\303\"\"G\207" [seq-filter #[257 "\211\300W\207" [255] 3 "\n\n(fn ELT)"] bindat-get-field segment-table] 6 (#$ . 12415)]) #@279 Decode first two stream headers from PACKETS for STREAM-TYPE. STREAM-TYPE must be either `vorbis' or `opus'. Return a structure that corresponds to either `emms-info-native--opus-headers-bindat-spec' or `emms-info-native--vorbis-headers-bindat-spec'. (fn PACKETS STREAM-TYPE) (defalias 'emms-info-native--decode-ogg-headers #[514 "\211\303\267\202\304\"\207\305\304\n\")\207\306\307\"\207" [emms-info-native--vorbis-headers-bindat-spec emms-info-native--opus-channel-count emms-info-native--opus-headers-bindat-spec #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (vorbis 6 opus 11)) bindat-unpack nil error "Unknown stream type %s"] 5 (#$ . 12732)]) #@43 FLAC metadata block header specification. (defconst emms-info-native--flac-metadata-block-header-bindat-spec '((flags u8) (length u24) (eval (when (or (> last emms-info-native--max-peek-size) (= last 0)) (error "FLAC block length %s is invalid" last)))) (#$ . 13435)) #@42 FLAC Vorbis comment block specification. (defconst emms-info-native--flac-comment-block-bindat-spec '((vendor-length u32r) (eval (when (> last emms-info-native--max-vorbis-vendor-length) (error "FLAC vendor length %s is too long" last))) (vendor-string vec (vendor-length)) (user-comments-list-length u32r) (eval (when (> last emms-info-native--max-num-vorbis-comments) (error "FLAC user comment list length %s is too long" last))) (user-comments repeat (user-comments-list-length) (struct emms-info-native--vorbis-comment-field-bindat-spec))) (#$ . 13709)) #@212 Read and decode comments from FLAC file FILENAME. Return comments in a list of (FIELD . VALUE) cons cells. Only FIELDs that are listed in `emms-info-native--accepted-vorbis-fields' are returned. (fn FILENAME) (defalias 'emms-info-native--decode-flac-comments #[257 "\301!\204\n\302\303!\210\304!\305\"\306\307\"\310!\207" [emms-info-native--flac-comment-block-bindat-spec emms-info-native--has-flac-signature error "Invalid FLAC stream" emms-info-native--decode-flac-comment-block bindat-unpack bindat-get-field user-comments emms-info-native--extract-vorbis-comments] 6 (#$ . 14274)]) #@134 Check for FLAC stream marker at the beginning of FILENAME. Return t if there is a valid stream marker, nil otherwise. (fn FILENAME) (defalias 'emms-info-native--has-flac-signature #[257 "\300\301\302\"r\211q\210\303\304\"\216\305\306!\210\307\306\310\311$\210\312\313!*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil insert-file-contents-literally 0 4 looking-at "fLaC"] 7 (#$ . 14876)]) #@116 Read and decode a comment block from FLAC file FILENAME. Return the comment block data in a vector. (fn FILENAME) (defalias 'emms-info-native--decode-flac-comment-block #[257 "\301\302\303\"r\211q\210\304\305\"\216\306\307!\210\307\211\310\204k\204k\311\307\211\310\\\211\262$\210\312\313 \"\314\315\"\\\314\316\"\317\320\"\317\321\"\322V\262\211\323V\203N\324\325\"\210\211\310U\203e\311 \307\303%\210\326\313 !\262\266\205\202\266\203*\207" [emms-info-native--flac-metadata-block-header-bindat-spec generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil 4 insert-file-contents-literally bindat-unpack buffer-string bindat-get-field length flags logand 127 128 0 6 error "FLAC block type error: expected <= 6, got %s" vconcat] 15 (#$ . 15370)]) #@29 id3v2 header specification. (defconst emms-info-native--id3v2-header-bindat-spec '((file-identifier vec 3) (eval (unless (equal last emms-info-native--id3v2-magic-array) (error "id3v2 framing mismatch: expected `%s', got `%s'" emms-info-native--id3v2-magic-array last))) (version u8) (eval (setq emms-info-native--id3v2-version last)) (revision u8) (flags bits 1) (size-bytes vec 4) (size eval (emms-info-native--checked-id3v2-size 'tag last))) (#$ . 16233)) #@35 id3v2 header magic pattern `ID3'. (defconst emms-info-native--id3v2-magic-array [73 68 51] (#$ . 16698)) #@35 id3v2 frame header specification. (defconst emms-info-native--id3v2-frame-header-bindat-spec '((id str (eval (if (= emms-info-native--id3v2-version 2) 3 4))) (eval (unless (emms-info-native--valid-id3v2-frame-id-p last) (error "id3v2 frame id `%s' is invalid" last))) (size-bytes vec (eval (if (= emms-info-native--id3v2-version 2) 3 4))) (size eval (emms-info-native--checked-id3v2-size 'frame last)) (flags bits (eval (if (= emms-info-native--id3v2-version 2) 0 2)))) (#$ . 16809)) #@223 Mapping from id3v2 frame identifiers to EMMS info fields. Sources: - URL `https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html' - URL `http://wiki.hydrogenaud.io/index.php?title=Foobar2000:ID3_Tag_Mapping' (defconst emms-info-native--id3v2-frame-to-info '(("TAL" . "album") ("TALB" . "album") ("TPE2" . "albumartist") ("TSO2" . "albumartistsort") ("TSOA" . "albumsort") ("TP1" . "artist") ("TPE1" . "artist") ("TSOP" . "artistsort") ("TCM" . "composer") ("TCOM" . "composer") ("TSOC" . "composersort") ("TDRC" . "date") ("TPA" . "discnumber") ("TPOS" . "discnumber") ("TCON" . genre) ("TPUB" . "label") ("TDOR" . "originaldate") ("TOR" . "originalyear") ("TORY" . "originalyear") ("TIT2" . "title") ("TT2" . "title") ("TSOT" . "titlesort") ("TRK" . "tracknumber") ("TRCK" . "tracknumber") ("TYE" . "year") ("TYER" . "year") ("TXXX" . user-defined)) (#$ . 17300)) #@15 id3v1 genres. (defconst emms-info-native--id3v1-genres '((0 . "Blues") (1 . "Classic Rock") (2 . "Country") (3 . "Dance") (4 . "Disco") (5 . "Funk") (6 . "Grunge") (7 . "Hip-Hop") (8 . "Jazz") (9 . "Metal") (10 . "New Age") (11 . "Oldies") (12 . "Other") (13 . "Pop") (14 . "R&B") (15 . "Rap") (16 . "Reggae") (17 . "Rock") (18 . "Techno") (19 . "Industrial") (20 . "Alternative") (21 . "Ska") (22 . "Death Metal") (23 . "Pranks") (24 . "Soundtrack") (25 . "Euro-Techno") (26 . "Ambient") (27 . "Trip-Hop") (28 . "Vocal") (29 . "Jazz+Funk") (30 . "Fusion") (31 . "Trance") (32 . "Classical") (33 . "Instrumental") (34 . "Acid") (35 . "House") (36 . "Game") (37 . "Sound Clip") (38 . "Gospel") (39 . "Noise") (40 . "AlternRock") (41 . "Bass") (42 . "Soul") (43 . "Punk") (44 . "Space") (45 . "Meditative") (46 . "Instrumental Pop") (47 . "Instrumental Rock") (48 . "Ethnic") (49 . "Gothic") (50 . "Darkwave") (51 . "Techno-Industrial") (52 . "Electronic") (53 . "Pop-Folk") (54 . "Eurodance") (55 . "Dream") (56 . "Southern Rock") (57 . "Comedy") (58 . "Cult") (59 . "Gangsta") (60 . "Top 40") (61 . "Christian Rap") (62 . "Pop/Funk") (63 . "Jungle") (64 . "Native American") (65 . "Cabaret") (66 . "New Wave") (67 . "Psychadelic") (68 . "Rave") (69 . "Showtunes") (70 . "Trailer") (71 . "Lo-Fi") (72 . "Tribal") (73 . "Acid Punk") (74 . "Acid Jazz") (75 . "Polka") (76 . "Retro") (77 . "Musical") (78 . "Rock & Roll") (79 . "Hard Rock") (80 . "Folk") (81 . "Folk-Rock") (82 . "National Folk") (83 . "Swing") (84 . "Fast Fusion") (85 . "Bebob") (86 . "Latin") (87 . "Revival") (88 . "Celtic") (89 . "Bluegrass") (90 . "Avantgarde") (91 . "Gothic Rock") (92 . "Progressive Rock") (93 . "Psychedelic Rock") (94 . "Symphonic Rock") (95 . "Slow Rock") (96 . "Big Band") (97 . "Chorus") (98 . "Easy Listening") (99 . "Acoustic") (100 . "Humour") (101 . "Speech") (102 . "Chanson") (103 . "Opera") (104 . "Chamber Music") (105 . "Sonata") (106 . "Symphony") (107 . "Booty Bass") (108 . "Primus") (109 . "Porn Groove") (110 . "Satire") (111 . "Slow Jam") (112 . "Club") (113 . "Tango") (114 . "Samba") (115 . "Folklore") (116 . "Ballad") (117 . "Power Ballad") (118 . "Rhythmic Soul") (119 . "Freestyle") (120 . "Duet") (121 . "Punk Rock") (122 . "Drum Solo") (123 . "A cappella") (124 . "Euro-House") (125 . "Dance Hall")) (#$ . 18185)) #@23 id3v2 text encodings. (defconst emms-info-native--id3v2-text-encodings '((0 . latin-1) (1 . utf-16) (2 . uft-16be) (3 . utf-8)) (#$ . 20521)) #@76 Return t if ID is a proper id3v2 frame identifier, nil otherwise. (fn ID) (defalias 'emms-info-native--valid-id3v2-frame-id-p #[257 "\301U\203 \302\303\"\207\302\304\"\207" [emms-info-native--id3v2-version 2 string-match "[A-Z0-9]\\{3\\}" "[A-Z0-9]\\{4\\}"] 4 (#$ . 20669)]) #@153 Calculate id3v2 element ELT size from BYTES. ELT must be either 'tag or 'frame. Return the size. Signal an error if the size is zero. (fn ELT BYTES) (defalias 'emms-info-native--checked-id3v2-size #[514 "\301\267\202!\302\303\"\202\"\304U\203\302\303\"\202\"\302\305\"\202\"\305\211\306U\203,\307\310!\207\207" [emms-info-native--id3v2-version #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (tag 6 frame 13)) emms-info-native--decode-id3v2-size t 4 nil 0 error "id3v2 tag/frame size is zero"] 5 (#$ . 20956)]) #@164 Decode id3v2 element size from BYTES. Depending on SYNCSAFE, BYTES are interpreted as 7- or 8-bit bytes, MSB first. Return the decoded size. (fn BYTES SYNCSAFE) (defalias 'emms-info-native--decode-id3v2-size #[514 "\211\203\300\202 \301\302\303\304\305\306\"\307!\"\"\207" [7 8 apply + seq-map-indexed make-closure #[514 "\301\302\300_\"_\207" [V0 expt 2] 6 "\n\n(fn ELT IDX)"] reverse] 9 (#$ . 21526)]) #@258 Read and decode id3v2 metadata from FILENAME. Return metadata in a list of (FIELD . VALUE) cons cells, or nil in case of errors or if there were no known fields in FILENAME. See `emms-info-native--id3v2-frame-to-info' for recognized fields. (fn FILENAME) (defalias 'emms-info-native--decode-id3v2 #[257 "\30112\302\303!\304\305\"\306\304\307\">\310\311\304\307\">\203%\310\312!\\\262\313\310\\$)\266\2040\207\210\302\207" [emms-info-native--id3v2-version (error) nil emms-info-native--decode-id3v2-header bindat-get-field size 7 flags 10 6 emms-info-native--checked-id3v2-ext-header-size emms-info-native--decode-id3v2-frames] 10 (#$ . 21947)]) #@60 Read and decode id3v2 header from FILENAME. (fn FILENAME) (defalias 'emms-info-native--decode-id3v2-header #[257 "\301\302\303\"r\211q\210\304\305\"\216\306\307!\210\310\307\311\312$\210\313\314 \"*\207" [emms-info-native--id3v2-header-bindat-spec generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil insert-file-contents-literally 0 10 bindat-unpack buffer-string] 7 (#$ . 22614)]) #@129 Read and decode id3v2 extended header size from FILENAME. Return the size. Signal an error if the size is zero. (fn FILENAME) (defalias 'emms-info-native--checked-id3v2-ext-header-size #[257 "\300\301\302\"r\211q\210\303\304\"\216\305\306!\210\307\306\310\311$\210\312\313\314 \"*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil insert-file-contents-literally 10 14 emms-info-native--checked-id3v2-size frame buffer-string] 7 (#$ . 23092)]) #@360 Read and decode id3v2 text frames from FILENAME. BEGIN should be the offset of first byte of the first frame, and END should be the offset after the complete id3v2 tag. If UNSYNC is t, the frames are assumed to have gone through unsynchronization and decoded as such. Return metadata in a list of (FIELD . VALUE) cons cells. (fn FILENAME BEGIN END UNSYNC) (defalias 'emms-info-native--decode-id3v2-frames #[1028 "\300 Z\301\3021/W\205,\303#\211@A\211\203$\211B\262\262\266\202\n0\210\207\210\207" [emms-info-native--id3v2-frame-header-size nil (error) emms-info-native--decode-id3v2-frame] 12 (#$ . 23639)]) #@47 Return the last decoded header size in bytes. (defalias 'emms-info-native--id3v2-frame-header-size #[0 "\301U\203\302\207\303\207" [emms-info-native--id3v2-version 2 6 10] 2 (#$ . 24275)]) #@31 (fn FILENAME OFFSET UNSYNC) (defalias 'emms-info-native--decode-id3v2-frame #[771 "\300\"\301!@\302A\303\"\204\203*\304$\211@\305A\"B\207\\C\207" [emms-info-native--decode-id3v2-frame-header emms-info-native--id3v2-frame-info-id bindat-get-field size emms-info-native--read-id3v2-frame-data emms-info-native--decode-id3v2-frame-data] 12 (#$ . 24473)]) #@231 Read and decode id3v2 frame header from FILENAME. Start reading from offset BEGIN. Return a cons cell (OFFSET . FRAME), where OFFSET is the byte offset after the frame header, and FRAME is the decoded frame. (fn FILENAME BEGIN) (defalias 'emms-info-native--decode-id3v2-frame-header #[514 "\301\302\303\"r\211q\210\304\305\"\216\306\307!\210\310 \\\311\307$\210\211\312\313 \"B\262*\207" [emms-info-native--id3v2-frame-header-bindat-spec generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil emms-info-native--id3v2-frame-header-size insert-file-contents-literally bindat-unpack buffer-string] 9 (#$ . 24857)]) #@100 Return the emms-info identifier for FRAME. If there is no such identifier, return nil. (fn FRAME) (defalias 'emms-info-native--id3v2-frame-info-id #[257 "\301\302\303\"\"A\207" [emms-info-native--id3v2-frame-to-info assoc bindat-get-field id] 5 (#$ . 25567)]) #@404 Read NUM-BYTES of raw id3v2 frame data from FILENAME. Start reading from offset BEGIN. If UNSYNC is t, all 'FF 00' byte combinations are replaced by 'FF'. Replaced byte pairs are counted as one, instead of two, towards NUM-BYTES. Return a cons cell (OFFSET . DATA), where OFFSET is the byte offset after NUM-BYTES bytes have been read, and DATA is the raw data. (fn FILENAME BEGIN NUM-BYTES UNSYNC) (defalias 'emms-info-native--read-id3v2-frame-data #[1028 "\300\301\302\"r\211q\210\303\304\"\216\305\306!\210\203U\307_\\\310\306$\210eb\210\311\312\313\314\"\306\302#\203E`W\203E\315\312\313!!\210\211T\262\202'Td|\210\\\316 B\266\202\202g\\\310\306$\210\211\316 B\262*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil 2 insert-file-contents-literally re-search-forward string 255 0 replace-match buffer-string] 12 (#$ . 25837)]) #@571 Decode id3v2 text frame data DATA. If INFO-ID is `user-defined', assume that DATA is a TXXX frame with key/value-pair. Extract the key and, if it is a mapped element in `emms-info-native--id3v2-frame-to-info', use it as INFO-ID. If INFO-ID is `genre', assume that DATA is either an integral id3v1 genre reference or a plain genre string. In the former case map the reference to a string via `emms-info-native--id3v1-genres'; in the latter case use the genre string verbatim. Return a cons cell (INFO-ID . VALUE) where VALUE is the decoded string. (fn DATA INFO-ID) (defalias 'emms-info-native--decode-id3v2-frame-data #[514 "\211\205`\302!;\203B\202^\303\267\202V\304\305\"\2035\306\307\310\311\"!\"\211\2050\312AB\262\202^\312B\202^\313\314\315!\"\211@\227A@\316 \"\205QB\266\203\202^;\205^B\262\207" [emms-info-native--id3v1-genres emms-info-native--id3v2-frame-to-info emms-info-native--decode-id3v2-string #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (genre 24 user-defined 59)) string-match "^(?\\([0-9]+\\))?" assoc string-to-number match-string 1 "genre" split-string string 0 rassoc] 9 (#$ . 26800)]) #@125 Decode id3v2 text information from BYTES. Remove the terminating null byte, if any. Return the text as string. (fn BYTES) (defalias 'emms-info-native--decode-id3v2-string #[257 "\300!\301\302\303!\304#\305\"\211G\306V\205$\211\307\310O\311\232\203#\211\306\307O\207\211\207" [emms-info-native--id3v2-text-encoding mapconcat byte-to-string seq-rest "" decode-coding-string 0 -1 nil ""] 7 (#$ . 27993)]) #@61 Return the encoding for text information BYTES. (fn BYTES) (defalias 'emms-info-native--id3v2-text-encoding #[257 "\301\302!\"A\207" [emms-info-native--id3v2-text-encodings assoc seq-first] 4 (#$ . 28410)]) #@87 Set info fields for TRACK. Supports Ogg Vorbis/Opus, FLAC, and MP3 files. (fn TRACK) (defalias 'emms-info-native #[257 "\3001D\301!\302!\211\211\205>\211@\303\304@P!A\211G\305U\2045\306\211\307=\2030\310!\2023\311!#\210\266A\266\202\202 \262\266\2020\207\312\313\301!#\207" [(error) emms-track-name emms-info-native--decode-info-fields intern "info-" 0 emms-track-set info-playing-time string-to-number string-trim-right message "emms-info-native error processing %s: %s"] 12 (#$ . 28626)]) #@186 Decode info fields from FILENAME. Return a list of (FIELD . VALUE) cons cells, where FIELD is an info field and VALUE is the corresponding info value. Both are strings. (fn FILENAME) (defalias 'emms-info-native--decode-info-fields #[257 "\300!\211\301=\204\211\302=\203\303\"\207\211\304\267\202\"\305!\207\306!\207\307\207" [emms-info-native--find-stream-type vorbis opus emms-info-native--decode-ogg-comments #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (flac 26 mp3 30)) emms-info-native--decode-flac-comments emms-info-native--decode-id3v2 nil] 5 (#$ . 29145)]) #@186 Deduce the stream type from FILENAME. This is a naive implementation that relies solely on filename extension. Return one of symbols `vorbis', `opus', `flac', or `mp3'. (fn FILENAME) (defalias 'emms-info-native--find-stream-type #[257 "\301\302\303\"\203 \304\202/\302\305\"\203\306\202/\302\307\"\203#\310\202/\302\311\"\203.\312\202/\313)\207" [case-fold-search t string-match ".ogg$" vorbis ".opus$" opus ".flac$" flac ".mp3$" mp3 nil] 4 (#$ . 29770)]) (provide 'emms-info-native)