diff --git a/src/org/jitsi/impl/neomedia/notify/AudioNotifierServiceImpl.java b/src/org/jitsi/impl/neomedia/notify/AudioNotifierServiceImpl.java index 09b4a26aa5d7891e16ab3748ded2fc697647d2f4..7fc5a3595899b38732e15d4f7c39afab0efd564d 100644 --- a/src/org/jitsi/impl/neomedia/notify/AudioNotifierServiceImpl.java +++ b/src/org/jitsi/impl/neomedia/notify/AudioNotifierServiceImpl.java @@ -16,6 +16,8 @@ import org.jitsi.service.libjitsi.*; import org.jitsi.service.resources.*; +import javax.media.*; + /** * The implementation of the AudioNotifierService. * @@ -218,6 +220,28 @@ public void propertyChange(PropertyChangeEvent event) } } + /** + * Checks whether the playback and notification configuration + * share the same device. + * @return are audio out and notifications using the same device. + */ + public boolean audioOutAndNotificationsShareSameDevice() + { + CaptureDeviceInfo notifyInfo = + getDeviceConfiguration().getAudioSystem() + .getDevice(AudioSystem.NOTIFY_INDEX); + CaptureDeviceInfo playbackInfo = + getDeviceConfiguration().getAudioSystem() + .getDevice(AudioSystem.PLAYBACK_INDEX); + + if(notifyInfo != null && playbackInfo != null) + { + return notifyInfo.getLocator().equals(playbackInfo.getLocator()); + } + + return false; + } + /** * Key for clips. */ diff --git a/src/org/jitsi/service/audionotifier/AudioNotifierService.java b/src/org/jitsi/service/audionotifier/AudioNotifierService.java index 95de40459033fa216cd603608f385b415d0ea9aa..968ba73c15821e379694e9617f5fd3e84bb762e4 100644 --- a/src/org/jitsi/service/audionotifier/AudioNotifierService.java +++ b/src/org/jitsi/service/audionotifier/AudioNotifierService.java @@ -53,4 +53,11 @@ public interface AudioNotifierService * @return TRUE if currently the sound is off, FALSE otherwise */ public boolean isMute(); + + /** + * Checks whether the playback and notification configuration + * share the same device. + * @return are audio out and notifications using the same device. + */ + public boolean audioOutAndNotificationsShareSameDevice(); }