jpayne@69: /** jpayne@69: * \file include/output.h jpayne@69: * \brief Application interface library for the ALSA driver jpayne@69: * \author Jaroslav Kysela jpayne@69: * \author Abramo Bagnara jpayne@69: * \author Takashi Iwai jpayne@69: * \date 1998-2001 jpayne@69: * jpayne@69: * Application interface library for the ALSA driver jpayne@69: */ jpayne@69: /* jpayne@69: * This library is free software; you can redistribute it and/or modify jpayne@69: * it under the terms of the GNU Lesser General Public License as jpayne@69: * published by the Free Software Foundation; either version 2.1 of jpayne@69: * the License, or (at your option) any later version. jpayne@69: * jpayne@69: * This program is distributed in the hope that it will be useful, jpayne@69: * but WITHOUT ANY WARRANTY; without even the implied warranty of jpayne@69: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jpayne@69: * GNU Lesser General Public License for more details. jpayne@69: * jpayne@69: * You should have received a copy of the GNU Lesser General Public jpayne@69: * License along with this library; if not, write to the Free Software jpayne@69: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: #ifndef __ALSA_OUTPUT_H jpayne@69: #define __ALSA_OUTPUT_H jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \defgroup Output Output Interface jpayne@69: * jpayne@69: * The output functions present an interface similar to the stdio functions jpayne@69: * on top of different underlying output destinations. jpayne@69: * jpayne@69: * Many PCM debugging functions (\c snd_pcm_xxx_dump_xxx) use such an output jpayne@69: * handle to be able to write not only to the screen but also to other jpayne@69: * destinations, e.g. to files or to memory buffers. jpayne@69: * jpayne@69: * \{ jpayne@69: */ jpayne@69: jpayne@69: /** jpayne@69: * \brief Internal structure for an output object. jpayne@69: * jpayne@69: * The ALSA library uses a pointer to this structure as a handle to an jpayne@69: * output object. Applications don't access its contents directly. jpayne@69: */ jpayne@69: typedef struct _snd_output snd_output_t; jpayne@69: jpayne@69: /** Output type. */ jpayne@69: typedef enum _snd_output_type { jpayne@69: /** Output to a stdio stream. */ jpayne@69: SND_OUTPUT_STDIO, jpayne@69: /** Output to a memory buffer. */ jpayne@69: SND_OUTPUT_BUFFER jpayne@69: } snd_output_type_t; jpayne@69: jpayne@69: int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode); jpayne@69: int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close); jpayne@69: int snd_output_buffer_open(snd_output_t **outputp); jpayne@69: size_t snd_output_buffer_string(snd_output_t *output, char **buf); jpayne@69: int snd_output_close(snd_output_t *output); jpayne@69: int snd_output_printf(snd_output_t *output, const char *format, ...) jpayne@69: #ifndef DOC_HIDDEN jpayne@69: __attribute__ ((format (printf, 2, 3))) jpayne@69: #endif jpayne@69: ; jpayne@69: int snd_output_vprintf(snd_output_t *output, const char *format, va_list args); jpayne@69: int snd_output_puts(snd_output_t *output, const char *str); jpayne@69: int snd_output_putc(snd_output_t *output, int c); jpayne@69: int snd_output_flush(snd_output_t *output); jpayne@69: jpayne@69: /** \} */ jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: #endif /* __ALSA_OUTPUT_H */ jpayne@69: