def value_changed(widget): print "DEBUG value_changed", widget.value index = pypulse.get_fallback_sink_index() if index is None: return value = widget.get_value() channel_num = pypulse.output_channels[index]['channels'] balance = pypulse.get_volume_balance(channel_num, [int(value)], pypulse.output_channels[index]['map']) #pypulse.PULSE.set_output_volume(index, [value]*channel_num, channel_num) pypulse.PULSE.set_output_volume_with_balance(index, int(value), balance, channel_num, pypulse.output_channels[index]['map'])
def value_changed(widget): print "DEBUG value_changed", widget.value index = pypulse.get_fallback_sink_index() if index is None: return value = widget.get_value() channel_num = pypulse.output_channels[index]['channels'] balance = pypulse.get_volume_balance(channel_num, [int(value)], pypulse.output_channels[index]['map']) #pypulse.PULSE.set_output_volume(index, [value]*channel_num, channel_num) pypulse.PULSE.set_output_volume_with_balance( index, int(value), balance, channel_num, pypulse.output_channels[index]['map'])
def speaker_value_changed_thread(self): ''' speaker hscale value changed callback thread''' if not self.speaker_mute_button.get_active(): self.speaker_mute_button.set_active(True) current_sink = self.__fallback_sink_index if current_sink is None: return volume_list = pypulse.output_volumes[current_sink] channel_list = pypulse.output_channels[current_sink] if not volume_list or not channel_list: return balance = pypulse.get_volume_balance(channel_list['channels'], volume_list, channel_list['map']) volume = int((self.speaker_scale.get_value()) / 100.0 * pypulse.NORMAL_VOLUME_VALUE) pypulse.PULSE.set_output_volume_with_balance(current_sink, volume, balance, channel_list['channels'], channel_list['map'])