This commit is contained in:
2026-02-23 01:23:49 +01:00
parent 7c547a2cff
commit 4afca18124
8 changed files with 22 additions and 3 deletions

View File

@@ -245,6 +245,16 @@ void ao_play_async(void *ao_handle, double at_second, int buf_size, void *mem)
MUTEX_UNLOCK(h->mutex); MUTEX_UNLOCK(h->mutex);
} }
void ao_clear_async(void *ao_handle)
{
AO_Handle *h = (AO_Handle *) ao_handle;
MUTEX_LOCK(h->mutex);
clear(h);
MUTEX_UNLOCK(h->mutex);
}
double ao_is_at_second_async(void *ao_handle) double ao_is_at_second_async(void *ao_handle)
{ {
AO_Handle *h = (AO_Handle *) ao_handle; AO_Handle *h = (AO_Handle *) ao_handle;

View File

@@ -14,6 +14,7 @@
AOPLAYASYNC_EXPORT void *ao_create_async(void *ao_handle, void *ao_play_f); AOPLAYASYNC_EXPORT void *ao_create_async(void *ao_handle, void *ao_play_f);
AOPLAYASYNC_EXPORT void ao_stop_async(void *handle); AOPLAYASYNC_EXPORT void ao_stop_async(void *handle);
AOPLAYASYNC_EXPORT void ao_play_async(void *handle, double at_second, int buf_size, void *mem); AOPLAYASYNC_EXPORT void ao_play_async(void *handle, double at_second, int buf_size, void *mem);
AOPLAYASYNC_EXPORT void ao_clear_async(void *handle);
AOPLAYASYNC_EXPORT double ao_is_at_second_async(void *handle); AOPLAYASYNC_EXPORT double ao_is_at_second_async(void *handle);
AOPLAYASYNC_EXPORT int ao_bufsize_async(void *handle); AOPLAYASYNC_EXPORT int ao_bufsize_async(void *handle);

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -14,6 +14,7 @@
ao_play_async ao_play_async
ao_is_at_second_async ao_is_at_second_async
ao_bufsize_async ao_bufsize_async
ao_clear_async
) )
(define-runtime-path libao-async-lib-path "./lib") (define-runtime-path libao-async-lib-path "./lib")
@@ -47,3 +48,6 @@
;extern int ao_bufsize_async(void *handle); ;extern int ao_bufsize_async(void *handle);
(define-libao-async ao_bufsize_async(_fun _libao-async-handle-pointer -> _int)) (define-libao-async ao_bufsize_async(_fun _libao-async-handle-pointer -> _int))
;extern void ao_clear_async(void *handle);
(define-libao-async ao_clear_async(_fun _libao-async-handle-pointer -> _void))

View File

@@ -14,6 +14,7 @@
ao-default-driver-id ao-default-driver-id
ao-at-second ao-at-second
ao-bufsize-async ao-bufsize-async
ao-clear-async
) )
(define devices (make-hash)) (define devices (make-hash))
@@ -178,6 +179,9 @@
(define (ao-bufsize-async handle) (define (ao-bufsize-async handle)
(ao_bufsize_async (ao-handle-async-player handle))) (ao_bufsize_async (ao-handle-async-player handle)))
(define (ao-clear-async handle)
(ao_clear_async (ao-handle-async-player handle)))
;(let* ((handle-num (ao-handle-handle-num handle)) ;(let* ((handle-num (ao-handle-handle-num handle))
; (ao-device (hash-ref devices handle-num #f))) ; (ao-device (hash-ref devices handle-num #f)))
; (if (eq? ao-device #f) ; (if (eq? ao-device #f)

View File

@@ -9,8 +9,8 @@
(when (eq? os 'unix) (when (eq? os 'unix)
(set! test-file3 "/muziek/Klassiek-Viool/Alina Ibragimova/Paganini_24 Caprices (2021)/24. 24 Caprices, Op 1 - No. 24 in A minor- Tema con variazioni. Quasi presto.flac")) (set! test-file3 "/muziek/Klassiek-Viool/Alina Ibragimova/Paganini_24 Caprices (2021)/24. 24 Caprices, Op 1 - No. 24 in A minor- Tema con variazioni. Quasi presto.flac"))
(when (eq? os 'windows) (when (eq? os 'windows)
;(set! test-file3 "C:\\Muziek\\Klassiek-Strijkkwartet\\Quatuor Zaïde\\Franz\\01 Erlkönig, D. 328 (Arr. For String Quartet by Eric Mouret).flac") (set! test-file3 "C:\\Muziek\\Klassiek-Strijkkwartet\\Quatuor Zaïde\\Franz\\01 Erlkönig, D. 328 (Arr. For String Quartet by Eric Mouret).flac")
(set! test-file3 "C:\\Muziek\\Klassiek-Viool\\Janine Jansen\\Janine Jansen - Sibelius en Prokovief 1 (2024)\\02 - Violin Concerto in D Minor, Op. 47 II. Adagio di molto.flac") ;(set! test-file3 "C:\\Muziek\\Klassiek-Viool\\Janine Jansen\\Janine Jansen - Sibelius en Prokovief 1 (2024)\\02 - Violin Concerto in D Minor, Op. 47 II. Adagio di molto.flac")
) )
) )