diff --git a/lib/installer-exclude/libjitsi.jar b/lib/installer-exclude/libjitsi.jar index 7095f7c50..651e13eca 100644 Binary files a/lib/installer-exclude/libjitsi.jar and b/lib/installer-exclude/libjitsi.jar differ diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties index 4db6e0ecf..c9f20bfc4 100644 --- a/resources/languages/resources.properties +++ b/resources/languages/resources.properties @@ -1420,6 +1420,7 @@ impl.media.configform.AUDIO=&Audio System: impl.media.configform.AUDIO_IN=Audio &In: impl.media.configform.AUDIO_NOTIFY=&Notifications: impl.media.configform.AUDIO_OUT=Audio &Out: +impl.media.configform.AUTOMATICGAINCONTROL=Automatic gain control impl.media.configform.DENOISE=Enable noise suppression impl.media.configform.DEVICES=Devices impl.media.configform.DOWN=&Down diff --git a/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java b/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java index 563c0dc82..a0b2d9f05 100644 --- a/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java @@ -991,54 +991,75 @@ public void createAudioSystemControls( container.add(notifyCombo, cnstrnts); } - if ((AudioSystem.FEATURE_ECHO_CANCELLATION & audioSystemFeatures) != 0) - { - final SIPCommCheckBox echoCancelCheckBox - = new SIPCommCheckBox( - NeomediaActivator.getResources().getI18NString( - "impl.media.configform.ECHOCANCEL")); - - /* - * First set the selected one, then add the listener in order to - * avoid saving the value when using the default one and only - * showing to user without modification. - */ - echoCancelCheckBox.setSelected(audioSystem.isEchoCancel()); - echoCancelCheckBox.addItemListener( - new ItemListener() + int[] checkBoxAudioSystemFeatures + = new int[] { - public void itemStateChanged(ItemEvent e) - { - audioSystem.setEchoCancel( - echoCancelCheckBox.isSelected()); - } - }); - container.add(echoCancelCheckBox, cnstrnts); - } + AudioSystem.FEATURE_ECHO_CANCELLATION, + AudioSystem.FEATURE_DENOISE, + AudioSystem.FEATURE_AGC + }; - if ((AudioSystem.FEATURE_DENOISE & audioSystemFeatures) != 0) + for (int i = 0; i < checkBoxAudioSystemFeatures.length; i++) { - final SIPCommCheckBox denoiseCheckBox - = new SIPCommCheckBox( - NeomediaActivator.getResources().getI18NString( - "impl.media.configform.DENOISE")); + final int f = checkBoxAudioSystemFeatures[i]; - /* - * First set the selected one, then add the listener in order to - * avoid saving the value when using the default one and only - * showing to user without modification. - */ - denoiseCheckBox.setSelected(audioSystem.isDenoise()); - denoiseCheckBox.addItemListener( - new ItemListener() - { - public void itemStateChanged(ItemEvent e) + if ((f & audioSystemFeatures) != 0) + { + String textKey; + boolean selected; + + switch (f) + { + case AudioSystem.FEATURE_AGC: + textKey = "impl.media.configform.AUTOMATICGAINCONTROL"; + selected = audioSystem.isAutomaticGainControl(); + break; + case AudioSystem.FEATURE_DENOISE: + textKey = "impl.media.configform.DENOISE"; + selected = audioSystem.isDenoise(); + break; + case AudioSystem.FEATURE_ECHO_CANCELLATION: + textKey = "impl.media.configform.ECHOCANCEL"; + selected = audioSystem.isEchoCancel(); + break; + default: + continue; + } + + final SIPCommCheckBox checkBox + = new SIPCommCheckBox( + NeomediaActivator.getResources().getI18NString( + textKey)); + + /* + * First set the selected one, then add the listener in order to + * avoid saving the value when using the default one and only + * showing to user without modification. + */ + checkBox.setSelected(selected); + checkBox.addItemListener( + new ItemListener() { - audioSystem.setDenoise( - denoiseCheckBox.isSelected()); - } - }); - container.add(denoiseCheckBox, cnstrnts); + public void itemStateChanged(ItemEvent e) + { + boolean b = checkBox.isSelected(); + + switch (f) + { + case AudioSystem.FEATURE_AGC: + audioSystem.setAutomaticGainControl(b); + break; + case AudioSystem.FEATURE_DENOISE: + audioSystem.setDenoise(b); + break; + case AudioSystem.FEATURE_ECHO_CANCELLATION: + audioSystem.setEchoCancel(b); + break; + } + } + }); + container.add(checkBox, cnstrnts); + } } // Adds the play buttons for testing playback and notification devices. @@ -1583,7 +1604,8 @@ private Component createPreview( != mediaServiceDeviceConfigurationAudioSystem) { logger.warn( - "JComboBox.selectedItem is not identical to MediaService.deviceConfiguration.audioSystem!"); + "JComboBox.selectedItem is not identical to" + + " MediaService.deviceConfiguration.audioSystem!"); } } } @@ -1616,7 +1638,8 @@ private Component createPreview( { String noAvailableAudioDevice = NeomediaActivator.getResources().getI18NString( - "impl.media.configform.NO_AVAILABLE_AUDIO_DEVICE"); + "impl.media.configform" + + ".NO_AVAILABLE_AUDIO_DEVICE"); preview = new TransparentPanel(new GridBagLayout()); preview.add(new JLabel(noAvailableAudioDevice));