Fix examples for PCM API. Fix dogygen warnings.

This commit is contained in:
Jaroslav Kysela 2006-07-11 21:48:51 +02:00
parent c7a0708a23
commit 91273c228f
4 changed files with 24 additions and 22 deletions

View file

@ -94,8 +94,7 @@ EXCLUDE = ../src/control/control_local.h \
../src/seq/seq_local.h ../src/seq/seq_local.h
RECURSIVE = YES RECURSIVE = YES
FILE_PATTERNS = *.c *.h FILE_PATTERNS = *.c *.h
EXAMPLE_PATH = ../test/pcm.c ../test/latency.c ../test/rawmidi.c \ EXAMPLE_PATH = ../test
../test/timer.c
IMAGE_PATH = pictures IMAGE_PATH = pictures
QUIET = YES QUIET = YES

View file

@ -822,7 +822,7 @@ int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
* \param elem HCTL element * \param elem HCTL element
* \param value HCTL element value * \param value HCTL element value
* \retval 0 on success * \retval 0 on success
* \ratval >1 on success when value was changed * \retval >1 on success when value was changed
* \retval <0 a negative error code on failure * \retval <0 a negative error code on failure
*/ */
int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value) int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
@ -854,7 +854,7 @@ int snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned in
* \param elem HCTL element * \param elem HCTL element
* \param tlv TLV array for value * \param tlv TLV array for value
* \retval 0 on success * \retval 0 on success
* \ratval >1 on success when value was changed * \retval >1 on success when value was changed
* \retval <0 a negative error code on failure * \retval <0 a negative error code on failure
*/ */
int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv) int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv)
@ -870,7 +870,7 @@ int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv)
* \param elem HCTL element * \param elem HCTL element
* \param tlv TLV array for value * \param tlv TLV array for value
* \retval 0 on success * \retval 0 on success
* \ratval >1 on success when value was changed * \retval >1 on success when value was changed
* \retval <0 a negative error code on failure * \retval <0 a negative error code on failure
*/ */
int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv) int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv)

View file

@ -600,39 +600,34 @@ The null device is null plugin. This device has not any arguments.
\section pcm_examples Examples \section pcm_examples Examples
The full featured examples with cross-links: The full featured examples with cross-links can be found in Examples section
(see top of page):
\anchor example_test_pcm
\par Sine-wave generator \par Sine-wave generator
\ref example_test_pcm "example code"
\par \par
This example shows various transfer methods for the playback direction. alsa-lib/test/pcm.c example shows various transfer methods for the playback direction.
\par Minimalistic PCM playback code \par Minimalistic PCM playback code
\ref example_test_pcm_min "example code"
\par \par
This example shows the minimal code to produce a sound. alsa-lib/test/pcm_min.c example shows the minimal code to produce a sound.
\par Latency measuring tool \par Latency measuring tool
\ref example_test_latency "example code"
\par \par
This example shows the measuring of minimal latency between capture and alsa-lib/test/latency.c example shows the measuring of minimal latency between capture and
playback devices. playback devices.
*/ */
/** /**
* \example ../test/pcm.c \example ../../test/pcm.c
* \anchor example_test_pcm */
*/
/** /**
* \example ../test/pcm_min.c \example ../../test/pcm_min.c
* \anchor example_test_pcm_min */
*/
/** /**
* \example ../test/latency.c \example ../../test/latency.c
* \anchor example_test_latency */
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -419,9 +419,11 @@ static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf,
snd_pcm_uframes_t offset, unsigned int frames, snd_pcm_uframes_t offset, unsigned int frames,
unsigned int channels) unsigned int channels)
{ {
#ifndef DOC_HIDDEN
#define GET16_LABELS #define GET16_LABELS
#include "plugin_ops.h" #include "plugin_ops.h"
#undef GET16_LABELS #undef GET16_LABELS
#endif /* DOC_HIDDEN */
void *get = get16_labels[rate->get_idx]; void *get = get16_labels[rate->get_idx];
const char *src; const char *src;
int16_t sample; int16_t sample;
@ -438,9 +440,11 @@ static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf,
for (c = 0; c < channels; c++) { for (c = 0; c < channels; c++) {
src = srcs[c]; src = srcs[c];
goto *get; goto *get;
#ifndef DOC_HIDDEN
#define GET16_END after_get #define GET16_END after_get
#include "plugin_ops.h" #include "plugin_ops.h"
#undef GET16_END #undef GET16_END
#endif /* DOC_HIDDEN */
after_get: after_get:
*buf++ = sample; *buf++ = sample;
srcs[c] += src_step[c]; srcs[c] += src_step[c];
@ -453,9 +457,11 @@ static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf,
snd_pcm_uframes_t offset, unsigned int frames, snd_pcm_uframes_t offset, unsigned int frames,
unsigned int channels) unsigned int channels)
{ {
#ifndef DOC_HIDDEN
#define PUT16_LABELS #define PUT16_LABELS
#include "plugin_ops.h" #include "plugin_ops.h"
#undef PUT16_LABELS #undef PUT16_LABELS
#endif /* DOC_HIDDEN */
void *put = put16_labels[rate->put_idx]; void *put = put16_labels[rate->put_idx];
char *dst; char *dst;
int16_t sample; int16_t sample;
@ -473,9 +479,11 @@ static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf,
dst = dsts[c]; dst = dsts[c];
sample = *buf++; sample = *buf++;
goto *put; goto *put;
#ifndef DOC_HIDDEN
#define PUT16_END after_put #define PUT16_END after_put
#include "plugin_ops.h" #include "plugin_ops.h"
#undef PUT16_END #undef PUT16_END
#endif /* DOC_HIDDEN */
after_put: after_put:
dsts[c] += dst_step[c]; dsts[c] += dst_step[c];
} }