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.
36 /*----- Header files ------------------------------------------------------*/
42 /*----- Global variables --------------------------------------------------*/
44 extern const char *const ausys_suffix
; /* Suffix for audio files */
46 /*----- Functions provided ------------------------------------------------*/
48 /* --- @ausys_init@ --- *
54 * Use: Does any initialization required by the system-specific audio
58 extern void ausys_init(void);
60 /* --- @ausys_shutdown@ --- *
66 * Use: Does any tidying up required.
69 extern void ausys_shutdown(void);
71 /* --- @ausys_lock@, @ausys_unlock@ --- *
77 * Use: Locks or unlocks the audio subsystem. This protects the
78 * audio queue from becoming corrupted during all the tedious
82 extern void ausys_lock(void);
83 extern void ausys_unlock(void);
85 /* --- @ausys_queue@ --- *
87 * Arguments: @au_data *a@ = an audio thingy to play
91 * Use: Queues an audio sample to be played. The sample should be
92 * freed (with @au_free@) when it's no longer wanted.
95 extern void ausys_queue(au_data */
*a*/
);
97 /* --- @ausys_decode@ --- *
99 * Arguments: @au_sample *s@ = pointer to sample block
100 * @const void *p@ = pointer to sample file contents
101 * @size_t sz@ = size of sample file contents
103 * Returns: Pointer to a sample data structure.
105 * Use: Decodes a WAV file into something the system-specific layer
106 * actually wants to deal with.
109 extern au_data
*ausys_decode(au_sample */
*s*/
,
110 const void */
*p*/
, size_t /*sz*/);
112 /* --- @ausys_free@ --- *
114 * Arguments: @au_data *a@ = an audio thingy to free
118 * Use: Frees a decoded audio sample.
121 extern void ausys_free(au_data */
*a*/
);
123 /*----- That's all, folks -------------------------------------------------*/