Connected id3

This commit is contained in:
Devine Lu Linvega 2024-08-26 11:08:34 -07:00
parent f1c531b876
commit 09e44959c1
2 changed files with 33 additions and 19 deletions

View File

@ -396,3 +396,5 @@
@message &buf $200 @message &buf $200
@id3 &title $100 &artist $100 &album $100

View File

@ -166,8 +166,12 @@
<draw-progress> !message/<new> <draw-progress> !message/<new>
@handle-id3 ( buf* char -- ) @handle-id3 ( buf* char -- )
POP <perr> POP [ LIT ". ] find-next INC2 LDA2k
#0a19 DEO !message/<new> ( | parse lines )
DUP2 [ LIT2 "ti ] NEQ2 ?{ OVR2 <set-title> }
DUP2 [ LIT2 "ar ] NEQ2 ?{ OVR2 <set-artist> }
DUP2 [ LIT2 "al ] NEQ2 ?{ OVR2 <set-album> }
POP2 POP2 !message/<new>
@handle-pause ( buf* char -- ) @handle-pause ( buf* char -- )
POP INC2 INC2 LDA [ LIT "1 ] SUB #01 EOR .paused STZ POP INC2 INC2 LDA [ LIT "1 ] SUB #01 EOR .paused STZ
@ -314,6 +318,21 @@
@is-mp3 ( line* -- line*f ) @is-mp3 ( line* -- line*f )
DUP2 lcap/ #0003 SUB2 ;dict/mp3-ext !scmp3 DUP2 lcap/ #0003 SUB2 ;dict/mp3-ext !scmp3
(
@|id3 )
@<set-title> ( id3* -- )
[ LIT ": ] find-next INC2 ;id3/title <scpy>
JMP2r
@<set-artist> ( id3* -- )
[ LIT ": ] find-next INC2 ;id3/artist <scpy>
JMP2r
@<set-album> ( id3* -- )
[ LIT ": ] find-next INC2 ;id3/album <scpy>
JMP2r
( (
@|path ) @|path )
@ -372,13 +391,13 @@
@<draw-player> ( -- ) @<draw-player> ( -- )
#0080 .Screen/x DEO2 #0080 .Screen/x DEO2
#0020 .Screen/y DEO2 #0020 .Screen/y DEO2
;placeholder/track #01 <draw-uf2-center> ;id3/title #01 <draw-uf2-center>
#0080 .Screen/x DEO2 #0080 .Screen/x DEO2
#0030 .Screen/y DEO2 #0030 .Screen/y DEO2
;placeholder/artist #01 <draw-uf2-center> ;id3/artist #01 <draw-uf2-center>
#0080 .Screen/x DEO2 #0080 .Screen/x DEO2
#0040 .Screen/y DEO2 #0040 .Screen/y DEO2
;placeholder/album #01 <draw-uf2-center> ;id3/album #01 <draw-uf2-center>
<draw-play> <draw-play>
<draw-progress> !<draw-timestamp> <draw-progress> !<draw-timestamp>
@ -592,6 +611,13 @@
LDAkr LDAk STHr NEQ ?{ INC2r INC2 } LDAkr LDAk STHr NEQ ?{ INC2r INC2 }
LDA2r LDA2 STH2r EQU2 JMP2r LDA2r LDA2 STH2r EQU2 JMP2r
@<scpy> ( src* dst* -: )
STH2
&>w ( src* `dst* -- )
LDAk #00 STH2kr STA2
INC2r INC2 LDAk ?&>w
POP2 POP2r JMP2r
@lcap ( str* -- next-line* ) @lcap ( str* -- next-line* )
&w ( -- ) &w ( -- )
@ -607,13 +633,6 @@
LDAk #00 STH2kr STA2 LDAk #00 STH2kr STA2
INC2r INC2 !&w INC2r INC2 !&w
@<scpy> ( src* dst* -- )
STH2
&w ( -- )
LDAk #00 STH2kr STA2
INC2r INC2 LDAk ?&w
POP2 POP2r JMP2r
@<pstr> ( str* -- ) @<pstr> ( str* -- )
LDAk #18 DEO LDAk #18 DEO
INC2 & LDAk ?<pstr> INC2 & LDAk ?<pstr>
@ -659,12 +678,5 @@
&load-cmd "load 20 $1 &load-cmd "load 20 $1
&pause-cmd "pause 0a $1 &pause-cmd "pause 0a $1
@placeholder
&artist "Blood 20 "Girl $1
&track "Always 20 "Wrong $1
&album "Unknown 20 "Album $1
&time-a "0:31 $1
&time-b "2:25 $1
~src/assets.tal ~src/assets.tal