harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r439263 - in /incubator/harmony/enhanced/classlib/trunk/modules/sound/src: main/java/javax/sound/sampled/ test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/ test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/
Date Fri, 01 Sep 2006 10:36:50 GMT
Author: mloenko
Date: Fri Sep  1 03:36:48 2006
New Revision: 439263

URL: http://svn.apache.org/viewvc?rev=439263&view=rev
Log:
simple classes and stubs for sound module

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioSystem.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Control.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineUnavailableException.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioSystem.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioSystem.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioSystem.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioSystem.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,21 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+public class AudioSystem {
+    public static final int NOT_SPECIFIED = -1;
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Control.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Control.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Control.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Control.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,22 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+public class Control {
+    static class Type{
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,100 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+public interface DataLine extends Line {
+
+    class Info extends Line.Info {
+        private AudioFormat[] formats;
+        private int minBufferSize;
+        private int maxBufferSize;
+        
+        public Info(Class <?> lineClass, AudioFormat format) {
+            super(lineClass);
+
+            this.formats = new AudioFormat[] { format };
+            this.minBufferSize = AudioSystem.NOT_SPECIFIED;
+            this.maxBufferSize = AudioSystem.NOT_SPECIFIED;
+        }
+
+        public Info(Class <?> lineClass, AudioFormat[] formats, int minBufferSize,
int maxBufferSize) {
+            super(lineClass);
+
+            this.formats = formats;
+            this.minBufferSize = minBufferSize;
+            this.maxBufferSize = maxBufferSize;
+        }
+
+        public Info(Class <?> lineClass, AudioFormat format, int bufferSize) {
+            super(lineClass);
+
+            this.formats = new AudioFormat[] { format };
+            this.minBufferSize = bufferSize;
+            this.maxBufferSize = bufferSize;
+        }
+
+        public AudioFormat[] getFormats(){
+            return formats;
+        }
+        
+        public boolean isFormatSupported(AudioFormat format) {
+            throw new Error("not yet implemented");
+        }
+
+        public int getMinBufferSize() {
+            return minBufferSize;
+        }
+
+        public int getMaxBufferSize() {
+            return maxBufferSize;
+        }
+
+        public boolean matches(Line.Info info) {
+            throw new Error("not yet implemented");
+        }
+        
+        public String toString() {
+            throw new Error("not yet implemented");
+        }
+    }
+
+    int available();
+
+    void drain();
+
+    void flush();
+    
+    int getBufferSize();
+    
+    AudioFormat getFormat();
+    
+    int getFramePosition();
+    
+    float getLevel();
+    
+    long getLongFramePosition();
+    
+    long getMicroSecondPosition();
+    
+    boolean isActive();
+    
+    boolean isRunning();
+    
+    void start();
+    
+    void stop();
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,58 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+public interface Line {
+
+    class Info {
+        private Class <?> lineClass;
+        
+        public Info(Class <?> lineClass) {
+            this.lineClass = lineClass;
+        }
+
+        public Class <?> getLineClass( ){
+            return lineClass;
+        }
+
+        public boolean matches(Line.Info info) {
+            throw new Error("not yet implemented");
+        }
+        
+        public String toString() {
+            throw new Error("not yet implemented");
+        }
+    }
+
+    void addLineListener(LineListener listener);
+
+    void close();
+
+    Control getControl(Control.Type control);
+
+    Control[] getcontrols();
+
+    Line.Info getLineInfo();
+
+    boolean isControlSupported(Control.Type control);
+
+    boolean isOpen();
+
+    void open();
+
+    void removeLineListener(LineListener listener);
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineEvent.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineEvent.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineEvent.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,34 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+import java.util.EventObject;
+
+public class LineEvent extends EventObject {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    public LineEvent(Line line, LineEvent.Type type, long position) {
+        super(line);
+    }
+
+    public static class Type {}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineListener.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineListener.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineListener.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,23 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+import java.util.EventListener;
+
+public interface LineListener extends EventListener {
+    void update(LineEvent event);
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineUnavailableException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineUnavailableException.java?rev=439263&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineUnavailableException.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/LineUnavailableException.java
Fri Sep  1 03:36:48 2006
@@ -0,0 +1,28 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.sound.sampled;
+
+public class LineUnavailableException extends Exception {
+
+    public LineUnavailableException() {
+        super();
+    }
+
+    public LineUnavailableException(String message) {
+        super(message);
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java?rev=439263&r1=439262&r2=439263&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java
Fri Sep  1 03:36:48 2006
@@ -16,7 +16,7 @@
 
 package javax.sound.sampled;
 
-public interface Mixer {
+public interface Mixer extends Line {
     static class Info{
         private String name;
         private String vendor;
@@ -58,4 +58,30 @@
             throw new Error("not yet implemented");
         }
     }
+
+    Line getLine(Line.Info info);
+    
+    int getMaxLines(Line.Info info);
+    
+    Mixer.Info getMixerInfo();
+    
+    Line.Info[] getSourceLineInfo();
+    
+    Line.Info[] getSourceLineInfo(Line.Info info);
+    
+    Line[] getSourceLines();
+    
+    Line.Info[] getTargetLineInfo();
+    
+    Line.Info[] getTargetLineInfo(Line.Info info);
+    
+    Line[] getTargetLines();
+    
+    boolean isLineSupported(Line.Info info);
+    
+    boolean isSynchronizationSupported(Line[] lines, boolean maintainSync);
+    
+    void synchronize(Line[] lines, boolean maintainSync);
+
+    void unsynchronize(Line[] lines);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java?rev=439263&r1=439262&r2=439263&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java
Fri Sep  1 03:36:48 2006
@@ -41,8 +41,8 @@
             }
         };
 
-        recorded = new MidiDevice.Info[1];
-        recorded[0] = new MidiDevice.Info("1", "2", "3", "4") {};
+        recorded = new MidiDevice.Info[] { new MidiDevice.Info("1", "2", "3",
+                "4") {} };
         assertTrue(myProvider.isDeviceSupported(recorded[0]));
 
         MidiDevice.Info similar = new MidiDevice.Info("1", "2", "3", "4") {};

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java?rev=439263&r1=439262&r2=439263&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java
Fri Sep  1 03:36:48 2006
@@ -93,8 +93,7 @@
             }
         };
 
-        recorded = new int[1];
-        recorded[0] = 3;
+        recorded = new int[] {3};
 
         assertTrue(writer.isFileTypeSupported(3, null));
         assertFalse(writer.isFileTypeSupported(5, null));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java?rev=439263&r1=439262&r2=439263&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java
Fri Sep  1 03:36:48 2006
@@ -58,8 +58,7 @@
             }
         };
 
-        recorded = new AudioFileFormat.Type[1];
-        recorded[0] = new AudioFileFormat.Type("1", "2");
+        recorded = new AudioFileFormat.Type[] {new AudioFileFormat.Type("1", "2")};
 
         assertTrue(writer.isFileTypeSupported(recorded[0]));
 
@@ -108,8 +107,8 @@
             }
         };
 
-        recorded = new AudioFileFormat.Type[1];
-        recorded[0] = new AudioFileFormat.Type("1", "2");
+        recorded = new AudioFileFormat.Type[] { new AudioFileFormat.Type("1",
+                "2") };
 
         assertTrue(writer.isFileTypeSupported(recorded[0], null));
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java?rev=439263&r1=439262&r2=439263&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java
Fri Sep  1 03:36:48 2006
@@ -41,8 +41,7 @@
             }
         };
 
-        recorded = new Mixer.Info[1];
-        recorded[0] = new Mixer.Info("1", "2", "3", "4") {};
+        recorded = new Mixer.Info[] { new Mixer.Info("1", "2", "3", "4") {} };
         assertTrue(myProvider.isMixerSupported(recorded[0]));
 
         Mixer.Info similar = new Mixer.Info("1", "2", "3", "4") {};



Mime
View raw message