-
This commit is contained in:
@@ -5,27 +5,32 @@
|
||||
ffi/unsafe/define
|
||||
setup/dirs
|
||||
"../utils/utils.rkt"
|
||||
racket/runtime-path
|
||||
"libao-ffi.rkt"
|
||||
)
|
||||
|
||||
(provide ao_create_async
|
||||
ao_stop_async
|
||||
ao_play_async
|
||||
ao_is_at_second_async
|
||||
ao_bufsize_async
|
||||
)
|
||||
|
||||
;(ffi-lib "/usr/local/lib/libao-play-async.so")
|
||||
(define-runtime-path libao-async-path "./lib/libao-play-async")
|
||||
|
||||
(define-ffi-definer define-libao-async
|
||||
(ffi-lib "libao-play-async" '("0" #f)
|
||||
#:get-lib-dirs (lambda ()
|
||||
(cons (build-path ".") (get-lib-search-dirs)))
|
||||
(ffi-lib libao-async-path '("0" #f)
|
||||
#:get-lib-dirs (λ ()
|
||||
(let ((sp (cons (build-path ".") (get-lib-search-dirs))))
|
||||
(displayln sp)
|
||||
sp))
|
||||
#:fail (λ () (error "Cannot load libao-play-async"))
|
||||
))
|
||||
|
||||
(define _libao-async-handle-pointer (_cpointer 'ao-async-handle))
|
||||
|
||||
;extern void *ao_create_async(void *ao_device);
|
||||
(define-libao-async ao_create_async(_fun _pointer -> _libao-async-handle-pointer))
|
||||
;extern void *ao_create_async(void *ao_device, );
|
||||
(define-libao-async ao_create_async(_fun _pointer _fpointer -> _libao-async-handle-pointer))
|
||||
|
||||
;extern void ao_stop_async(void *handle);
|
||||
(define-libao-async ao_stop_async(_fun _libao-async-handle-pointer -> _void))
|
||||
@@ -35,3 +40,6 @@
|
||||
|
||||
;extern double ao_is_at_second_async(void *handle);
|
||||
(define-libao-async ao_is_at_second_async(_fun _libao-async-handle-pointer -> _double))
|
||||
|
||||
;extern int ao_bufsize_async(void *handle);
|
||||
(define-libao-async ao_bufsize_async(_fun _libao-async-handle-pointer -> _int))
|
||||
Reference in New Issue
Block a user