/** * Sets the <tt>MediaLocator</tt> which specifies the playback device to be * used by this <tt>Renderer</tt>. * * @param locator the <tt>MediaLocator</tt> which specifies the playback * device to be used by this <tt>Renderer</tt> */ public void setLocator(MediaLocator locator) { if (this.locator == null) { if (locator == null) return; } else if (this.locator.equals(locator)) return; this.locator = locator; }
/** * Gets a <tt>CapatureDeviceInfo2</tt> which is known to this instance and * is identified by a specific <tt>MediaLocator</tt>. * * @param locator the <tt>MediaLocator</tt> of the * <tt>CaptureDeviceInfo2</tt> to be returned * @return a <tt>CaptureDeviceInfo2</tt> which is known to this instance and * is identified by the specified <tt>locator</tt> */ public CaptureDeviceInfo2 getDevice(MediaLocator locator) { CaptureDeviceInfo2 device = null; if (devices != null) { for (CaptureDeviceInfo2 aDevice : devices) { MediaLocator aLocator = aDevice.getLocator(); if (locator.equals(aLocator)) { device = aDevice; break; } } } return device; }
/** * Checks whether the playback and notification configuration share the same * device. * * @return are audio out and notifications using the same device. */ public boolean audioOutAndNotificationsShareSameDevice() { AudioSystem audioSystem = getDeviceConfiguration().getAudioSystem(); CaptureDeviceInfo notify = audioSystem.getSelectedDevice(AudioSystem.DataFlow.NOTIFY); CaptureDeviceInfo playback = audioSystem.getSelectedDevice(AudioSystem.DataFlow.PLAYBACK); if (notify == null) return (playback == null); else { if (playback == null) return false; else return notify.getLocator().equals(playback.getLocator()); } }
: oldRenderDevice.equals(newRenderDevice))