[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/emms 813c0058bd 28/42: Use bindat-type in emms-info-spc
From: |
ELPA Syncer |
Subject: |
[elpa] externals/emms 813c0058bd 28/42: Use bindat-type in emms-info-spc |
Date: |
Wed, 1 Nov 2023 15:58:01 -0400 (EDT) |
branch: externals/emms
commit 813c0058bde09a40bbfae53d8315c4d5aca6bce5
Author: Petteri Hintsanen <petterih@iki.fi>
Commit: Petteri Hintsanen <petterih@iki.fi>
Use bindat-type in emms-info-spc
---
emms-info-spc.el | 43 +++++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 deletions(-)
diff --git a/emms-info-spc.el b/emms-info-spc.el
index db29488735..258a5d81a2 100644
--- a/emms-info-spc.el
+++ b/emms-info-spc.el
@@ -1,4 +1,4 @@
-;;; emms-info-spc.el --- Native Emacs Lisp info method for EMMS -*-
lexical-binding: t; -*-
+;;; emms-info-spc.el --- EMMS info functions for SPC files -*-
lexical-binding: t; -*-
;; Copyright (C) 2023 Free Software Foundation, Inc.
@@ -30,17 +30,44 @@
;;; Code:
+(require 'emms)
(require 'bindat)
-(defconst emms-info-spc--id666-magic-array
- [#x53 #x4e #x45 #x53 #x2d #x53 #x50#x43 #x37 #x30 #x30 #x20 #x53 #x6f #x75
#x6e #x64 #x20 #x46 #x69 #x6c #x65 #x20 #x44 #x61 #x74 #x61 #x20 #x76 #x30 #x2e
#x33 #x30]
- "id666 header magic pattern `SNES-SPC700 Sound File Data v0.30'")
+(defconst emms-info-spc--id666-magic-pattern
+ "SNES-SPC700 Sound File Data v0.30"
+ "id666 header magic pattern.")
(defconst emms-info-spc--id666-header-bindat-spec
- '((file-identifier vec 33)
- (eval (unless (equal last emms-info-spc--id666-magic-array)
+ (if emms--use-bindat-type
+ (bindat-type
+ (file-identifier str 33)
+ (_ unit (unless (equal file-identifier
+ emms-info-spc--id666-magic-pattern)
+ (error "id666 framing mismatch: expected `%s', got `%s'"
+ emms-info-spc--id666-magic-pattern
+ file-identifier)))
+ (unused uint 16)
+ (has-id666 u8)
+ (revision u8)
+ (pc-reg uint 16)
+ (a-reg u8)
+ (x-reg u8)
+ (y-reg u8)
+ (psw-reg u8)
+ (sp-reg u8)
+ (res-reg uint 16)
+ (song-title strz 32)
+ (game-title strz 32)
+ (dumper strz 16)
+ (comment strz 32)
+ (date strz 11)
+ (fadeout vec 3)
+ (fadeout-length vec 5)
+ (artist strz 32))
+ '((file-identifier str 33)
+ (eval (unless (equal last emms-info-spc--id666-magic-pattern)
(error "id666 framing mismatch: expected `%s', got `%s'"
- emms-info-spc--id666-magic-array
+ emms-info-spc--id666-magic-pattern
last)))
(unused u16)
(has-id666 u8)
@@ -59,7 +86,7 @@
(date strz 11)
(fadeout vec 3)
(fadeout-length vec 5)
- (artist strz 32))
+ (artist strz 32)))
"id666 header specification.
Sources:
- [elpa] externals/emms e501654df6 01/42: Split some functions for easier testing, (continued)
- [elpa] externals/emms e501654df6 01/42: Split some functions for easier testing, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 7ce067566f 02/42: Add some tests for Ogg, Opus and FLAC code, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 45245b8b6b 08/42: Decode playing time from FLAC files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 643284a952 14/42: Streamline Ogg page reading and decoding, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 3f83a56d3f 04/42: Decode playing time from Ogg files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 3a7341f660 17/42: Avoid some copying in emms-info-vorbis-extract-comments, ELPA Syncer, 2023/11/01
- [elpa] externals/emms a6d2bbe484 18/42: Remove useless mapconcat, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 68a0dfa9b8 19/42: Add Unicode character to metadata in test files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms fca5f3e7d5 26/42: Use bindat-type in emms-info-flac, ELPA Syncer, 2023/11/01
- [elpa] externals/emms a0c4d715f4 12/42: Use fixed sample rate when decoding Opus granule position, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 813c0058bd 28/42: Use bindat-type in emms-info-spc,
ELPA Syncer <=
- [elpa] externals/emms 32b394b2b1 34/42: Change tests to use unibyte strings, ELPA Syncer, 2023/11/01
- [elpa] externals/emms c9dce6b305 36/42: Fix tests, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 93c614dc24 32/42: Fix byte compilation errors, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 83490a7218 38/42: Change all tests to use emms-test- prefix, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 8a55be19ba 06/42: Ignore empty Vorbis comments, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 9d71a515f7 09/42: Split emms-info-native to several files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 29260a991a 11/42: Replace emms-info-native test files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms fe9b0fffe1 16/42: Use strings instead of vectors for Vorbis comments, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 75f1ee292e 20/42: Add copyright information, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 5014dfa5f3 21/42: Ignore empty tags, ELPA Syncer, 2023/11/01