diff options
author | Mikel Astiz <mikel.astiz@bmw-carit.de> | 2013-02-18 16:13:24 +0100 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2013-02-18 17:25:53 +0200 |
commit | 8851644a3c76cf29c8244a19446781cfa1943763 (patch) | |
tree | 2d820f2b25b803410e36096d13fd72776a705b09 /src/modules/module-switch-on-port-available.c | |
parent | 3aefdd995ca2cb13c75bb2b95d99c970172b1e19 (diff) | |
download | pulseaudio-8851644a3c76cf29c8244a19446781cfa1943763.tar.gz |
core: Internally deprecate pa_port_available_t to use pa_available_t
Generalize the availability flag in order to be used beyond the scope of
ports.
However, pa_port_availability_t is left unchanged to avoid modifying the
protocol and the client API. This should be replaced by pa_available_t
after a validation phase of this new generic enum type.
Diffstat (limited to 'src/modules/module-switch-on-port-available.c')
-rw-r--r-- | src/modules/module-switch-on-port-available.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c index 1da612d56..9b2029b64 100644 --- a/src/modules/module-switch-on-port-available.c +++ b/src/modules/module-switch-on-port-available.c @@ -40,8 +40,8 @@ static pa_device_port* find_best_port(pa_hashmap *ports) { PA_HASHMAP_FOREACH(port, ports, state) { if (result == NULL || - result->available == PA_PORT_AVAILABLE_NO || - (port->available != PA_PORT_AVAILABLE_NO && port->priority > result->priority)) { + result->available == PA_AVAILABLE_NO || + (port->available != PA_AVAILABLE_NO && port->priority > result->priority)) { result = port; } } @@ -85,7 +85,7 @@ static pa_bool_t try_to_switch_profile(pa_card *card, pa_device_port *port) { PA_IDXSET_FOREACH(sink, card->sinks, state2) { if (!sink->active_port) continue; - if (sink->active_port->available != PA_PORT_AVAILABLE_NO) + if (sink->active_port->available != PA_AVAILABLE_NO) found_active_port = TRUE; } @@ -136,7 +136,7 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port pa_source *source; pa_bool_t is_active_profile, is_active_port; - if (port->available == PA_PORT_AVAILABLE_UNKNOWN) + if (port->available == PA_AVAILABLE_UNKNOWN) return PA_HOOK_OK; pa_log_debug("finding port %s", port->name); @@ -155,10 +155,10 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port is_active_profile = card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name); is_active_port = (sink && sink->active_port == port) || (source && source->active_port == port); - if (port->available == PA_PORT_AVAILABLE_NO && !is_active_port) + if (port->available == PA_AVAILABLE_NO && !is_active_port) return PA_HOOK_OK; - if (port->available == PA_PORT_AVAILABLE_YES) { + if (port->available == PA_AVAILABLE_YES) { if (is_active_port) return PA_HOOK_OK; @@ -178,11 +178,11 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port pa_sink_set_port(sink, port->name, FALSE); } - if (port->available == PA_PORT_AVAILABLE_NO) { + if (port->available == PA_AVAILABLE_NO) { if (sink) { pa_device_port *p2 = find_best_port(sink->ports); - if (p2 && p2->available != PA_PORT_AVAILABLE_NO) + if (p2 && p2->available != PA_AVAILABLE_NO) pa_sink_set_port(sink, p2->name, FALSE); else { /* Maybe try to switch to another profile? */ @@ -192,7 +192,7 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port if (source) { pa_device_port *p2 = find_best_port(source->ports); - if (p2 && p2->available != PA_PORT_AVAILABLE_NO) + if (p2 && p2->available != PA_AVAILABLE_NO) pa_source_set_port(source, p2->name, FALSE); else { /* Maybe try to switch to another profile? */ @@ -212,7 +212,7 @@ static void handle_all_unavailable(pa_core *core) { void *state2; PA_HASHMAP_FOREACH(port, card->ports, state2) { - if (port->available == PA_PORT_AVAILABLE_NO) + if (port->available == PA_AVAILABLE_NO) port_available_hook_callback(core, port, NULL); } } |