X-Git-Url: https://git.distorted.org.uk/~mdw/jog/blobdiff_plain/b41f38f059a9e191c97c03259649b27393475f2f..af666e6f949ddb4f2cdfc4d3564fbe82e8b8d81b:/au.h diff --git a/au.h b/au.h index 7678943..891bdf4 100644 --- a/au.h +++ b/au.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: au.h,v 1.1 2002/02/02 19:16:28 mdw Exp $ + * $Id: au.h,v 1.2 2002/02/02 22:43:50 mdw Exp $ * * Audio handling * @@ -29,6 +29,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: au.h,v $ + * Revision 1.2 2002/02/02 22:43:50 mdw + * Provide a decent interface for finding out about the audio cache and + * configuring its capacity. + * * Revision 1.1 2002/02/02 19:16:28 mdw * New audio subsystem. * @@ -93,7 +97,21 @@ typedef struct au_data { size_t sz; /* Size of sample file data */ } au_data; -#define AU_CACHEMAX 0x01000000 /* Maximum resident sample data */ +/* --- Audio cache information --- */ + +typedef struct au_cacheinfo { + size_t sz_max; /* Maximum allowed cache size */ + size_t sz_total; /* Total size used by samples */ + size_t sz_spare; /* Size used by `spare' samples */ + size_t sz_queue; /* Size used by queued samples */ + unsigned n_total; /* Total number of cached samples */ + unsigned n_spare; /* Number of `spare' samples */ + unsigned n_queue; /* Number of queued samples */ + unsigned long hits; /* Number of cache hits */ + unsigned long misses; /* Number of cache misses */ +} au_cacheinfo; + +#define AU_CACHEMAX 0x01000000 /* Default cache maximum size */ /*----- Functions provided ------------------------------------------------*/ @@ -120,6 +138,29 @@ extern void au_init(const char */*dir*/, size_t /*max*/); extern void au_shutdown(void); +/* --- @au_getcacheinfo@ --- * + * + * Arguments: @au_cacheinfo *c@ = where to put the information + * + * Returns: --- + * + * Use: Extracts audio cache information. + */ + +extern void au_getcacheinfo(au_cacheinfo */*c*/); + +/* --- @au_setcachelimit@ --- * + * + * Arguments: @size_t max@ = new cache limit + * + * Returns: --- + * + * Use: Reconfigures the maximum cache size. This probably isn't + * very useful, but it was easy... + */ + +extern void au_setcachelimit(size_t /*max*/); + /* --- @au_find@ --- * * * Arguments: @const char *tag@ = sample tag string