2001-09-13 11:38:32 +00:00
|
|
|
/**
|
2005-01-17 17:34:31 +00:00
|
|
|
* \file include/output.h
|
2001-09-13 11:38:32 +00:00
|
|
|
* \brief Application interface library for the ALSA driver
|
2007-10-15 10:24:55 +02:00
|
|
|
* \author Jaroslav Kysela <perex@perex.cz>
|
2001-09-13 11:38:32 +00:00
|
|
|
* \author Abramo Bagnara <abramo@alsa-project.org>
|
|
|
|
|
* \author Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
* \date 1998-2001
|
|
|
|
|
*
|
|
|
|
|
* Application interface library for the ALSA driver
|
2002-07-23 19:51:16 +00:00
|
|
|
*/
|
|
|
|
|
/*
|
2001-09-13 11:38:32 +00:00
|
|
|
* This library is free software; you can redistribute it and/or modify
|
2001-12-30 09:22:54 +00:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
2001-09-13 11:38:32 +00:00
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2001-12-30 09:22:54 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2001-09-13 11:38:32 +00:00
|
|
|
*
|
2001-12-30 09:22:54 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2001-09-13 11:38:32 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2017-11-14 14:29:26 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-09-13 11:38:32 +00:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2025-02-02 13:46:12 +01:00
|
|
|
#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
|
|
|
|
|
/* don't use ALSA_LIBRARY_BUILD define in sources outside alsa-lib */
|
|
|
|
|
#warning "use #include <alsa/asoundlib.h>, <alsa/input.h> should not be used directly"
|
|
|
|
|
#include <alsa/asoundlib.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-09-13 11:38:32 +00:00
|
|
|
#ifndef __ALSA_OUTPUT_H
|
|
|
|
|
#define __ALSA_OUTPUT_H
|
|
|
|
|
|
2001-11-14 11:40:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-04-24 13:02:58 +00:00
|
|
|
/**
|
|
|
|
|
* \defgroup Output Output Interface
|
2002-07-23 19:51:16 +00:00
|
|
|
*
|
|
|
|
|
* The output functions present an interface similar to the stdio functions
|
|
|
|
|
* on top of different underlying output destinations.
|
|
|
|
|
*
|
|
|
|
|
* Many PCM debugging functions (\c snd_pcm_xxx_dump_xxx) use such an output
|
|
|
|
|
* handle to be able to write not only to the screen but also to other
|
|
|
|
|
* destinations, e.g. to files or to memory buffers.
|
|
|
|
|
*
|
2001-04-24 13:02:58 +00:00
|
|
|
* \{
|
|
|
|
|
*/
|
2001-01-17 11:00:32 +00:00
|
|
|
|
2002-07-23 19:51:16 +00:00
|
|
|
/**
|
|
|
|
|
* \brief Internal structure for an output object.
|
|
|
|
|
*
|
|
|
|
|
* The ALSA library uses a pointer to this structure as a handle to an
|
|
|
|
|
* output object. Applications don't access its contents directly.
|
|
|
|
|
*/
|
2001-01-17 11:00:32 +00:00
|
|
|
typedef struct _snd_output snd_output_t;
|
|
|
|
|
|
2002-07-23 19:51:16 +00:00
|
|
|
/** Output type. */
|
2001-03-25 14:13:55 +00:00
|
|
|
typedef enum _snd_output_type {
|
2002-07-23 19:51:16 +00:00
|
|
|
/** Output to a stdio stream. */
|
2001-01-17 11:00:32 +00:00
|
|
|
SND_OUTPUT_STDIO,
|
2002-07-23 19:51:16 +00:00
|
|
|
/** Output to a memory buffer. */
|
2002-02-05 11:36:20 +00:00
|
|
|
SND_OUTPUT_BUFFER
|
2001-03-25 14:13:55 +00:00
|
|
|
} snd_output_type_t;
|
2001-01-17 11:00:32 +00:00
|
|
|
|
2001-03-29 17:50:28 +00:00
|
|
|
int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode);
|
|
|
|
|
int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close);
|
2001-01-17 11:00:32 +00:00
|
|
|
int snd_output_buffer_open(snd_output_t **outputp);
|
|
|
|
|
size_t snd_output_buffer_string(snd_output_t *output, char **buf);
|
2021-04-12 16:47:58 +02:00
|
|
|
size_t snd_output_buffer_steal(snd_output_t *output, char **buf);
|
2001-01-17 11:00:32 +00:00
|
|
|
int snd_output_close(snd_output_t *output);
|
2002-07-23 19:51:16 +00:00
|
|
|
int snd_output_printf(snd_output_t *output, const char *format, ...)
|
|
|
|
|
#ifndef DOC_HIDDEN
|
|
|
|
|
__attribute__ ((format (printf, 2, 3)))
|
|
|
|
|
#endif
|
|
|
|
|
;
|
2003-06-24 19:30:08 +00:00
|
|
|
int snd_output_vprintf(snd_output_t *output, const char *format, va_list args);
|
2001-01-17 11:00:32 +00:00
|
|
|
int snd_output_puts(snd_output_t *output, const char *str);
|
|
|
|
|
int snd_output_putc(snd_output_t *output, int c);
|
|
|
|
|
int snd_output_flush(snd_output_t *output);
|
2001-01-29 08:29:52 +00:00
|
|
|
|
2001-11-14 11:40:46 +00:00
|
|
|
/** \} */
|
|
|
|
|
|
2001-01-29 08:29:52 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2001-04-24 13:02:58 +00:00
|
|
|
|
2001-09-13 11:38:32 +00:00
|
|
|
#endif /* __ALSA_OUTPUT_H */
|
|
|
|
|
|