(m291) Guess tags from filename

This commit is contained in:
Devine Lu Linvega 2024-08-27 10:26:07 -07:00
parent 7fdfcf9c24
commit 2093197345
1 changed files with 29 additions and 4 deletions

View File

@ -191,10 +191,7 @@
JMP2r JMP2r
@<send-load> ( file* -- ) @<send-load> ( file* -- )
( | start ID3 ) DUP2 <tags-autofill>
;dict/no-title ;id3/title <scpy>
;dict/no-artist ;id3/artist <scpy>
;dict/no-album ;id3/album <scpy>
[ LIT2 01 -playing ] STZ [ LIT2 01 -playing ] STZ
<fit-window> <fit-window>
( | request ) ( | request )
@ -400,6 +397,34 @@
ADD2r INC2 !&>loop } ADD2r INC2 !&>loop }
POP STH2r POP2r JMP2r POP STH2r POP2r JMP2r
@<tags-autofill> ( file* -- )
;dict/no-album ;id3/album <scpy>
( | find spacer )
DUP2 find-spacer INC2 ORA ?{
( | defaults )
;dict/no-title ;id3/title <scpy>
;dict/no-artist ;id3/artist <scpy>
POP2 JMP2r }
( | copy artist )
[ LIT2r =id3/artist ]
&>artist ( -- )
LDA2k [ LIT2 20 "- ] EQU2 ?{
LDAk #00 STH2kr INC2r STA2
INC2 LDAk ?&>artist }
POP2r INC2 INC2 INC2
( | copy title )
[ LIT2r =id3/title ]
&>title ( -- )
LDA2k [ LIT2 ".m ] EQU2 ?{
LDAk #00 STH2kr INC2r STA2
INC2 LDAk ?&>title }
POP2r POP2 JMP2r
@find-spacer ( file* -- <file>* )
LDA2k [ LIT2 20 "- ] NEQ2 ?{ JMP2r }
INC2 LDAk ?find-spacer
POP2 #ffff JMP2r
( (
@|path ) @|path )