def _change_volume(self, step=None, value=None): if step is not None: volume = sound.get_volume() + step elif value is not None: volume = value volume = min(max(0, volume), _VOLUME_MAX) sound.set_volume(volume) sound.set_muted(volume == 0)
def _set_muted(self, mute): sound.set_muted(mute)
def handle_volume_mute(self, event_time): if sound.get_muted() is True: sound.set_muted(False) else: sound.set_muted(True)