/*** Sink input ***/ static void sink_input_info_cb(pa_context *ctx, const pa_sink_input_info *i, int eol, void *userdata) { audio_output_t *aout = userdata; aout_sys_t *sys = aout->sys; if (eol) return; (void) ctx; sys->cvolume = i->volume; /* cache volume for balance preservation */ VolumeReport(aout); aout_MuteReport(aout, i->mute); }
static void stream_moved_cb(pa_stream *s, void *userdata) { audio_output_t *aout = userdata; aout_sys_t *sys = aout->sys; const char *name = pa_stream_get_device_name(s); struct sink *sink = sink_find(sys, pa_stream_get_device_index(s)); msg_Dbg(aout, "connected to sink %s", name); aout_DeviceReport(aout, name); sys->base_volume = likely(sink != NULL) ? sink->base_volume : PA_VOLUME_INVALID; msg_Dbg(aout, "base volume: %"PRIu32, sys->base_volume); if (pa_cvolume_valid(&sys->cvolume)) VolumeReport(aout); }