<s> from __future__ import absolute_import , unicode_literals <EOL> import logging <EOL> import pykka <EOL> from mopidy import mixer <EOL> logger = logging . getLogger ( __name__ ) <EOL> class SoftwareMixer ( pykka . ThreadingActor , mixer . Mixer ) : <EOL> name = '<STR_LIT>' <EOL> def __init__ ( self , config ) : <EOL> super ( SoftwareMixer , self ) . __init__ ( config ) <EOL> self . _audio_mixer = None <EOL> self . _initial_volume = None <EOL> self . _initial_mute = None <EOL> def setup ( self , mixer_ref ) : <EOL> self . _audio_mixer = mixer_ref <EOL> if self . _initial_volume is not None : <EOL> self . set_volume ( self . _initial_volume ) <EOL> if self . _initial_mute is not None : <EOL> self . set_mute ( self . _initial_mute ) <EOL> def teardown ( self ) : <EOL> self . _audio_mixer = None <EOL> def get_volume ( self ) : <EOL> if self . _audio_mixer is None : <EOL> return None <EOL> return self . _audio_mixer . get_volume ( ) . get ( ) <EOL> def set_volume ( self , volume ) : <EOL> if self . _audio_mixer is None : <EOL> self . _initial_volume = volume <EOL> return False <EOL> self . _audio_mixer . set_volume ( volume ) <EOL> return True <EOL> def get_mute ( self ) : <EOL> if self . _audio_mixer is None : <EOL> return None <EOL> return self . _audio_mixer . get_mute ( ) . get ( ) <EOL> def set_mute ( self , mute ) : <EOL> if self . _audio_mixer is None : <EOL> self . _initial_mute = mute <EOL> return False <EOL> self . _audio_mixer . set_mute ( mute ) <EOL> return True </s>
