From 459cdd94ceef292d1dc32a482f59bc72b89888a5 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 30 Apr 2014 20:29:26 +0100 Subject: [PATCH] add flush and delay functions --- audio.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/audio.h b/audio.h index 66c9c2f0..cfe12721 100644 --- a/audio.h +++ b/audio.h @@ -1,6 +1,8 @@ #ifndef _AUDIO_H #define _AUDIO_H +#include + typedef struct { void (*help)(void); char *name; @@ -11,9 +13,18 @@ typedef struct { void (*deinit)(void); void (*start)(int sample_rate); + // block of samples void (*play)(short buf[], int samples); void (*stop)(void); + + // may be null if not implemented + void (*flush)(void); + + // returns the delay before the next frame to be sent to the device would actually be audible. + // almost certainly wrong if the buffer is empty, so put silent buffers into it to make it busy. + // will change dynamically, so keep watching it. Implemented in ALSA only. + uint32_t (*delay)(); // may be NULL, in which case soft volume is applied void (*volume)(double vol);