changeset in /hg/icedtea6: 2009-01-21 Omair Majid <omajid at redh...

Omair Majid omajid at redhat.com
Wed Jan 21 14:18:35 PST 2009


changeset a08ebb168e2f in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a08ebb168e2f
description:
	2009-01-21  Omair Majid  <omajid at redhat.com>

	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java:
	    Remove unused variables volume and muted.
	    (PulseAudioClip): Remove variable volume.
	    (open): Remove muteControl, volume and muted.
	    (native_setVolume): Rename to native_set_volume.
	    (native_update_volume): New function.
	    (isMuted): Remove.
	    (setMuted): Remove.
	    (setVolume): Rename to setCachedVolume.
	    (getVolume): Rename to getCachedVolume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMuteControl.java:
	    Remove file. Mute relied on chaning the volume only through the api. That
	    assumption is invalid as the user can change volume through pulseaudio's
	    controls.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java
	    (isMuted): Remove.
	    (setMuted): Remove.
	    (native_setVolume): Rename to native_set_volume.
	    (native_update_volume): New function.
	    (getVolume): Rename to getCachedVolume.
	    (setVolume): Rename to setCachedVolume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java:
	    Remove muted and muteControl. Rename volume to cachedVolume.
	    (PulseAudioPort): Remove muteControl.
	    (isMuted): Remove function.
	    (setMuted): Remove.
	    (native_setVolume): Rename to native_set_volume.
	    (native_updateVolumeInfo): Rename to native_update_volume.
	    (setVolume): Rename to setCachedVolume.
	    (getVolume): Rename to getCachedVolume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java:
	    Remove muteControl, muted and volume.
	    (open): Remove muteControl.
	    (native_setVolume): Rename to native_set_volume.
	    (native_update_volume): New function.
	    (isMuted): Remove.
	    (setMuted): Remove.
	    (getVolume): Rename to getCachedVolume.
	    (setVolume): Rename to setCachedVolume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java
	    (native_setVolume): Rename to native_set_volume.
	    (native_updateVolumeInfo): Rename to native_update_volume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java
	    (native_setVolume): Rename to native_set_volume.
	    (native_updateVolumeInfo): Rename to native_update_volume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java
	    (setValue): Dont check for mute.
	    (getValue): Query pulseaudio for any change in volume.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/Stream.java:
	    New variable cachedVolume.
	    (native_setVolume): Rename to native_set_volume.
	    (native_update_volume): New function.
	    (getCachedVolume): New function.
	    (setCachedVolume): New function.
	    (update_channels_and_volume): New function.
	    * pulseaudio/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c
	    (sink_input_volume_change_complete): Remove.
	    (sink_input_change_volume): Remove.
	    (Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1set_1sink_1volume):
	    Remove.
	    * pulseaudio/src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c
	    (Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1updateVolumeInfo):
	    Rename to
	    Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1update_1volume.
	    (Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1setVolume):
	    Rename to
	    Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1set_1volume.
	    * pulseaudio/src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c
	    (Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1updateVolumeInfo):
	    Rename to
	    Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1update_1volume.
	    (Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1setVolume):
	    Rename to
	    Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1set_1volume.
	    * pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume): Rename
	    to Java_org_classpath_icedtea_pulseaudio_Stream_native_1set_1volume.
	    (get_sink_input_volume_callback): New function.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1update_1volume): New
	    function.

	    * pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java
	    (testSupportedControls): Update to not check for MuteControl.
	    * pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java
	    (testVolumeAndMute): Rename to testVolume. Remove test for MuteControl.
	    * pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java
	    (testVolumeAndMute): Likewise.
	    (testSupportedControls): Update to not check for MuteControl.
	    * pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java
	    (testControls): Update to not check for MuteControl.
	    * pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java
	    (testControls): Likewise.

diffstat:

