diff options
Diffstat (limited to 'include/tinyalsa/pcm.h')
-rw-r--r-- | include/tinyalsa/pcm.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index 9b22c55..36aaf85 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -35,13 +35,11 @@ #ifndef TINYALSA_PCM_H #define TINYALSA_PCM_H +#include <tinyalsa/attributes.h> + #include <sys/time.h> #include <stddef.h> -#if defined(__cplusplus) -extern "C" { -#endif - /** A flag that specifies that the PCM is an output. * May not be bitwise AND'd with @ref PCM_IN. * Used in @ref pcm_open. @@ -97,6 +95,11 @@ extern "C" { * */ #define PCM_NONBLOCK 0x00000010 +/** Means a PCM is prepared + * @ingroup libtinyalsa-pcm + */ +#define PCM_STATE_PREPARED 0x02 + /** For inputs, this means the PCM is recording audio samples. * For outputs, this means the PCM is playing audio samples. * @ingroup libtinyalsa-pcm @@ -123,6 +126,10 @@ extern "C" { */ #define PCM_STATE_DISCONNECTED 0x08 +#if defined(__cplusplus) +extern "C" { +#endif + /** Audio sample format of a PCM. * The first letter specifiers whether the sample is signed or unsigned. * The letter 'S' means signed. The letter 'U' means unsigned. @@ -279,23 +286,13 @@ int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, struct timespec *ts unsigned int pcm_get_subdevice(const struct pcm *pcm); -int pcm_writei(struct pcm *pcm, const void *data, unsigned int frame_count); - -int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count); - -#ifdef __GNUC__ +int pcm_writei(struct pcm *pcm, const void *data, unsigned int frame_count) TINYALSA_WARN_UNUSED_RESULT; -int pcm_write(struct pcm *pcm, const void *data, unsigned int count) __attribute((deprecated)); +int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count) TINYALSA_WARN_UNUSED_RESULT; -int pcm_read(struct pcm *pcm, void *data, unsigned int count) __attribute((deprecated)); +int pcm_write(struct pcm *pcm, const void *data, unsigned int count) TINYALSA_DEPRECATED; -#else - -int pcm_write(struct pcm *pcm, const void *data, unsigned int count); - -int pcm_read(struct pcm *pcm, void *data, unsigned int count); - -#endif +int pcm_read(struct pcm *pcm, void *data, unsigned int count) TINYALSA_DEPRECATED; int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count); |