Lines Matching defs:sink

46 #include <pulsecore/sink.h>
269 if (0 == strncmp("sink:", name, 5)) {
270 pa_sink *sink;
272 if ((sink = pa_namereg_get(u->core, name+5, PA_NAMEREG_SINK))) {
605 pa_sink *sink;
607 if (!(sink = pa_idxset_get_by_index(c->sinks, idx)))
611 name = pa_sprintf_malloc("sink:%s", sink->name);
612 if (sink->active_port)
613 port = sink->active_port->name;
620 if (sink->save_port) {
631 if (sink->save_volume) {
632 ppe->channel_map = sink->channel_map;
633 ppe->volume = *pa_sink_get_volume(sink, false);
637 if (sink->save_muted) {
638 ppe->muted = pa_sink_get_mute(sink, false);
736 name = pa_sprintf_malloc("sink:%s", new_data->name);
742 pa_log_info("Restoring port '%s' for sink %s.", pa_strnull(e->port), name);
746 pa_log_debug("Not restoring port for sink %s, because already set.", name);
766 name = pa_sprintf_malloc("sink:%s", new_data->name);
779 pa_log_info("Restoring volume for sink %s: %s", new_data->name,
784 pa_log_debug("Not restoring volume for sink %s, because already set.", new_data->name);
792 pa_log_info("Restoring mute state for sink %s: %smuted", new_data->name,
795 pa_log_debug("Not restoring mute state for sink %s, because already set.", new_data->name);
806 static pa_hook_result_t sink_port_hook_callback(pa_core *c, pa_sink *sink, struct userdata *u) {
811 pa_assert(sink);
815 name = pa_sprintf_malloc("sink:%s", sink->name);
817 if ((e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL)))) {
822 pa_log_info("Restoring volume for sink %s.", sink->name);
824 pa_cvolume_remap(&v, &e->channel_map, &sink->channel_map);
825 pa_sink_set_volume(sink, &v, true, false);
827 sink->save_volume = true;
832 pa_log_info("Restoring mute state for sink %s.", sink->name);
833 pa_sink_set_mute(sink, e->muted, false);
834 sink->save_muted = true;
845 static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, struct userdata *u) {
850 pa_assert(sink);
854 name = pa_sprintf_malloc("sink:%s", sink->name);
856 if ((e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL)))) {
858 if (!pa_sink_set_formats(sink, e->formats))
859 pa_log_debug("Could not set format on sink %s", sink->name);
989 static void read_sink_format_reply(struct userdata *u, pa_tagstruct *reply, pa_sink *sink) {
995 pa_assert(sink);
998 pa_tagstruct_putu32(reply, sink->index);
1001 name = pa_sprintf_malloc("sink:%s", sink->name);
1002 if (!(e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL)))) {
1070 pa_sink *sink;
1076 PA_IDXSET_FOREACH(sink, u->core->sinks, idx) {
1077 read_sink_format_reply(u, reply, sink);
1085 pa_sink *sink;
1089 /* Get the sink index and the number of formats from the tagstruct */
1102 /* Now find our sink */
1103 if (!(sink = pa_idxset_get_by_index(u->core->sinks, sink_index)))
1106 read_sink_format_reply(u, reply, sink);
1117 pa_sink *sink;
1120 /* Get the sink index and the number of formats from the tagstruct */
1133 /* Now find our sink */
1134 if (!(sink = pa_idxset_get_by_index(u->core->sinks, sink_index))) {
1135 pa_log("Could not find sink #%d", sink_index);
1140 name = pa_sprintf_malloc("sink:%s", sink->name);
1141 if (!(e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL))))
1167 if (pa_sink_set_formats(sink, e->formats) && perportentry_write(u, name, (sink->active_port ? sink->active_port->name : NULL), e))
1170 pa_log_warn("Could not save format info for sink %s", sink->name);
1206 pa_sink *sink;
1272 PA_IDXSET_FOREACH(sink, m->core->sinks, idx)
1273 subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_NEW, sink->index, u);