1 /* 2 * PCM - Common generic plugin code 3 * Copyright (c) 2004 by Jaroslav Kysela <perex@perex.cz> 4 * 5 * 6 * This library is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as 8 * published by the Free Software Foundation; either version 2.1 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * 20 */ 21 22 typedef struct { 23 snd_pcm_t *slave; 24 int close_slave; 25 } snd_pcm_generic_t; 26 27 /* make local functions really local */ 28 #define snd_pcm_generic_close \ 29 snd1_pcm_generic_close 30 #define snd_pcm_generic_nonblock \ 31 snd1_pcm_generic_nonblock 32 #define snd_pcm_generic_async \ 33 snd1_pcm_generic_async 34 #define snd_pcm_generic_poll_descriptors_count \ 35 snd1_pcm_generic_poll_descriptors_count 36 #define snd_pcm_generic_poll_descriptors \ 37 snd1_pcm_generic_poll_descriptors 38 #define snd_pcm_generic_poll_revents \ 39 snd1_pcm_generic_poll_revents 40 #define snd_pcm_generic_info \ 41 snd1_pcm_generic_info 42 #define snd_pcm_generic_hw_free \ 43 snd1_pcm_generic_hw_free 44 #define snd_pcm_generic_sw_params \ 45 snd1_pcm_generic_sw_params 46 #define snd_pcm_generic_hw_refine \ 47 snd1_pcm_generic_hw_refine 48 #define snd_pcm_generic_hw_params \ 49 snd1_pcm_generic_hw_params 50 #define snd_pcm_generic_channel_info \ 51 snd1_pcm_generic_channel_info 52 #define snd_pcm_generic_channel_info_no_buffer \ 53 snd1_pcm_generic_channel_info_no_buffer 54 #define snd_pcm_generic_status \ 55 snd1_pcm_generic_status 56 #define snd_pcm_generic_state \ 57 snd1_pcm_generic_state 58 #define snd_pcm_generic_prepare \ 59 snd1_pcm_generic_prepare 60 #define snd_pcm_generic_hwsync \ 61 snd1_pcm_generic_hwsync 62 #define snd_pcm_generic_reset \ 63 snd1_pcm_generic_reset 64 #define snd_pcm_generic_start \ 65 snd1_pcm_generic_start 66 #define snd_pcm_generic_drop \ 67 snd1_pcm_generic_drop 68 #define snd_pcm_generic_drain \ 69 snd1_pcm_generic_drain 70 #define snd_pcm_generic_pause \ 71 snd1_pcm_generic_pause 72 #define snd_pcm_generic_resume \ 73 snd1_pcm_generic_resume 74 #define snd_pcm_generic_delay \ 75 snd1_pcm_generic_delay 76 #define snd_pcm_generic_forwardable \ 77 snd1_pcm_generic_forwardable 78 #define snd_pcm_generic_forward \ 79 snd1_pcm_generic_forward 80 #define snd_pcm_generic_rewindable \ 81 snd1_pcm_generic_rewindable 82 #define snd_pcm_generic_rewind \ 83 snd1_pcm_generic_rewind 84 #define snd_pcm_generic_link \ 85 snd1_pcm_generic_link 86 #define snd_pcm_generic_link_slaves \ 87 snd1_pcm_generic_link_slaves 88 #define snd_pcm_generic_unlink \ 89 snd1_pcm_generic_unlink 90 #define snd_pcm_generic_writei \ 91 snd1_pcm_generic_writei 92 #define snd_pcm_generic_writen \ 93 snd1_pcm_generic_writen 94 #define snd_pcm_generic_readi \ 95 snd1_pcm_generic_readi 96 #define snd_pcm_generic_readn \ 97 snd1_pcm_generic_readn 98 #define snd_pcm_generic_mmap_commit \ 99 snd1_pcm_generic_mmap_commit 100 #define snd_pcm_generic_avail_update \ 101 snd1_pcm_generic_avail_update 102 #define snd_pcm_generic_mmap \ 103 snd1_pcm_generic_mmap 104 #define snd_pcm_generic_munmap \ 105 snd1_pcm_generic_munmap 106 #define snd_pcm_generic_query_chmaps \ 107 snd1_pcm_generic_query_chmaps 108 #define snd_pcm_generic_get_chmap \ 109 snd1_pcm_generic_get_chmap 110 #define snd_pcm_generic_set_chmap \ 111 snd1_pcm_generic_set_chmap 112 #define snd_pcm_generic_may_wait_for_avail_min \ 113 snd1_pcm_generic_may_wait_for_avail_min 114 115 int snd_pcm_generic_close(snd_pcm_t *pcm); 116 int snd_pcm_generic_nonblock(snd_pcm_t *pcm, int nonblock); 117 int snd_pcm_generic_async(snd_pcm_t *pcm, int sig, pid_t pid); 118 int snd_pcm_generic_poll_descriptors_count(snd_pcm_t *pcm); 119 int snd_pcm_generic_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space); 120 int snd_pcm_generic_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); 121 int snd_pcm_generic_info(snd_pcm_t *pcm, snd_pcm_info_t * info); 122 int snd_pcm_generic_hw_free(snd_pcm_t *pcm); 123 int snd_pcm_generic_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params); 124 int snd_pcm_generic_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 125 int snd_pcm_generic_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 126 int snd_pcm_generic_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info); 127 int snd_pcm_generic_channel_info_no_buffer(snd_pcm_t *pcm, snd_pcm_channel_info_t * info); 128 int snd_pcm_generic_status(snd_pcm_t *pcm, snd_pcm_status_t * status); 129 snd_pcm_state_t snd_pcm_generic_state(snd_pcm_t *pcm); 130 int snd_pcm_generic_prepare(snd_pcm_t *pcm); 131 int snd_pcm_generic_hwsync(snd_pcm_t *pcm); 132 int snd_pcm_generic_reset(snd_pcm_t *pcm); 133 int snd_pcm_generic_start(snd_pcm_t *pcm); 134 int snd_pcm_generic_drop(snd_pcm_t *pcm); 135 int snd_pcm_generic_drain(snd_pcm_t *pcm); 136 int snd_pcm_generic_pause(snd_pcm_t *pcm, int enable); 137 int snd_pcm_generic_resume(snd_pcm_t *pcm); 138 int snd_pcm_generic_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp); 139 snd_pcm_sframes_t snd_pcm_generic_forwardable(snd_pcm_t *pcm); 140 snd_pcm_sframes_t snd_pcm_generic_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames); 141 snd_pcm_sframes_t snd_pcm_generic_rewindable(snd_pcm_t *pcm); 142 snd_pcm_sframes_t snd_pcm_generic_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames); 143 int snd_pcm_generic_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2); 144 int snd_pcm_generic_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master); 145 int snd_pcm_generic_unlink(snd_pcm_t *pcm); 146 snd_pcm_sframes_t snd_pcm_generic_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); 147 snd_pcm_sframes_t snd_pcm_generic_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); 148 snd_pcm_sframes_t snd_pcm_generic_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size); 149 snd_pcm_sframes_t snd_pcm_generic_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); 150 snd_pcm_sframes_t snd_pcm_generic_mmap_commit(snd_pcm_t *pcm, 151 snd_pcm_uframes_t offset, 152 snd_pcm_uframes_t size); 153 snd_pcm_sframes_t snd_pcm_generic_avail_update(snd_pcm_t *pcm); 154 int snd_pcm_generic_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, 155 snd_htimestamp_t *timestamp); 156 int snd_pcm_generic_real_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, 157 snd_htimestamp_t *tstamp); 158 int snd_pcm_generic_mmap(snd_pcm_t *pcm); 159 int snd_pcm_generic_munmap(snd_pcm_t *pcm); 160 snd_pcm_chmap_query_t **snd_pcm_generic_query_chmaps(snd_pcm_t *pcm); 161 snd_pcm_chmap_t *snd_pcm_generic_get_chmap(snd_pcm_t *pcm); 162 int snd_pcm_generic_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map); 163 int snd_pcm_generic_may_wait_for_avail_min(snd_pcm_t *pcm, snd_pcm_uframes_t avail); 164 165