Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_operation* pa_ext_stream_restore_write ( pa_context c,
pa_update_mode_t  mode,
const pa_ext_stream_restore_info  data[],
unsigned  n,
int  apply_immediately,
pa_context_success_cb_t  cb,
void *  userdata 
)

Store entries in the stream database.

Since:
0.9.12

Definition at line 184 of file ext-stream-restore.c.

References pa_ext_stream_restore_info::channel_map, pa_ext_stream_restore_info::device, pa_ext_stream_restore_info::mute, pa_ext_stream_restore_info::name, PA_CONTEXT_READY, PA_ERR_BADSTATE, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX, and pa_ext_stream_restore_info::volume.

                        {

    uint32_t tag;
    pa_operation *o;
    pa_tagstruct *t;

    pa_assert(c);
    pa_assert(PA_REFCNT_VALUE(c) >= 1);
    pa_assert(mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE || mode == PA_UPDATE_SET);
    pa_assert(data);

    PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 14, PA_ERR_NOTSUPPORTED);

    o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);

    t = pa_tagstruct_command(c, PA_COMMAND_EXTENSION, &tag);
    pa_tagstruct_putu32(t, PA_INVALID_INDEX);
    pa_tagstruct_puts(t, "module-stream-restore");
    pa_tagstruct_putu32(t, SUBCOMMAND_WRITE);

    pa_tagstruct_putu32(t, mode);
    pa_tagstruct_put_boolean(t, apply_immediately);

    for (; n > 0; n--, data++) {
        pa_tagstruct_puts(t, data->name);
        pa_tagstruct_put_channel_map(t, &data->channel_map);
        pa_tagstruct_put_cvolume(t, &data->volume);
        pa_tagstruct_puts(t, data->device);
        pa_tagstruct_put_boolean(t, data->mute);
    }

    pa_pstream_send_tagstruct(c->pstream, t);
    pa_pdispatch_register_reply(c->pdispatch, tag, DEFAULT_TIMEOUT, pa_context_simple_ack_callback, pa_operation_ref(o), (pa_free_cb_t) pa_operation_unref);

    return o;
}


Generated by  Doxygen 1.6.0   Back to index