def sink_info_cb(self, context, sink_info_p, _, __):
if sink_info_p:<EOL><INDENT>sink_info = sink_info_p.contents<EOL>volume_percent = round(<NUM_LIT:100> * sink_info.volume.values[<NUM_LIT:0>] / <NUM_LIT>)<EOL>volume_db = pa_sw_volume_to_dB(sink_info.volume.values[<NUM_LIT:0>])<EOL>self.currently_muted = sink_info.mute<EOL>if volume_db == float('<STR_LIT>'):<EOL><INDENT>volume_db = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>volume_db = int(volume_db)<EOL><DEDENT>muted = self.muted if sink_info.mute else self.unmuted<EOL>if self.multi_colors and not sink_info.mute:<EOL><INDENT>color = self.get_gradient(volume_percent, self.colors)<EOL><DEDENT>else:<EOL><INDENT>color = self.color_muted if sink_info.mute else self.color_unmuted<EOL><DEDENT>if muted and self.format_muted is not None:<EOL><INDENT>output_format = self.format_muted<EOL><DEDENT>else:<EOL><INDENT>output_format = self.format<EOL><DEDENT>if self.bar_type == '<STR_LIT>':<EOL><INDENT>volume_bar = make_vertical_bar(volume_percent, self.vertical_bar_width)<EOL><DEDENT>elif self.bar_type == '<STR_LIT>':<EOL><INDENT>volume_bar = make_bar(volume_percent)<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>selected = "<STR_LIT>"<EOL>dump = subprocess.check_output("<STR_LIT>".split(), universal_newlines=True)<EOL>for line in dump.split("<STR_LIT:\n>"):<EOL><INDENT>if line.startswith("<STR_LIT>"):<EOL><INDENT>default_sink = line.split()[<NUM_LIT:1>]<EOL>if default_sink == self.current_sink:<EOL><INDENT>selected = self.format_selected<EOL><DEDENT><DEDENT><DEDENT>self.output = {<EOL>"<STR_LIT>": color,<EOL>"<STR_LIT>": output_format.format(<EOL>muted=muted,<EOL>volume=volume_percent,<EOL>db=volume_db,<EOL>volume_bar=volume_bar,<EOL>selected=selected),<EOL>}<EOL>self.send_output()<EOL><DEDENT>
Updates self.output