Compare commits
2 Commits
main
...
d6/flac123
Author | SHA1 | Date |
---|---|---|
~d6 | c39db007d2 | |
Devine Lu Linvega | c149d1b9e7 |
|
@ -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
|
||||
|
@ -388,20 +390,28 @@
|
|||
&done NIP2 LTH POP2r JMP2r
|
||||
|
||||
@sort-folders ( -- )
|
||||
;mem/folders DUP2 LIT2 [ 00 -lines/folders ] LDZ #01 SUB #70 SFT2 ADD2 !sort-tracks-0
|
||||
.lines/folders LDZ ?{ JMP2r }
|
||||
;mem/folders DUP2 LIT2 [ 00 -lines/folders ] LDZ #01 SUB #70 SFT2 ADD2 !sort-files
|
||||
|
||||
@sort-tracks ( -- )
|
||||
.lines/tracks LDZ ?{ JMP2r }
|
||||
;mem/tracks DUP2 LIT2 [ 00 -lines/tracks ] LDZ #01 SUB #70 SFT2 ADD2
|
||||
( >> )
|
||||
|
||||
@sort-tracks-0 ( first* last* -- )
|
||||
SWP2 &loop GTH2k ?&ok
|
||||
POP2 POP2 JMP2r
|
||||
&ok OVR2 OVR2 STH2k #0080 ADD2 &loop2 LTH2k ?&done
|
||||
@sort-files ( first* last* -- )
|
||||
SWP2
|
||||
&>loop ( -- )
|
||||
GTH2k ?{ POP2 POP2 JMP2r }
|
||||
OVR2 OVR2 STH2k #0080 ADD2
|
||||
&>loop2 ( -- )
|
||||
LTH2k ?&done
|
||||
DUP2 STH2kr str-lth ?&replace
|
||||
!&inc
|
||||
&replace POP2r STH2k &inc #0080 ADD2 !&loop2
|
||||
&done POP2 POP2 DUP2 STH2r swap-tracks #0080 ADD2 !&loop
|
||||
!{
|
||||
&replace POP2r STH2k }
|
||||
#0080 ADD2 !&>loop2
|
||||
|
||||
&done ( -- )
|
||||
POP2 POP2 DUP2 STH2r swap-tracks #0080 ADD2 !&>loop
|
||||
|
||||
@swap-tracks ( src* dst* -- )
|
||||
EQU2k ?&skip
|
||||
|
@ -425,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
|
||||
|
@ -838,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* -- )
|
||||
|
@ -932,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
|
||||
|
|
Loading…
Reference in New Issue