3 * $Id: ausys-fake.c,v 1.1 2002/02/02 19:16:28 mdw Exp $
5 * Fake not-audio-at-all audio driver
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 /*----- Header files ------------------------------------------------------*/
38 #include <mLib/alloc.h>
40 #include <mLib/trace.h>
46 /*----- Global variables --------------------------------------------------*/
48 const char *const ausys_suffix = "txt";
50 /*----- Main code ---------------------------------------------------------*/
52 /* --- @ausys_init@ --- *
58 * Use: Does any initialization required by the system-specific audio
64 T( trace(T_AUSYS, "ausys: initalized ok"); )
67 /* --- @ausys_shutdown@ --- *
73 * Use: Does any tidying up required.
76 void ausys_shutdown(void)
78 T( trace(T_AUSYS, "ausys: shut down ok"); )
81 /* --- @ausys_lock@, @ausys_unlock@ --- *
87 * Use: Locks or unlocks the audio subsystem. This protects the
88 * audio queue from becoming corrupted during all the tedious
92 void ausys_lock(void) { T( trace(T_AUSYS, "ausys: acquired lock"); ) ; }
93 void ausys_unlock(void) { T( trace(T_AUSYS, "ausys: released lock"); ) ; }
95 /* --- @ausys_decode@ --- *
97 * Arguments: @au_sample *s@ = pointer to sample block
98 * @const void *p@ = pointer to sample file contents
99 * @size_t sz@ = size of sample file contents
101 * Returns: Pointer to a sample data structure.
103 * Use: Decodes a WAV file into something the system-specific layer
104 * actually wants to deal with.
107 au_data *ausys_decode(au_sample *s, const void *p, size_t sz)
109 au_data *a = CREATE(au_data);
111 const octet *qq = memchr(pp, '\n', sz);
121 T( trace(T_AUSYS, "ausys: decoded `%s' ok", SYM_NAME(s)); )
125 /* --- @ausys_queue@ --- *
127 * Arguments: @au_data *a@ = an audio thingy to play
131 * Use: Queues an audio sample to be played. The sample should be
132 * freed (with @au_free@) when it's no longer wanted.
135 void ausys_queue(au_data *a)
137 T( trace(T_AUSYS, "ausys: queuing `%s'", SYM_NAME(a->s)); )
138 printf("[%s]\n", a->p);
142 /* --- @ausys_free@ --- *
144 * Arguments: @au_data *a@ = an audio thingy to free
148 * Use: Frees a decoded audio sample.
151 void ausys_free(au_data *a)
153 T( trace(T_AUSYS, "ausys: freeing data for `%s' ok", SYM_NAME(a->s)); )
158 /*----- That's all, folks -------------------------------------------------*/