mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
Major change to sequencer API.
The sequencer API is totally recoded with the style of "encapsulation" in other api. The structure becomes opaque and accessed only via functions. Other changes: - There is no longer group in client and port info. - snd_seq_query_subs_t is renamed to snd_seq_query_subscribe_t. - snd_seq_delete_port takes only the port id argument instead of port_info structure. - snd_seq_input/output_buffer_size are renamed as snd_seq_get_input/output_buffer_size. Similarly snd_seq_resize_input/output_buffer are renamed as snd_seq_set_input/output_buffer_size. - snd_seq_get_named_queue is renamed to snd_seq_query_named_queue. - Sync codes are removed temporarily from API. - Subscription conditions are accessed via the corresponding functions. convert_time is named now as time_update. - snd_seq_get/set_queue_owner are removed. Use snd_seq_get/set_queue_info instead. - Instrument put/get/remove structure is unified as snd_instr_header_t.
This commit is contained in:
parent
d23ff765ad
commit
88e5e45151
20 changed files with 4410 additions and 1691 deletions
|
|
@ -740,11 +740,10 @@ static int copy_env_to_stream(iwffff_xenv_t *xenv, iwffff_env_t *env, __u32 styp
|
|||
|
||||
int snd_instr_iwffff_conv_to_stream(snd_instr_iwffff_t *iwffff,
|
||||
const char *name,
|
||||
snd_seq_instr_put_t **__data,
|
||||
snd_instr_header_t **__data,
|
||||
long *__size)
|
||||
{
|
||||
snd_seq_instr_put_t *put;
|
||||
snd_seq_instr_data_t *data;
|
||||
snd_instr_header_t *put;
|
||||
int size;
|
||||
char *ptr;
|
||||
iwffff_instrument_t *instr;
|
||||
|
|
@ -759,19 +758,16 @@ int snd_instr_iwffff_conv_to_stream(snd_instr_iwffff_t *iwffff,
|
|||
instr = (iwffff_instrument_t *)iwffff;
|
||||
*__data = NULL;
|
||||
*__size = 0;
|
||||
size = sizeof(*data) + iwffff_size(iwffff);
|
||||
put = (snd_seq_instr_put_t *)malloc(sizeof(*put) + size);
|
||||
if (put == NULL)
|
||||
size = iwffff_size(iwffff);
|
||||
if (snd_instr_header_malloc(&put, size) < 0)
|
||||
return -ENOMEM;
|
||||
/* build header */
|
||||
memset(put, 0, sizeof(*put));
|
||||
data = &put->data;
|
||||
if (name)
|
||||
strncpy(data->name, name, sizeof(data->name)-1);
|
||||
data->type = SND_SEQ_INSTR_ATYPE_DATA;
|
||||
strcpy(data->data.format, SND_SEQ_INSTR_ID_INTERWAVE);
|
||||
snd_instr_header_set_name(put, name);
|
||||
snd_instr_header_set_type(put, SND_SEQ_INSTR_ATYPE_DATA);
|
||||
snd_instr_header_set_format(put, SND_SEQ_INSTR_ID_INTERWAVE);
|
||||
/* build data section */
|
||||
xinstr = (iwffff_xinstrument_t *)(data + 1);
|
||||
xinstr = (iwffff_xinstrument_t *)snd_instr_header_get_data(put);
|
||||
xinstr->stype = IWFFFF_STRU_INSTR;
|
||||
xinstr->exclusion = __cpu_to_le16(instr->exclusion);
|
||||
xinstr->layer_type = __cpu_to_le16(instr->layer_type);
|
||||
|
|
@ -827,11 +823,11 @@ int snd_instr_iwffff_conv_to_stream(snd_instr_iwffff_t *iwffff,
|
|||
}
|
||||
/* write result */
|
||||
*__data = put;
|
||||
*__size = size;
|
||||
*__size = sizeof(*put) + size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_instr_iwffff_convert_from_stream(snd_seq_instr_get_t *data ATTRIBUTE_UNUSED,
|
||||
int snd_instr_iwffff_convert_from_stream(snd_instr_header_t *data ATTRIBUTE_UNUSED,
|
||||
size_t size ATTRIBUTE_UNUSED,
|
||||
snd_instr_iwffff_t **iwffff ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue