3 * $Id: ausys.h,v 1.1 2002/02/02 19:16:28 mdw Exp $
5 * System-specific audio-handling interface
7 * (c) 2002 Mark Wooding
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Jog: Programming for a jogging machine.
14 * Jog is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * Jog is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with Jog; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.1 2002/02/02 19:16:28 mdw
33 * New audio subsystem.
44 /*----- Header files ------------------------------------------------------*/
50 /*----- Global variables --------------------------------------------------*/
52 extern const char *const ausys_suffix
; /* Suffix for audio files */
54 /*----- Functions provided ------------------------------------------------*/
56 /* --- @ausys_init@ --- *
62 * Use: Does any initialization required by the system-specific audio
66 extern void ausys_init(void);
68 /* --- @ausys_shutdown@ --- *
74 * Use: Does any tidying up required.
77 extern void ausys_shutdown(void);
79 /* --- @ausys_lock@, @ausys_unlock@ --- *
85 * Use: Locks or unlocks the audio subsystem. This protects the
86 * audio queue from becoming corrupted during all the tedious
90 extern void ausys_lock(void);
91 extern void ausys_unlock(void);
93 /* --- @ausys_queue@ --- *
95 * Arguments: @au_data *a@ = an audio thingy to play
99 * Use: Queues an audio sample to be played. The sample should be
100 * freed (with @au_free@) when it's no longer wanted.
103 extern void ausys_queue(au_data */
*a*/
);
105 /* --- @ausys_decode@ --- *
107 * Arguments: @au_sample *s@ = pointer to sample block
108 * @const void *p@ = pointer to sample file contents
109 * @size_t sz@ = size of sample file contents
111 * Returns: Pointer to a sample data structure.
113 * Use: Decodes a WAV file into something the system-specific layer
114 * actually wants to deal with.
117 extern au_data
*ausys_decode(au_sample */
*s*/
,
118 const void */
*p*/
, size_t /*sz*/);
120 /* --- @ausys_free@ --- *
122 * Arguments: @au_data *a@ = an audio thingy to free
126 * Use: Frees a decoded audio sample.
129 extern void ausys_free(au_data */
*a*/
);
131 /*----- That's all, folks -------------------------------------------------*/