path->string

This commit is contained in:
2026-02-24 10:07:17 +01:00
parent 7807a7a209
commit 973f3f2a07
2 changed files with 14 additions and 12 deletions

View File

@@ -19,16 +19,17 @@
;; Functions to do the good stuff ;; Functions to do the good stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (flac-open flac-file cb-stream-info cb-audio) (define (flac-open flac-file* cb-stream-info cb-audio)
(if (file-exists? flac-file) (let ((flac-file (if (path? flac-file*) (path->string flac-file* flac-file*))))
(let ((handler (flac-ffi-decoder-handler))) (if (file-exists? flac-file)
(handler 'new) (let ((handler (flac-ffi-decoder-handler)))
(handler 'init flac-file) (handler 'new)
(let ((h (make-flac-handle handler))) (handler 'init flac-file)
(set-flac-handle-cb-stream-info! h cb-stream-info) (let ((h (make-flac-handle handler)))
(set-flac-handle-cb-audio! h cb-audio) (set-flac-handle-cb-stream-info! h cb-stream-info)
h)) (set-flac-handle-cb-audio! h cb-audio)
#f)) h))
#f)))
(define (flac-stream-state handle) (define (flac-stream-state handle)
((flac-handle-ffi-decoder-handler handle) 'state)) ((flac-handle-ffi-decoder-handler handle) 'state))

View File

@@ -41,8 +41,9 @@
(define-struct id3-picture (define-struct id3-picture
(mimetype kind size bytes)) (mimetype kind size bytes))
(define (id3-tags file) (define (id3-tags file*)
(let ((valid? #f) (let ((file (if (path? file*) (path->string file*) file*))
(valid? #f)
(title "") (title "")
(album "") (album "")
(artist "") (artist "")