This commit is contained in:
2025-08-17 13:30:56 +02:00
parent 2c76e7c5e4
commit 7c404ea3b9
7 changed files with 71 additions and 2 deletions

26
info.rkt Normal file
View File

@@ -0,0 +1,26 @@
#lang info
(define pkg-authors '(hnmdijkema))
(define version "0.1.0")
(define license 'GPL-2.0-or-later) ; The liboa library has this license
(define collection "racket-sound")
(define pkg-desc "racket-sound - Integration of popular music/sound related libraries in racket")
(define scribblings
'(
("scribblings/racket-sound.scrbl" () (library) "racket-sound")
("scribblings/liboa.scrbl" () (library) "racket-sound/liboa/libao.rkt")
("scribblings/flac-decoder.scrbl" () (library) "racket-sound/libflac/flac-decoder.rkt")
("scribblings/taglib.scrbl" () (library) "racket-sound/libtag/taglib.rkt")
)
)
(define deps
'("racket/gui" "racket/base" "racket"))
(define build-deps
'("racket-doc"
"draw-doc"
"rackunit-lib"
"scribble-lib"
))

View File

@@ -3,6 +3,7 @@
(require ffi/unsafe (require ffi/unsafe
ffi/unsafe/define ffi/unsafe/define
setup/dirs setup/dirs
"../utils/utils.rkt"
) )
(provide ;_libao_pointer (provide ;_libao_pointer

Binary file not shown.

View File

@@ -1,4 +1,3 @@
;#lang racket/base
(module libflac-ffi racket/base (module libflac-ffi racket/base
(require ffi/unsafe (require ffi/unsafe

Binary file not shown.

View File

@@ -1,2 +1,12 @@
#lang racket/base #lang racket/base
(require "libao/libao.rkt"
"libflac/flac-decoder.rkt"
"libtag/taglib.rkt"
)
(provide (all-from-out "libao/libao.rkt")
(all-from-out "libflac/flac-decoder.rkt")
(all-from-out "libtag/taglib.rkt")
)

View File

@@ -1,7 +1,9 @@
(module utils racket/base (module utils racket/base
(provide while (provide while
until
get-lib-path get-lib-path
do-for
) )
(define-syntax while (define-syntax while
@@ -18,12 +20,43 @@
) )
)) ))
(define-syntax until
(syntax-rules ()
((_ cond body ...)
(letrec ((until-f (lambda (last-result)
(if cond
last-result
(let ((last-reult (begin
body
...)))
(until-f last-result))))))
(until-f #f)))))
(define-syntax do-for
(syntax-rules ()
((_ (init cond next) body ...)
(begin
init
(letrec ((do-for-f (lamba ()
(if cond
(begin
(begin
body
...)
next
(do-for-f))))))
(do-for-f))))))
(define (get-lib-path lib) (define (get-lib-path lib)
(let ((platform (system-type))) (let ((platform (system-type)))
(cond (cond
[(eq? platform 'windows) [(eq? platform 'windows)
(build-path (current-directory) ".." "lib" "dll" lib)] (let ((try1 (build-path (current-directory) ".." "lib" "dll" lib))
(try2 (build-path (current-directory) "lib" "dll" lib)))
(if (file-exists? try1)
try1
try2)
)]
[else [else
(error (format "Install the shared library: ~a" lib))] (error (format "Install the shared library: ~a" lib))]
))) )))