Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

pa_operation* pa_context_get_card_info_by_index ( pa_context c,
uint32_t  idx,
pa_card_info_cb_t  cb,
void *  userdata 
)

Get information about a card by its index

Since:
0.9.15

Definition at line 786 of file introspect.c.

References PA_CONTEXT_READY, PA_ERR_BADSTATE, PA_ERR_FORKED, PA_ERR_INVALID, PA_ERR_NOTSUPPORTED, and PA_INVALID_INDEX.

                                                                                                                   {
    pa_tagstruct *t;
    pa_operation *o;
    uint32_t tag;

    pa_assert(c);
    pa_assert(PA_REFCNT_VALUE(c) >= 1);
    pa_assert(cb);

    PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
    PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15, PA_ERR_NOTSUPPORTED);

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

    t = pa_tagstruct_command(c, PA_COMMAND_GET_CARD_INFO, &tag);
    pa_tagstruct_putu32(t, idx);
    pa_tagstruct_puts(t, NULL);
    pa_pstream_send_tagstruct(c->pstream, t);
    pa_pdispatch_register_reply(c->pdispatch, tag, DEFAULT_TIMEOUT, context_get_card_info_callback, pa_operation_ref(o), (pa_free_cb_t) pa_operation_unref);

    return o;
}

Generated by  Doxygen 1.6.0   Back to index