PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_LOAD_ONCE(TRUE);
PA_MODULE_USAGE(
+ "do_routing=<Automatically route streams based on a priority list (unique per-role)?> "
"on_hotplug=<When new device becomes available, recheck streams?> "
"on_rescue=<When device becomes unavailable, recheck streams?>");
#define SAVE_INTERVAL (10 * PA_USEC_PER_SEC)
static const char* const valid_modargs[] = {
+ "do_routing",
"on_hotplug",
"on_rescue",
NULL
pa_bool_t on_hotplug;
pa_bool_t on_rescue;
- pa_bool_t role_device_priority_routing;
+ pa_bool_t do_routing;
};
#define ENTRY_VERSION 1
pa_assert(new_data);
pa_assert(u);
- if (!u->role_device_priority_routing)
+ if (!u->do_routing)
return PA_HOOK_OK;
if (new_data->sink)
pa_assert(new_data);
pa_assert(u);
- if (!u->role_device_priority_routing)
+ if (!u->do_routing)
return PA_HOOK_OK;
if (new_data->direct_on_input)
pa_assert(u);
- if (!u->role_device_priority_routing)
+ if (!u->do_routing)
return PA_HOOK_OK;
pa_assert_se(indexes = get_highest_priority_device_indexes(u, "sink:"));
if (si->save_sink)
continue;
- /* Skip this if it is already in the process of being moved
- * anyway */
+ /* Skip this if it is already in the process of being moved anyway */
if (!si->sink)
continue;
pa_assert(u);
- if (!u->role_device_priority_routing)
+ if (!u->do_routing)
return PA_HOOK_OK;
pa_assert_se(indexes = get_highest_priority_device_indexes(u, "source:"));
if (so->direct_on_input)
continue;
- /* Skip this if it is already in the process of being moved
- * anyway */
+ /* Skip this if it is already in the process of being moved anyway */
if (!so->source)
continue;
if (pa_tagstruct_get_boolean(t, &enable) < 0)
goto fail;
- u->role_device_priority_routing = enable;
+ u->do_routing = enable;
break;
}
pa_sink_input *si;
pa_source_output *so;
uint32_t idx;
- pa_bool_t on_hotplug = TRUE, on_rescue = TRUE;
+ pa_bool_t do_routing = FALSE, on_hotplug = TRUE, on_rescue = TRUE;
pa_assert(m);
goto fail;
}
- if (pa_modargs_get_value_boolean(ma, "on_hotplug", &on_hotplug) < 0 ||
+ if (pa_modargs_get_value_boolean(ma, "do_routing", &do_routing) < 0 ||
+ pa_modargs_get_value_boolean(ma, "on_hotplug", &on_hotplug) < 0 ||
pa_modargs_get_value_boolean(ma, "on_rescue", &on_rescue) < 0) {
pa_log("on_hotplug= and on_rescue= expect boolean arguments");
goto fail;
m->userdata = u = pa_xnew0(struct userdata, 1);
u->core = m->core;
u->module = m;
+ u->do_routing = do_routing;
u->on_hotplug = on_hotplug;
u->on_rescue = on_rescue;
u->subscribed = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);