mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-28 05:40:23 -04:00
Completed mixer API. Improved iterators. Renamed control values struct. Rewritten simple elements implementation
This commit is contained in:
parent
38033b49dd
commit
a2d3434961
54 changed files with 2081 additions and 1712 deletions
|
|
@ -203,7 +203,7 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
void *put = put16_labels[putidx];
|
||||
unsigned int channel;
|
||||
for (channel = 0; channel < channels; ++channel, ++states) {
|
||||
char *src;
|
||||
const char *src;
|
||||
int srcbit;
|
||||
char *dst;
|
||||
int src_step, srcbit_step, dst_step;
|
||||
|
|
@ -265,7 +265,7 @@ void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
|
|||
unsigned int channel;
|
||||
int16_t sample = 0;
|
||||
for (channel = 0; channel < channels; ++channel, ++states) {
|
||||
char *src;
|
||||
const char *src;
|
||||
char *dst;
|
||||
int dstbit;
|
||||
int src_step, dst_step, dstbit_step;
|
||||
|
|
@ -314,7 +314,7 @@ void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
|
|||
|
||||
static int snd_pcm_adpcm_hw_refine_cprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
int err;
|
||||
snd_pcm_access_mask_t access_mask = { SND_PCM_ACCBIT_PLUGIN };
|
||||
err = _snd_pcm_hw_param_set_mask(params, SND_PCM_HW_PARAM_ACCESS,
|
||||
|
|
@ -341,7 +341,7 @@ static int snd_pcm_adpcm_hw_refine_cprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t
|
|||
|
||||
static int snd_pcm_adpcm_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *sparams)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
snd_pcm_access_mask_t saccess_mask = { SND_PCM_ACCBIT_MMAP };
|
||||
_snd_pcm_hw_params_any(sparams);
|
||||
_snd_pcm_hw_param_set_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
|
||||
|
|
@ -399,7 +399,7 @@ static int snd_pcm_adpcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
|
||||
static int snd_pcm_adpcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
int err = snd_pcm_hw_params_slave(pcm, params,
|
||||
snd_pcm_adpcm_hw_refine_cchange,
|
||||
snd_pcm_adpcm_hw_refine_sprepare,
|
||||
|
|
@ -433,7 +433,7 @@ static int snd_pcm_adpcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
|||
|
||||
static int snd_pcm_adpcm_hw_free(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
if (adpcm->states) {
|
||||
free(adpcm->states);
|
||||
adpcm->states = 0;
|
||||
|
|
@ -443,7 +443,7 @@ static int snd_pcm_adpcm_hw_free(snd_pcm_t *pcm)
|
|||
|
||||
static int snd_pcm_adpcm_init(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
unsigned int k;
|
||||
for (k = 0; k < pcm->channels; ++k) {
|
||||
adpcm->states[k].pred_val = 0;
|
||||
|
|
@ -458,7 +458,7 @@ static snd_pcm_sframes_t snd_pcm_adpcm_write_areas(snd_pcm_t *pcm,
|
|||
snd_pcm_uframes_t size,
|
||||
snd_pcm_uframes_t *slave_sizep)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
snd_pcm_t *slave = adpcm->plug.slave;
|
||||
snd_pcm_uframes_t xfer = 0;
|
||||
snd_pcm_sframes_t err = 0;
|
||||
|
|
@ -493,7 +493,7 @@ static snd_pcm_sframes_t snd_pcm_adpcm_read_areas(snd_pcm_t *pcm,
|
|||
snd_pcm_uframes_t size,
|
||||
snd_pcm_uframes_t *slave_sizep)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
snd_pcm_t *slave = adpcm->plug.slave;
|
||||
snd_pcm_uframes_t xfer = 0;
|
||||
snd_pcm_sframes_t err = 0;
|
||||
|
|
@ -524,7 +524,7 @@ static snd_pcm_sframes_t snd_pcm_adpcm_read_areas(snd_pcm_t *pcm,
|
|||
|
||||
static void snd_pcm_adpcm_dump(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private;
|
||||
snd_pcm_adpcm_t *adpcm = pcm->private_data;
|
||||
snd_output_printf(out, "Ima-ADPCM conversion PCM (%s)\n",
|
||||
snd_pcm_format_name(adpcm->sformat));
|
||||
if (pcm->setup) {
|
||||
|
|
@ -550,7 +550,7 @@ snd_pcm_ops_t snd_pcm_adpcm_ops = {
|
|||
munmap: snd_pcm_plugin_munmap,
|
||||
};
|
||||
|
||||
int snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
|
||||
int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
|
||||
{
|
||||
snd_pcm_t *pcm;
|
||||
snd_pcm_adpcm_t *adpcm;
|
||||
|
|
@ -583,7 +583,7 @@ int snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name, snd_pcm_format_t sformat, s
|
|||
pcm->op_arg = pcm;
|
||||
pcm->fast_ops = &snd_pcm_plugin_fast_ops;
|
||||
pcm->fast_op_arg = pcm;
|
||||
pcm->private = adpcm;
|
||||
pcm->private_data = adpcm;
|
||||
pcm->poll_fd = slave->poll_fd;
|
||||
pcm->hw_ptr = &adpcm->plug.hw_ptr;
|
||||
pcm->appl_ptr = &adpcm->plug.appl_ptr;
|
||||
|
|
@ -592,16 +592,16 @@ int snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name, snd_pcm_format_t sformat, s
|
|||
return 0;
|
||||
}
|
||||
|
||||
int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name,
|
||||
int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
|
||||
snd_config_t *conf,
|
||||
snd_pcm_stream_t stream, int mode)
|
||||
{
|
||||
snd_config_iterator_t i;
|
||||
snd_config_iterator_t i, next;
|
||||
const char *sname = NULL;
|
||||
int err;
|
||||
snd_pcm_t *spcm;
|
||||
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
|
||||
snd_config_foreach(i, conf) {
|
||||
snd_config_for_each(i, next, conf) {
|
||||
snd_config_t *n = snd_config_iterator_entry(i);
|
||||
const char *id = snd_config_get_id(n);
|
||||
if (strcmp(id, "comment") == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue