private void updateGainComponents(GainMode mode){
switch (mode) {
case LINEARITY:
    if (!mMasterGain.isEnabled()) {
      mMasterGain.setEnabled(true);
      mMasterGainValueLabel.setEnabled(true);
    }
  if (mIFGain.isEnabled()) {
    mIFGain.setEnabled(false);
    mIFGainValueLabel.setEnabled(false);
  }
if (mLNAGain.isEnabled()) {
  mLNAAGC.setEnabled(false);
  mLNAGainValueLabel.setEnabled(false);
  mLNAGain.setEnabled(false);
}
if (mMixerGain.isEnabled()) {
mMixerGainValueLabel.setEnabled(false);
mMixerAGC.setEnabled(false);
mMixerGain.setEnabled(false);
}
break;
case SENSITIVITY:
if (!mMasterGain.isEnabled()) {
mMasterGain.setEnabled(true);
mMasterGainValueLabel.setEnabled(true);
}
if (mIFGain.isEnabled()) {
mIFGain.setEnabled(false);
mIFGainValueLabel.setEnabled(false);
}
if (mLNAGain.isEnabled()) {
mLNAAGC.setEnabled(false);
mLNAGainValueLabel.setEnabled(false);
mLNAGain.setEnabled(false);
}
if (mMixerGain.isEnabled()) {
mMixerGainValueLabel.setEnabled(false);
mMixerAGC.setEnabled(false);
mMixerGain.setEnabled(false);
}
break;
case CUSTOM:
if (mMasterGain.isEnabled()) {
mMasterGain.setEnabled(false);
mMasterGainValueLabel.setEnabled(false);
}
if (!mIFGain.isEnabled()) {
mIFGain.setEnabled(true);
mIFGainValueLabel.setEnabled(true);
}
if (!mLNAGain.isEnabled()) {
mLNAAGC.setEnabled(true);
mLNAGainValueLabel.setEnabled(true);
mLNAGain.setEnabled(true);
}
if (!mMixerGain.isEnabled()) {
mMixerGainValueLabel.setEnabled(true);
mMixerAGC.setEnabled(true);
mMixerGain.setEnabled(true);
}
default :
break;
}
}

private void updateGainComponents ( GainMode mode ) { switch ( mode ) { case LINEARITY : if ( ! mMasterGain . isEnabled ( ) ) { mMasterGain . setEnabled ( true ) ; mMasterGainValueLabel . setEnabled ( true ) ; } if ( mIFGain . isEnabled ( ) ) { mIFGain . setEnabled ( false ) ; mIFGainValueLabel . setEnabled ( false ) ; } if ( mLNAGain . isEnabled ( ) ) { mLNAAGC . setEnabled ( false ) ; mLNAGainValueLabel . setEnabled ( false ) ; mLNAGain . setEnabled ( false ) ; } if ( mMixerGain . isEnabled ( ) ) { mMixerGainValueLabel . setEnabled ( false ) ; mMixerAGC . setEnabled ( false ) ; mMixerGain . setEnabled ( false ) ; } break ; case SENSITIVITY : if ( ! mMasterGain . isEnabled ( ) ) { mMasterGain . setEnabled ( true ) ; mMasterGainValueLabel . setEnabled ( true ) ; } if ( mIFGain . isEnabled ( ) ) { mIFGain . setEnabled ( false ) ; mIFGainValueLabel . setEnabled ( false ) ; } if ( mLNAGain . isEnabled ( ) ) { mLNAAGC . setEnabled ( false ) ; mLNAGainValueLabel . setEnabled ( false ) ; mLNAGain . setEnabled ( false ) ; } if ( mMixerGain . isEnabled ( ) ) { mMixerGainValueLabel . setEnabled ( false ) ; mMixerAGC . setEnabled ( false ) ; mMixerGain . setEnabled ( false ) ; } break ; case CUSTOM : if ( mMasterGain . isEnabled ( ) ) { mMasterGain . setEnabled ( false ) ; mMasterGainValueLabel . setEnabled ( false ) ; } if ( ! mIFGain . isEnabled ( ) ) { mIFGain . setEnabled ( true ) ; mIFGainValueLabel . setEnabled ( true ) ; } if ( ! mLNAGain . isEnabled ( ) ) { mLNAAGC . setEnabled ( true ) ; mLNAGainValueLabel . setEnabled ( true ) ; mLNAGain . setEnabled ( true ) ; } if ( ! mMixerGain . isEnabled ( ) ) { mMixerGainValueLabel . setEnabled ( true ) ; mMixerAGC . setEnabled ( true ) ; mMixerGain . setEnabled ( true ) ; } default : break ; } }
updates the enabled state of each of the gain controls according to the specified gain mode . the master gain control is enabled for linearity and sensitivity and the individual gain controls are disabled , and vice - versa for custom mode .
