aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java
diff options
context:
space:
mode:
authorVincent Lucas <chenzo@jitsi.org>2012-10-15 22:08:52 +0000
committerVincent Lucas <chenzo@jitsi.org>2012-10-15 22:08:52 +0000
commit142764ebae8ba33d4959fc8c8c7c2bdac99bd53c (patch)
treed64a2a6b1a02a2f24d5d9d21d11447af7884162c /src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java
parent52680ff85f47f9e1e3b3a9d01f1125be187e4d30 (diff)
downloadjitsi-142764ebae8ba33d4959fc8c8c7c2bdac99bd53c.zip
jitsi-142764ebae8ba33d4959fc8c8c7c2bdac99bd53c.tar.gz
jitsi-142764ebae8ba33d4959fc8c8c7c2bdac99bd53c.tar.bz2
Improves sound device selection: automatically switches to new plugged device, remember user preferences in a list.
Diffstat (limited to 'src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java')
-rw-r--r--src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java b/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java
index 1130c82..9eb42da 100644
--- a/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java
+++ b/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java
@@ -223,26 +223,24 @@ public class DeviceConfigurationComboBoxModel
{
case AUDIO_CAPTURE:
audioSystem = deviceConfiguration.getAudioSystem();
- infos
- = (audioSystem == null)
+ infos = (audioSystem == null)
? null
- : audioSystem.getCaptureDevices();
+ : audioSystem.getDevices(AudioSystem.CAPTURE_INDEX);
break;
case AUDIO_NOTIFY:
audioSystem = deviceConfiguration.getAudioSystem();
- infos
- = (audioSystem == null) ? null : audioSystem.getNotifyDevices();
+ infos = (audioSystem == null)
+ ? null
+ : audioSystem.getDevices(AudioSystem.NOTIFY_INDEX);
break;
case AUDIO_PLAYBACK:
audioSystem = deviceConfiguration.getAudioSystem();
- infos
- = (audioSystem == null)
+ infos = (audioSystem == null)
? null
- : audioSystem.getPlaybackDevices();
+ : audioSystem.getDevices(AudioSystem.PLAYBACK_INDEX);
break;
case VIDEO:
- infos
- = deviceConfiguration.getAvailableVideoCaptureDevices(
+ infos = deviceConfiguration.getAvailableVideoCaptureDevices(
MediaUseCase.CALL);
break;
default:
@@ -273,20 +271,21 @@ public class DeviceConfigurationComboBoxModel
{
case AUDIO_CAPTURE:
audioSystem = deviceConfiguration.getAudioSystem();
- info
- = (audioSystem == null) ? null : audioSystem.getCaptureDevice();
+ info = (audioSystem == null)
+ ? null
+ : audioSystem.getDevice(AudioSystem.CAPTURE_INDEX);
break;
case AUDIO_NOTIFY:
audioSystem = deviceConfiguration.getAudioSystem();
- info
- = (audioSystem == null) ? null : audioSystem.getNotifyDevice();
+ info = (audioSystem == null)
+ ? null
+ : audioSystem.getDevice(AudioSystem.NOTIFY_INDEX);
break;
case AUDIO_PLAYBACK:
audioSystem = deviceConfiguration.getAudioSystem();
- info
- = (audioSystem == null)
- ? null
- : audioSystem.getPlaybackDevice();
+ info = (audioSystem == null)
+ ? null
+ : audioSystem.getDevice(AudioSystem.PLAYBACK_INDEX);
break;
case VIDEO:
info = deviceConfiguration.getVideoCaptureDevice(MediaUseCase.ANY);
@@ -354,17 +353,26 @@ public class DeviceConfigurationComboBoxModel
case AUDIO_CAPTURE:
audioSystem = deviceConfiguration.getAudioSystem();
if (audioSystem != null)
- audioSystem.setCaptureDevice(device.info, true);
+ audioSystem.setDevice(
+ AudioSystem.CAPTURE_INDEX,
+ device.info,
+ true);
break;
case AUDIO_NOTIFY:
audioSystem = deviceConfiguration.getAudioSystem();
if (audioSystem != null)
- audioSystem.setNotifyDevice(device.info, true);
+ audioSystem.setDevice(
+ AudioSystem.NOTIFY_INDEX,
+ device.info,
+ true);
break;
case AUDIO_PLAYBACK:
audioSystem = deviceConfiguration.getAudioSystem();
if (audioSystem != null)
- audioSystem.setPlaybackDevice(device.info, true);
+ audioSystem.setDevice(
+ AudioSystem.PLAYBACK_INDEX,
+ device.info,
+ true);
break;
case VIDEO:
deviceConfiguration.setVideoCaptureDevice(device.info, true);