This commit is contained in:
2026-03-09 09:46:39 +01:00
parent 63c8bde210
commit c35eef081e
3 changed files with 41 additions and 26 deletions

View File

@@ -18,7 +18,8 @@
[buffer-max-seconds 10] [buffer-max-seconds 10]
[buffer-min-seconds 4] [buffer-min-seconds 4]
) )
(define use-ao #t)
(define pl #f) (define pl #f)
(define state 'stopped) (define state 'stopped)
(define track -1) (define track -1)
@@ -51,10 +52,11 @@
(displayln (format "current-rate = ~a, current-bits = ~a, current-channels = ~a, ao-handle = ~a" (displayln (format "current-rate = ~a, current-bits = ~a, current-channels = ~a, ao-handle = ~a"
current-rate current-bits current-channels ao-handle)) current-rate current-bits current-channels ao-handle))
(displayln "Opening ao-handle") (displayln "Opening ao-handle")
(let ((fmt (ao-mk-format current-bits current-rate current-channels 'big-endian))) (when use-ao
(set! ao-handle (ao-open-live #f fmt)) (let ((fmt (ao-mk-format current-bits current-rate current-channels 'big-endian)))
(start-play-time-updater) (set! ao-handle (ao-open-live #f fmt))
) (start-play-time-updater)
))
) )
) )
) )

View File

@@ -53,6 +53,9 @@
) )
) )
(define/public (image->file* to-file)
#f)
(define/public (image->file to-file) (define/public (image->file to-file)
(let ((tags (read-tags))) (let ((tags (read-tags)))
(if (tags-valid? tags) (if (tags-valid? tags)
@@ -68,6 +71,9 @@
) )
#f))) #f)))
(define/public (image->mimetype*)
#f)
(define/public (image->mimetype) (define/public (image->mimetype)
(let ((tags (read-tags))) (let ((tags (read-tags)))
(if (tags-valid? tags) (if (tags-valid? tags)
@@ -75,27 +81,34 @@
'no-mimetype))) 'no-mimetype)))
(super-new) (super-new)
(begin (begin
(unless (eq? file #f) (let ((use-tags #t))
(let ((tags (read-tags))) (if use-tags
(if (tags-valid? tags) (unless (eq? file #f)
(begin (let ((tags (read-tags)))
(set! title (tags-title tags)) (if (tags-valid? tags)
(set! artist (tags-artist tags)) (begin
(set! album (tags-album tags)) (set! title (tags-title tags))
(set! number (tags-track tags)) (set! artist (tags-artist tags))
(set! length (tags-length tags)) (set! album (tags-album tags))
) (set! number (tags-track tags))
(begin (set! length (tags-length tags))
(set! title "invalid tags") )
(set! artist "invalid tags") (begin
(set! album "invalid tags") (set! title "invalid tags")
(set! number number) (set! artist "invalid tags")
(set! length -1) (set! album "invalid tags")
) (set! number number)
(set! length -1)
)
)
) )
) )
(unless (eq? file #f)
(set! title (format "~a" file))
(set! number 0))
)
) )
) )
) )

View File

@@ -22,9 +22,9 @@
(ww-set-log-level 'info) (ww-set-log-level 'info)
;(ww-tail-log) ;(ww-tail-log)
;(ww-tail-log) ;(ww-tail-log)
(ao-set-async-mode! 'scheme) ;(ao-set-async-mode! 'scheme)
;(collect-garbage 'incremental) ;(collect-garbage 'incremental)
;(ao-set-async-mode! 'ffi) (ao-set-async-mode! 'ffi)
(define (run) (define (run)
(let* ((ini (new ini% [file 'rktplayer])) (let* ((ini (new ini% [file 'rktplayer]))