|
| 1 | +/**************************************************************************** |
| 2 | + * include/nuttx/audio/audio_comp.h |
| 3 | + * A general audio driver to composite other lower level audio driver. |
| 4 | + * |
| 5 | + * Copyright (C) 2018 Pinecone Inc. All rights reserved. |
| 6 | + * Author: Xiang Xiao <xiaoxiang@pinecone.net> |
| 7 | + * |
| 8 | + * Redistribution and use in source and binary forms, with or without |
| 9 | + * modification, are permitted provided that the following conditions |
| 10 | + * are met: |
| 11 | + * |
| 12 | + * 1. Redistributions of source code must retain the above copyright |
| 13 | + * notice, this list of conditions and the following disclaimer. |
| 14 | + * 2. Redistributions in binary form must reproduce the above copyright |
| 15 | + * notice, this list of conditions and the following disclaimer in |
| 16 | + * the documentation and/or other materials provided with the |
| 17 | + * distribution. |
| 18 | + * 3. Neither the name NuttX nor the names of its contributors may be |
| 19 | + * used to endorse or promote products derived from this software |
| 20 | + * without specific prior written permission. |
| 21 | + * |
| 22 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 23 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 24 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 25 | + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 26 | + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 27 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 28 | + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 29 | + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 30 | + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 31 | + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 32 | + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 33 | + * POSSIBILITY OF SUCH DAMAGE. |
| 34 | + * |
| 35 | + ****************************************************************************/ |
| 36 | + |
| 37 | +#ifndef __INCLUDE_NUTTX_AUDIO_AUDIO_COMP_H |
| 38 | +#define __INCLUDE_NUTTX_AUDIO_AUDIO_COMP_H |
| 39 | + |
| 40 | +/**************************************************************************** |
| 41 | + * Included Files |
| 42 | + ****************************************************************************/ |
| 43 | + |
| 44 | +#include <nuttx/config.h> |
| 45 | + |
| 46 | +#ifdef CONFIG_AUDIO_COMP |
| 47 | +#include <nuttx/audio/audio.h> |
| 48 | + |
| 49 | +/**************************************************************************** |
| 50 | + * Pre-processor Definitions |
| 51 | + ****************************************************************************/ |
| 52 | + |
| 53 | +/**************************************************************************** |
| 54 | + * Public Types |
| 55 | + ****************************************************************************/ |
| 56 | + |
| 57 | +/**************************************************************************** |
| 58 | + * Public Data |
| 59 | + ****************************************************************************/ |
| 60 | + |
| 61 | +#ifdef __cplusplus |
| 62 | +#define EXTERN extern "C" |
| 63 | +extern "C" |
| 64 | +{ |
| 65 | +#else |
| 66 | +#define EXTERN extern |
| 67 | +#endif |
| 68 | + |
| 69 | +/**************************************************************************** |
| 70 | + * Public Function Prototypes |
| 71 | + ****************************************************************************/ |
| 72 | + |
| 73 | +/**************************************************************************** |
| 74 | + * Name: audio_comp_initialize |
| 75 | + * |
| 76 | + * Description: |
| 77 | + * Initialize the composite audio device. |
| 78 | + * |
| 79 | + * Input Parameters: |
| 80 | + * name - The name of the audio device. |
| 81 | + * ... - The list of the lower half audio driver. |
| 82 | + * |
| 83 | + * Returned Value: |
| 84 | + * Zero on success; a negated errno value on failure. |
| 85 | + * |
| 86 | + * Note |
| 87 | + * The variable argument list must be NULL terminated. |
| 88 | + * |
| 89 | + ****************************************************************************/ |
| 90 | + |
| 91 | +int audio_comp_initialize(FAR const char *name, ...); |
| 92 | + |
| 93 | +#undef EXTERN |
| 94 | +#ifdef __cplusplus |
| 95 | +} |
| 96 | +#endif |
| 97 | + |
| 98 | +#endif /* CONFIG_AUDIO_COMP */ |
| 99 | +#endif /* __INCLUDE_NUTTX_AUDIO_AUDIO_COMP_H */ |
0 commit comments