Able to play .flac files.

This commit is contained in:
~d6 2024-08-29 22:34:35 -04:00
parent c149d1b9e7
commit c39db007d2
1 changed files with 15 additions and 4 deletions

View File

@ -34,7 +34,7 @@
#0100 .Screen/width DEO2
( | .. )
message/<new>
;dict/mpg-cmd .Console/addr DEO2
;dict/flac-cmd .Console/addr DEO2
[ LIT2 03 -Console/mode ] DEO
[ LIT2 01 -Console/exec ] DEO
[ LIT2 00 -playing ] STZ
@ -282,6 +282,7 @@
<draw-progress>
<draw-timestamp> !message/<new>
( TODO: flac123 id3 format is different and more limited, sadly )
@handle-id3 ( buf* char -- )
POP [ LIT ". ] find-next INC2 LDA2k
( | parse lines )
@ -293,6 +294,7 @@
OVR2 [ LIT ": ] find-next INC2 ;id3/album <scpy> }
POP2 POP2 !message/<new>
( TODO: flac123 doesn't use "@P 3" so we'd need to use "@P 0" )
@handle-pause ( buf* char -- )
POP INC2 INC2 LDA
( stop ) DUP [ LIT "0 ] NEQ ?{ }
@ -354,7 +356,7 @@
@<parse-line> ( line* -- )
#0005 ADD2 LDAk [ LIT ". ] EQU ?&hidden
is-folder ?&folder
is-mp3 ?&mp3
is-flac ?&flac
POP2 JMP2r
&folder ( line* -- )
@ -366,7 +368,7 @@
.lines/folders LDZ INC .lines/folders STZ
JMP2r
&mp3 ( line* -- )
&flac ( line* -- )
DUP2 llen
( CELLSIZE ) #007f LTH2 ?{ POP2 JMP2r }
;mem/tracks [ LIT2 00 -lines/tracks ] LDZ
@ -433,6 +435,9 @@
@is-mp3 ( line* -- line*f )
DUP2 lcap/ #0003 SUB2 ;dict/mp3-ext !scmp3
@is-flac ( line* -- line*f )
DUP2 lcap/ #0004 SUB2 ;dict/flac-ext !scmp4
@pos-to-seconds ( pos* -- seconds* )
.secfrom LDZ2 .secto LDZ2 ADD2 #00e7 DIV2k STH2k MUL2 SUB2 OVR2 STH2
MUL2r MUL2 #00e7 DIV2 STH2r ADD2 JMP2r
@ -846,6 +851,11 @@
LDAkr LDAk STHr NEQ ?{ INC2r INC2 }
LDA2r LDA2 STH2r EQU2 JMP2r
@scmp4 ( a* b* -- f )
STH2
LDA2kr LDA2k STH2r NEQ2 ?{ INC2r INC2r INC2 INC2 }
LDA2r LDA2 STH2r EQU2 JMP2r
@<scpy> ( src* dst* -: )
STH2
&>w ( src* `dst* -- )
@ -940,8 +950,9 @@
@dict
&home-path "./ $1
&mp3-ext "mp3 $1
&flac-ext "flac $1
&empty "(empty) $1
&mpg-cmd "mpg123 20 "-R $1
&flac-cmd "flac123 20 "-R $1
&load-cmd "load 20 $1
&jump-cmd "jump 20 $1
&pause-cmd "pause 0a $1