Main Page   Namespace List   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

audio_out.h

00001 /*
00002  * audio_out.h
00003  * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
00004  * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
00005  *
00006  * This file is part of a52dec, a free ATSC A-52 stream decoder.
00007  * See http://liba52.sourceforge.net/ for updates.
00008  *
00009  * a52dec is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * a52dec is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  */
00023 
00024 typedef struct ao_instance_s ao_instance_t;
00025 
00026 struct ao_instance_s {
00027     int (* setup) (ao_instance_t * instance, int sample_rate, int * flags,
00028                    sample_t * level, sample_t * bias);
00029     int (* play) (ao_instance_t * instance, int flags, sample_t * samples);
00030     void (* close) (ao_instance_t * instance);
00031 };
00032 
00033 typedef ao_instance_t * ao_open_t (void);
00034 
00035 typedef struct ao_driver_s {
00036     char * name;
00037     ao_open_t * open;
00038 } ao_driver_t;
00039 
00040 /* return NULL terminated array of all drivers */
00041 ao_driver_t * ao_drivers (void);
00042 
00043 static inline ao_instance_t * ao_open (ao_open_t * open)
00044 {
00045     return open ();
00046 }
00047 
00048 static inline int ao_setup (ao_instance_t * instance, int sample_rate,
00049                             int * flags, sample_t * level, sample_t * bias)
00050 {
00051     return instance->setup (instance, sample_rate, flags, level, bias);
00052 }
00053 
00054 static inline int ao_play (ao_instance_t * instance, int flags,
00055                            sample_t * samples)
00056 {
00057     return instance->play (instance, flags, samples);
00058 }
00059 
00060 static inline void ao_close (ao_instance_t * instance)
00061 {
00062     if (instance->close)
00063         instance->close (instance);
00064 }

Generated on Sat Sep 25 14:06:34 2004 for ac3 by doxygen1.2.18