19 files changed, 311 insertions(+), 307 deletions(-)
ChangeLog                                                                                  |   95 ++++++++++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java                   |   47 +---
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMuteControl.java            |   73 -------
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java           |   45 ++++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java                   |   59 ++----
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java         |   52 ++---
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java             |    4 
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java             |    6 
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java          |   24 +-
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/Stream.java                           |   17 +
pulseaudio/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c                         |   66 ------
pulseaudio/src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c              |   10 -
pulseaudio/src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c              |   14 -
pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c                            |   64 ++++++
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java              |    2 
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java |   10 -
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java    |   20 --
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java        |    5 
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java        |    5 

diffs (truncated from 1062 to 500 lines):

diff -r c5ad89aedcb0 -r a08ebb168e2f ChangeLog
--- a/ChangeLog	Wed Jan 21 12:13:43 2009 -0500
+++ b/ChangeLog	Wed Jan 21 17:17:47 2009 -0500
@@ -1,3 +1,98 @@ 2009-01-21  Lillian Angel  <langel at redha
+2009-01-21  Omair Majid  <omajid at redhat.com>
+
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java: 
+	Remove unused variables volume and muted.
+	(PulseAudioClip): Remove variable volume.
+	(open): Remove muteControl, volume and muted.
+	(native_setVolume): Rename to native_set_volume.
+	(native_update_volume): New function.
+	(isMuted): Remove.
+	(setMuted): Remove.
+	(setVolume): Rename to setCachedVolume.
+	(getVolume): Rename to getCachedVolume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMuteControl.java:
+	Remove file. Mute relied on chaning the volume only through the api. That
+	assumption is invalid as the user can change volume through pulseaudio's
+	controls.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java
+	(isMuted): Remove.
+	(setMuted): Remove.
+	(native_setVolume): Rename to native_set_volume.
+	(native_update_volume): New function.
+	(getVolume): Rename to getCachedVolume.
+	(setVolume): Rename to setCachedVolume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java:
+	Remove muted and muteControl. Rename volume to cachedVolume. 
+	(PulseAudioPort): Remove muteControl.
+	(isMuted): Remove function.
+	(setMuted): Remove.
+	(native_setVolume): Rename to native_set_volume.
+	(native_updateVolumeInfo): Rename to native_update_volume.
+	(setVolume): Rename to setCachedVolume.
+	(getVolume): Rename to getCachedVolume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java:
+	Remove muteControl, muted and volume.
+	(open): Remove muteControl.
+	(native_setVolume): Rename to native_set_volume.
+	(native_update_volume): New function.
+	(isMuted): Remove.
+	(setMuted): Remove.
+	(getVolume): Rename to getCachedVolume.
+	(setVolume): Rename to setCachedVolume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java
+	(native_setVolume): Rename to native_set_volume.
+	(native_updateVolumeInfo): Rename to native_update_volume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java
+	(native_setVolume): Rename to native_set_volume.
+	(native_updateVolumeInfo): Rename to native_update_volume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java
+	(setValue): Dont check for mute.
+	(getValue): Query pulseaudio for any change in volume.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/Stream.java:
+	New variable cachedVolume.
+	(native_setVolume): Rename to native_set_volume.
+	(native_update_volume): New function.
+	(getCachedVolume): New function.
+	(setCachedVolume): New function.
+	(update_channels_and_volume): New function.
+	* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c
+	(sink_input_volume_change_complete): Remove.
+	(sink_input_change_volume): Remove.
+	(Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1set_1sink_1volume):
+	Remove.
+	* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c
+	(Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1updateVolumeInfo):
+	Rename to
+	Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1update_1volume.
+	(Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1setVolume):
+	Rename to
+	Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1set_1volume.
+	* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c
+	(Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1updateVolumeInfo):
+	Rename to
+	Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1update_1volume.
+	(Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1setVolume):
+	Rename to
+	Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1set_1volume.
+	* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c
+	(Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume): Rename
+	to Java_org_classpath_icedtea_pulseaudio_Stream_native_1set_1volume.
+	(get_sink_input_volume_callback): New function.
+	(Java_org_classpath_icedtea_pulseaudio_Stream_native_1update_1volume): New
+	function.
+
+	* pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java
+	(testSupportedControls): Update to not check for MuteControl.
+	* pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java
+	(testVolumeAndMute): Rename to testVolume. Remove test for MuteControl.
+	* pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java
+	(testVolumeAndMute): Likewise.
+	(testSupportedControls): Update to not check for MuteControl.
+	* pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java	
+	(testControls): Update to not check for MuteControl.
+	* pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java
+	(testControls): Likewise.
+
 2009-01-21  Lillian Angel  <langel at redhat.com>
 
 	* plugin/icedtea/sun/applet/AppletSecurityContextManager.java: Added
