00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __ALSA_PCM_EXTPLUG_H
00032 #define __ALSA_PCM_EXTPLUG_H
00033
00042 enum {
00043 SND_PCM_EXTPLUG_HW_FORMAT,
00044 SND_PCM_EXTPLUG_HW_CHANNELS,
00045 SND_PCM_EXTPLUG_HW_PARAMS
00046 };
00047
00049 typedef struct snd_pcm_extplug snd_pcm_extplug_t;
00051 typedef struct snd_pcm_extplug_callback snd_pcm_extplug_callback_t;
00052
00053
00054
00055
00056 #define SND_PCM_EXTPLUG_VERSION_MAJOR 1
00057 #define SND_PCM_EXTPLUG_VERSION_MINOR 0
00058 #define SND_PCM_EXTPLUG_VERSION_TINY 1
00062 #define SND_PCM_EXTPLUG_VERSION ((SND_PCM_EXTPLUG_VERSION_MAJOR<<16) |\
00063 (SND_PCM_EXTPLUG_VERSION_MINOR<<8) |\
00064 (SND_PCM_EXTPLUG_VERSION_TINY))
00065
00067 struct snd_pcm_extplug {
00072 unsigned int version;
00076 const char *name;
00080 const snd_pcm_extplug_callback_t *callback;
00084 void *private_data;
00088 snd_pcm_t *pcm;
00092 snd_pcm_stream_t stream;
00096 snd_pcm_format_t format;
00100 snd_pcm_subformat_t subformat;
00104 unsigned int channels;
00108 unsigned int rate;
00112 snd_pcm_format_t slave_format;
00116 snd_pcm_subformat_t slave_subformat;
00120 unsigned int slave_channels;
00121 };
00122
00124 struct snd_pcm_extplug_callback {
00128 snd_pcm_sframes_t (*transfer)(snd_pcm_extplug_t *ext,
00129 const snd_pcm_channel_area_t *dst_areas,
00130 snd_pcm_uframes_t dst_offset,
00131 const snd_pcm_channel_area_t *src_areas,
00132 snd_pcm_uframes_t src_offset,
00133 snd_pcm_uframes_t size);
00137 int (*close)(snd_pcm_extplug_t *ext);
00141 int (*hw_params)(snd_pcm_extplug_t *ext, snd_pcm_hw_params_t *params);
00145 int (*hw_free)(snd_pcm_extplug_t *ext);
00149 void (*dump)(snd_pcm_extplug_t *ext, snd_output_t *out);
00153 int (*init)(snd_pcm_extplug_t *ext);
00154 };
00155
00156
00157 int snd_pcm_extplug_create(snd_pcm_extplug_t *ext, const char *name,
00158 snd_config_t *root, snd_config_t *slave_conf,
00159 snd_pcm_stream_t stream, int mode);
00160 int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext);
00161
00162
00163 void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext);
00164
00165
00166 int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
00167 int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
00168 int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
00169 int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
00170
00174 static inline int snd_pcm_extplug_set_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
00175 {
00176 return snd_pcm_extplug_set_param_list(extplug, type, 1, &val);
00177 }
00178
00182 static inline int snd_pcm_extplug_set_slave_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
00183 {
00184 return snd_pcm_extplug_set_slave_param_list(extplug, type, 1, &val);
00185 }
00186
00189 #endif