/* Loop through all sinks and check to see if we have *any*
* sinks. Ignore the sink passed in (if it's not null) */
- for (target = pa_idxset_first(c->sinks, &idx); target; target = pa_idxset_next(c->sinks, &idx))
+ PA_IDXSET_FOREACH(target, c->sinks, idx)
if (!sink || target != sink)
break;
pa_log_info("Successfully opened database file '%s'.", fname);
pa_xfree(fname);
- for (card = pa_idxset_first(m->core->cards, &idx); card; card = pa_idxset_next(m->core->cards, &idx))
+ PA_IDXSET_FOREACH(card, m->core->cards, idx)
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, card->index, u);
pa_modargs_free(ma);
pa_assert(u);
- for (c = pa_idxset_first(u->subscribed, &idx); c; c = pa_idxset_next(u->subscribed, &idx)) {
+ PA_IDXSET_FOREACH(c, u->subscribed, idx) {
pa_tagstruct *t;
t = pa_tagstruct_new(NULL, 0);
uint32_t idx;
if (sink_idx != PA_INVALID_INDEX) {
- for (c = pa_idxset_first(u->subscribed, &idx); c; c = pa_idxset_next(u->subscribed, &idx)) {
+ PA_IDXSET_FOREACH(c, u->subscribed, idx) {
pa_tagstruct *t;
t = pa_tagstruct_new(NULL, 0);
pa_log_info("Successfully opened database file '%s'.", fname);
pa_xfree(fname);
- for (sink = pa_idxset_first(m->core->sinks, &idx); sink; sink = pa_idxset_next(m->core->sinks, &idx))
+ PA_IDXSET_FOREACH(sink, m->core->sinks, idx)
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_NEW, sink->index, u);
- for (source = pa_idxset_first(m->core->sources, &idx); source; source = pa_idxset_next(m->core->sources, &idx))
+ PA_IDXSET_FOREACH(source, m->core->sources, idx)
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_NEW, source->index, u);
pa_modargs_free(ma);
pa_native_connection *c;
uint32_t idx;
- for (c = pa_idxset_first(u->subscribed, &idx); c; c = pa_idxset_next(u->subscribed, &idx)) {
+ PA_IDXSET_FOREACH(c, u->subscribed, idx) {
pa_tagstruct *t;
t = pa_tagstruct_new(NULL, 0);
u->timeout = timeout;
u->device_infos = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
- for (sink = pa_idxset_first(m->core->sinks, &idx); sink; sink = pa_idxset_next(m->core->sinks, &idx))
+ PA_IDXSET_FOREACH(sink, m->core->sinks, idx)
device_new_hook_cb(m->core, PA_OBJECT(sink), u);
- for (source = pa_idxset_first(m->core->sources, &idx); source; source = pa_idxset_next(m->core->sources, &idx))
+ PA_IDXSET_FOREACH(source, m->core->sources, idx)
device_new_hook_cb(m->core, PA_OBJECT(source), u);
u->sink_new_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_PUT], PA_HOOK_NORMAL, (pa_hook_cb_t) device_new_hook_cb, u);