diff -r c5ad89aedcb0 -r a08ebb168e2f pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java	Wed Jan 21 12:13:43 2009 -0500
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java	Wed Jan 21 17:17:47 2009 -0500
@@ -54,9 +54,6 @@ public final class PulseAudioClip extend
 		PulseAudioPlaybackLine {
 
 	private byte[] data = null;
-
-	private boolean muted;
-	private float volume;
 
 	// these are frame indices. so counted from 0
 	// the current frame index
@@ -206,7 +203,6 @@ public final class PulseAudioClip extend
 		this.supportedFormats = formats;
 		this.defaultFormat = defaultFormat;
 		this.currentFormat = defaultFormat;
-		this.volume = PulseAudioVolumeControl.MAX_VOLUME;
 		this.streamName = DEFAULT_CLIP_NAME;
 
 		clipThread = new ClipThread();
@@ -416,12 +412,7 @@ public final class PulseAudioClip extend
 
 		PulseAudioVolumeControl volumeControl = new PulseAudioVolumeControl(
 				this, eventLoop);
-		PulseAudioMuteControl muteControl = new PulseAudioMuteControl(this,
-				volumeControl);
 		controls.add(volumeControl);
-		controls.add(muteControl);
-		volume = volumeControl.getValue();
-		muted = muteControl.getValue();
 
 		PulseAudioMixer mixer = PulseAudioMixer.getInstance();
 		mixer.addSourceLine(this);
@@ -433,28 +424,22 @@ public final class PulseAudioClip extend
 
 	// FIXME
 	@Override
-	public byte[] native_setVolume(float value) {
-		return stream.native_setVolume(value);
-	}
-
-	@Override
-	public boolean isMuted() {
-		return muted;
-	}
-
-	@Override
-	public void setMuted(boolean value) {
-		muted = value;
-	}
-
-	@Override
-	public float getVolume() {
-		return this.volume;
-	}
-
-	@Override
-	public void setVolume(float value) {
-		this.volume = value;
+	public byte[] native_set_volume(float value) {
+		return stream.native_set_volume(value);
+	}
+
+	public byte[] native_update_volume() {
+		return stream.native_update_volume();
+	}
+	
+	@Override
+	public float getCachedVolume() {
+		return stream.getCachedVolume();
+	}
+
+	@Override
+	public void setCachedVolume(float value) {
+		stream.setCachedVolume(value);
 
 	}
 
diff -r c5ad89aedcb0 -r a08ebb168e2f pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMuteControl.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMuteControl.java	Wed Jan 21 12:13:43 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/* PulseAudioMuteControl.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
- */
-
-package org.classpath.icedtea.pulseaudio;
-
-import javax.sound.sampled.BooleanControl;
-
-final class PulseAudioMuteControl extends BooleanControl {
-
-	private PulseAudioVolumeControl volumeControl;
-	private PulseAudioPlaybackLine line;
-
-	protected PulseAudioMuteControl(PulseAudioPlaybackLine line,
-			PulseAudioVolumeControl volumeControl) {
-		super(BooleanControl.Type.MUTE, false, "Volume muted", "Volume on");
-		this.volumeControl = volumeControl;
-		this.line = line;
-	}
-
-	public synchronized void setValue(boolean value) {
-		if (!line.isOpen()) {
-			return;
-		}
-
-		if (value == true) {
-			line.setMuted(true);
-			volumeControl.setStreamVolume(0);
-		} else {
-			line.setMuted(false);
-			float newValue = volumeControl.getValue();
-			volumeControl.setStreamVolume(newValue);
-		}
-	}
-
-	public synchronized boolean getValue() {
-		return line.isMuted();
-	}
-
-}
diff -r c5ad89aedcb0 -r a08ebb168e2f pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java	Wed Jan 21 12:13:43 2009 -0500
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java	Wed Jan 21 17:17:47 2009 -0500
@@ -37,18 +37,49 @@ exception statement from your version.
 
 package org.classpath.icedtea.pulseaudio;
 
+/**
+ * Represents a Line that supports changing the volume
+ */
 interface PulseAudioPlaybackLine {
 
-	byte[] native_setVolume(float value);
+	/**
+	 * Set the volume of the Line (ie, sink input, source, or sink)
+	 * 
+	 * @return an Operation object which can be used to check if the operation
+	 *         has completed
+	 */
+	byte[] native_set_volume(float value);
 
-	boolean isMuted();
+	/**
+	 * 
+	 * Update the volume information of a Line (sink input, source or sink)
+	 * 
+	 * @return an Operation object which can be used to check if the operation
+	 *         has been completed
+	 */
+	byte[] native_update_volume();
+	
+	
+	/**
+	 * Gets the cached volume. To get the current volume, call
+	 * native_update_volume, and then call this method to get the updated
+	 * volume.
+	 * 
+	 * @return the cached volume of the Line
+	 */
+	float getCachedVolume();
 
-	void setMuted(boolean mute);
+	/**
+	 * Set the cached value of a line
+	 * 
+	 */
+	void setCachedVolume(float volume);
 
-	float getVolume();
-
-	void setVolume(float volume);
-
+	/**
+	 * Check if a line is open
+	 * 
+	 * @return <code>true</code> if line is open
+	 */
 	boolean isOpen();
 
 }
diff -r c5ad89aedcb0 -r a08ebb168e2f pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java	Wed Jan 21 12:13:43 2009 -0500
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java	Wed Jan 21 17:17:47 2009 -0500
@@ -57,10 +57,8 @@ abstract class PulseAudioPort extends Pu
 
 	private EventLoop eventLoop;
 
-	private float volume;
-	private boolean muted;
+	private float cachedVolume;
 
-	private PulseAudioMuteControl muteControl;
 	private PulseAudioVolumeControl volumeControl;
 
 	static {
@@ -76,72 +74,67 @@ abstract class PulseAudioPort extends Pu
 
 		volumeControl = new PulseAudioVolumeControl(this, eventLoop);
 		controls.add(volumeControl);
-		muteControl = new PulseAudioMuteControl(this, volumeControl);
-		controls.add(muteControl);
 
 		/*
 		 * unlike other lines, Ports must either be open or close
 		 * 
 		 * close = no sound. open = sound
-		 * 
 		 */
 		open();
 
 		// System.out.println("Opened Target Port " + name);
 	}
 
-	
 	// FIXME why public
 	@Override
-	public abstract byte[] native_setVolume(float newValue);
+	public abstract byte[] native_set_volume(float newValue);
 
+	/**
+	 * 
+	 * @see {@link update_channels_and_volume}
+	 */
 	// FIXME why public
-	public abstract byte[] native_updateVolumeInfo();
+	public abstract byte[] native_update_volume();
 
 	@Override
-	public boolean isMuted() {
-		return muted;
+	public float getCachedVolume() {
+		return this.cachedVolume;
 	}
 
 	@Override
-	public void setMuted(boolean value) {
-		muted = value;
-	}
-
-	@Override
-	public float getVolume() {
-
-		// FIXME need to query system for volume
-		return this.volume;
-	}
-
-	@Override
-	public void setVolume(float value) {
-		this.volume = value;
+	public void setCachedVolume(float value) {
+		this.cachedVolume = value;
 
 	}
 
-	// FIXME
-	public synchronized void updateVolumeInfo() {
+	private void updateVolumeInfo() {
 		Operation op;
 		synchronized (eventLoop.threadLock) {
-			op = new Operation(native_updateVolumeInfo());
+			op = new Operation(native_update_volume());
 		}
 
 		op.waitForCompletion();
 		op.releaseReference();
 	}
 
-	// FIXME
-	public void update_channels_and_volume(int channels, float volume) {
+	/**
+	 * Callback used by JNI when native_update_volume completes
+	 * 
+	 * @param channels
+	 *            the number of channels
+	 * @param cachedVolume
+	 *            the new volume
+	 */
+	@SuppressWarnings("unused")
+	void update_channels_and_volume(int channels, float volume) {
 		this.channels = channels;
-		this.volume = volume;
+		this.cachedVolume = volume;
 	}
 
 	@Override
 	public void close() {
 
-		native_setVolume((float) 0);
+		native_set_volume((float) 0);
 		isOpen = false;
 		fireLineEvent(new LineEvent(this, LineEvent.Type.CLOSE,
 				AudioSystem.NOT_SPECIFIED));
@@ -155,7 +148,7 @@ abstract class PulseAudioPort extends Pu
 		if (isOpen) {
 			return;
 		}
-		native_setVolume(volume);
+		native_set_volume(cachedVolume);
 		isOpen = true;
 		fireLineEvent(new LineEvent(this, LineEvent.Type.OPEN,
 				AudioSystem.NOT_SPECIFIED));
diff -r c5ad89aedcb0 -r a08ebb168e2f pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Wed Jan 21 12:13:43 2009 -0500
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Wed Jan 21 17:17:47 2009 -0500
@@ -51,10 +51,7 @@ public final class PulseAudioSourceDataL
 public final class PulseAudioSourceDataLine extends PulseAudioDataLine
 		implements SourceDataLine, PulseAudioPlaybackLine {
 
-	private PulseAudioMuteControl muteControl;
 	private PulseAudioVolumeControl volumeControl;
-	private boolean muted;
-	private float volume;
 
 	public static final String DEFAULT_SOURCEDATALINE_NAME = "Audio Stream";
 
@@ -67,7 +64,6 @@ public final class PulseAudioSourceDataL
 		this.lineListeners = new ArrayList<LineListener>();
 		this.defaultFormat = defaultFormat;
 		this.currentFormat = defaultFormat;
-		this.volume = PulseAudioVolumeControl.MAX_VOLUME;
 		this.streamName = DEFAULT_SOURCEDATALINE_NAME;
 
 	}
@@ -80,8 +76,6 @@ public final class PulseAudioSourceDataL
 
 		volumeControl = new PulseAudioVolumeControl(this, eventLoop);
 		controls.add(volumeControl);
-		muteControl = new PulseAudioMuteControl(this, volumeControl);
-		controls.add(muteControl);
 
 		PulseAudioMixer parentMixer = PulseAudioMixer.getInstance();
 		parentMixer.addSourceLine(this);
@@ -97,32 +91,26 @@ public final class PulseAudioSourceDataL
 	}
 
 	// FIXME
-	public byte[] native_setVolume(float value) {
-		synchronized (eventLoop.threadLock) {
-			return stream.native_setVolume(value);
-		}
-	}
-
-	// FIXME
-	@Override
-	public boolean isMuted() {
-		return muted;
-	}
-
-	@Override
-	public void setMuted(boolean value) {
-		muted = value;
-	}
-
-	@Override
-	public float getVolume() {
-		return this.volume;
-	}
-
-	@Override
-	synchronized public void setVolume(float value) {
-		this.volume = value;
-



More information about the distro-pkg-dev mailing list