changeset in /hg/icedtea: 2008-10-10 Ioana Ivan <iivan at redhat.com>
Ioana Ivan
iivan at redhat.com
Sat Oct 18 21:23:28 PDT 2008
changeset e7b6e8e732e4 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=e7b6e8e732e4
description:
2008-10-10 Ioana Ivan <iivan at redhat.com>
* src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java
(getLine): LineUnavailablException is no longer thrown if the mixer is
not open
(getTargetLines) : returns a Line[] array instead of a
TargetDataLine[] array
* src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine
(open(AudioFormat format, int bufferSize)): throws
LineUnavailableException if the mixer is not open
* src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip
(open()): throws LineUnavailableException if the mixer is not open
* src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort
(PulseAudioPort): calls open()
diffstat:
6 files changed, 32 insertions(+), 10 deletions(-)
ChangeLog | 17 ++++++++++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 5 ++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 5 ++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 6 ---
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java | 8 ++--
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java | 1
diffs (120 lines):
diff -r 8b85ec866923 -r e7b6e8e732e4 ChangeLog
--- a/ChangeLog Fri Oct 10 16:03:12 2008 -0400
+++ b/ChangeLog Fri Oct 10 17:12:18 2008 -0400
@@ -1,3 +1,20 @@ 2008-10-10 Ioana Ivan <iivan at redhat.com>
+2008-10-10 Ioana Ivan <iivan at redhat.com>
+ * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java
+ (getLine): LineUnavailablException is no longer thrown if the mixer is
+ not open
+ (getTargetLines) : returns a Line[] array instead of a
+ TargetDataLine[] array
+
+ * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine
+ (open(AudioFormat format, int bufferSize)): throws
+ LineUnavailableException if the mixer is not open
+
+ * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip
+ (open()): throws LineUnavailableException if the mixer is not open
+
+ * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort
+ (PulseAudioPort): calls open()
+
2008-10-10 Ioana Ivan <iivan at redhat.com>
Omair Majid <omajid at redhat.com>
diff -r 8b85ec866923 -r e7b6e8e732e4 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Oct 10 16:03:12 2008 -0400
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Oct 10 17:12:18 2008 -0400
@@ -398,6 +398,11 @@ public class PulseAudioClip extends Puls
public void open(AudioFormat format, byte[] data, int offset, int bufferSize)
throws LineUnavailableException {
+ if(!PulseAudioMixer.getInstance().isOpen()) {
+ throw new LineUnavailableException("The mixer needs to be opened before opening a line");
+ }
+
+
/* check for permission to play audio */
AudioPermission perm = new AudioPermission("play", null);
perm.checkGuard(null);
diff -r 8b85ec866923 -r e7b6e8e732e4 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Oct 10 16:03:12 2008 -0400
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Oct 10 17:12:18 2008 -0400
@@ -84,6 +84,10 @@ public abstract class PulseAudioDataLine
if (isOpen) {
throw new IllegalStateException("Line is already open");
}
+ if(!PulseAudioMixer.getInstance().isOpen()) {
+ throw new LineUnavailableException("The mixer needs to be opened before opening a line");
+ }
+
createStream(format);
addStreamListeners();
@@ -277,7 +281,6 @@ public abstract class PulseAudioDataLine
public void open() throws LineUnavailableException {
assert (defaultFormat != null);
-
open(defaultFormat, DEFAULT_BUFFER_SIZE);
}
diff -r 8b85ec866923 -r e7b6e8e732e4 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Oct 10 16:03:12 2008 -0400
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Oct 10 17:12:18 2008 -0400
@@ -271,10 +271,6 @@ public class PulseAudioMixer implements
throw new IllegalArgumentException("Line unsupported: " + info);
}
- if (!isOpen) {
- throw new LineUnavailableException("The mixer isnt open");
- }
-
AudioFormat[] formats = null;
AudioFormat defaultFormat = null;
@@ -410,7 +406,7 @@ public class PulseAudioMixer implements
AudioPermission perm = new AudioPermission("record", null);
perm.checkGuard(null);
- return (Line[]) targetLines.toArray(new TargetDataLine[0]);
+ return (Line[]) targetLines.toArray(new Line[0]);
}
@Override
diff -r 8b85ec866923 -r e7b6e8e732e4 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Fri Oct 10 16:03:12 2008 -0400
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Fri Oct 10 17:12:18 2008 -0400
@@ -76,8 +76,8 @@ public abstract class PulseAudioPort ext
controls.add(volumeControl);
muteControl = new PulseAudioMuteControl(this, volumeControl);
controls.add(muteControl);
- isOpen = true;
-
+ //isOpen = true;
+ open();
/*
* unlike other lines, Ports must either be open or close
*
@@ -141,7 +141,9 @@ public abstract class PulseAudioPort ext
@Override
public void open() {
-
+ if(isOpen) {
+ return;
+ }
native_setVolume(volume);
isOpen = true;
fireLineEvent(new LineEvent(this, LineEvent.Type.OPEN,
diff -r 8b85ec866923 -r e7b6e8e732e4 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Fri Oct 10 16:03:12 2008 -0400
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Fri Oct 10 17:12:18 2008 -0400
@@ -51,7 +51,6 @@ public class PulseAudioTargetPort extend
public PulseAudioTargetPort(String name, EventLoop eventLoop) {
super(name, eventLoop);
-
}
public void open() {
More information about the distro-pkg-dev
mailing list