From 20931973458e99bb8130a393f62d1faacc55438d Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 27 Aug 2024 10:26:07 -0700 Subject: [PATCH] (m291) Guess tags from filename --- gui/m291/src/m291.tal | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index 16e25ae..ae8719e 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -191,10 +191,7 @@ JMP2r @ ( file* -- ) - ( | start ID3 ) - ;dict/no-title ;id3/title - ;dict/no-artist ;id3/artist - ;dict/no-album ;id3/album + DUP2 [ LIT2 01 -playing ] STZ ( | request ) @@ -400,6 +397,34 @@ ADD2r INC2 !&>loop } POP STH2r POP2r JMP2r +@ ( file* -- ) + ;dict/no-album ;id3/album + ( | find spacer ) + DUP2 find-spacer INC2 ORA ?{ + ( | defaults ) + ;dict/no-title ;id3/title + ;dict/no-artist ;id3/artist + 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* -- * ) + LDA2k [ LIT2 20 "- ] NEQ2 ?{ JMP2r } + INC2 LDAk ?find-spacer + POP2 #ffff JMP2r + ( @|path )