You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by nd...@apache.org on 2006/07/22 23:05:06 UTC
svn commit: r424630 [1/2] - in
/incubator/harmony/enhanced/classlib/trunk/modules/sound: ./ .settings/
META-INF/ make/ src/ src/main/ src/main/java/ src/main/java/javax/
src/main/java/javax/sound/ src/main/java/javax/sound/midi/ src/test/
src/test/java...
Author: ndbeyer
Date: Sat Jul 22 14:05:04 2006
New Revision: 424630
URL: http://svn.apache.org/viewvc?rev=424630&view=rev
Log:
Create SOUND module.
Based on submissions from: HARMONY-883, HARMONY-897, HARMONY-906, HARMONY-909, HARMONY-912, HARMONY-928, HARMONY-954
Added:
incubator/harmony/enhanced/classlib/trunk/modules/sound/ (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/.classpath (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/.project (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/
incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.core.prefs
incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.ui.prefs
incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.pde.core.prefs
incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/
incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF
incubator/harmony/enhanced/classlib/trunk/modules/sound/build.xml (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/make/
incubator/harmony/enhanced/classlib/trunk/modules/sound/make/hyproperties.xml (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/make/patternset.txt (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ControllerEventListener.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Instrument.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/InvalidMidiDataException.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaEventListener.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiChannel.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiEvent.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiFileFormat.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiUnavailableException.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Patch.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Receiver.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequence.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Soundbank.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SoundbankResource.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Synthesizer.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Transmitter.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/VoiceStatus.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MetaMessageTest.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/PatchTest.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/ShortMessageTest.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SoundbankResourceTest.java (with props)
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jul 22 14:05:04 2006
@@ -0,0 +1 @@
+bin
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/.classpath
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/.classpath?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/.classpath (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/.classpath Sat Jul 22 14:05:04 2006
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry output="bin/main" kind="src" path="src/main/java"/>
+ <classpathentry output="bin/test" kind="src" path="src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
+ <classpathentry kind="output" path="bin/main"/>
+</classpath>
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/.classpath
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/.project
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/.project?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/.project (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/.project Sat Jul 22 14:05:04 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>sound</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/.project
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.core.prefs?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.core.prefs Sat Jul 22 14:05:04 2006
@@ -0,0 +1,12 @@
+#Wed May 03 13:10:22 BST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.ui.prefs
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.ui.prefs?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.ui.prefs (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.jdt.ui.prefs Sat Jul 22 14:05:04 2006
@@ -0,0 +1,3 @@
+#Wed May 03 13:10:00 BST 2006
+eclipse.preferences.version=1
+internal.default.compliance=user
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.pde.core.prefs
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.pde.core.prefs?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.pde.core.prefs (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/.settings/org.eclipse.pde.core.prefs Sat Jul 22 14:05:04 2006
@@ -0,0 +1,3 @@
+#Thu Dec 15 00:50:33 GMT 2005
+eclipse.preferences.version=1
+pluginProject.extensions=false
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF Sat Jul 22 14:05:04 2006
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Harmony Sound
+Bundle-SymbolicName: org.apache.harmony.sound
+Bundle-Version: 1.0.0
+Bundle-ClassPath: .
+Eclipse-JREBundle: true
+Import-Package: java.lang,
+ java.util,
+ java.io,
+ java.net
+Export-Package: javax.sound.midi
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/build.xml?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/build.xml (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/build.xml Sat Jul 22 14:05:04 2006
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<project name="SOUND Build" default="build" basedir=".">
+ <description>Build for SOUND component</description>
+
+ <!-- import common properties -->
+ <import file="${basedir}/../../make/properties.xml" />
+
+ <!-- set global properties for this build. -->
+ <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
+
+ <fileset id="classes" dir="${hy.build}">
+ <includesfile name="${hy.sound}/make/patternset.txt" />
+ <excludesfile name="${hy.hdk}/build/patternsets/luni-kernel.txt" />
+ <excludesfile name="${hy.hdk}/build/patternsets/security-kernel.txt" />
+ </fileset>
+
+ <!-- Set build.compiler to "org.eclipse.jdt.core.JDTCompilerAdapter" to
+ use the Eclipse Java compiler. -->
+ <property name="build.compiler" value="modern" />
+
+ <target name="build" depends="compile.java, build.jar" />
+
+ <target name="test" depends="build, compile.tests, run.tests" />
+
+ <target name="clean">
+ <delete failonerror="false">
+ <fileset refid="classes" />
+ <fileset dir="${hy.sound.bin.test}" />
+ </delete>
+ </target>
+
+ <target name="compile.java">
+ <echo message="Compiling SOUND classes" />
+
+ <mkdir dir="${hy.build}" />
+
+ <javac sourcepath=""
+ srcdir="${hy.sound.src.main.java}"
+ destdir="${hy.build}"
+ source="${hy.javac.source}"
+ target="${hy.javac.target}"
+ debug="${hy.javac.debug}">
+
+ <bootclasspath>
+ <fileset dir="${hy.jdk}/jre/lib/boot">
+ <include name="**/*.jar" />
+ </fileset>
+ </bootclasspath>
+ </javac>
+ </target>
+
+ <target name="build.jar">
+ <jar destfile="${hy.jdk}/jre/lib/boot/${hy.sound.packaging.jarname}.jar"
+ manifest="${hy.sound}/META-INF/MANIFEST.MF">
+ <fileset refid="classes" />
+ </jar>
+ </target>
+
+ <target name="compile.tests">
+ <echo message="Compiling SOUND tests" />
+
+ <mkdir dir="${hy.sound.bin.test}" />
+
+ <javac srcdir="${hy.sound.src.test.java}"
+ destdir="${hy.sound.bin.test}"
+ sourcepath=""
+ source="${hy.javac.source}"
+ target="${hy.javac.target}"
+ debug="${hy.javac.debug}">
+
+ <bootclasspath>
+ <fileset dir="${hy.jdk}/jre/lib/boot">
+ <include name="**/*.jar" />
+ </fileset>
+ </bootclasspath>
+ <classpath location="../../build/tests" />
+ <classpath location="${hy.hdk}/build/test/support.jar" />
+ </javac>
+ </target>
+
+ <target name="run.tests">
+
+ <mkdir dir="${hy.tests.reports}" />
+
+ <property name="test.jre.home" value="${hy.jdk}/jre" />
+
+ <junit fork="yes"
+ forkmode="once"
+ printsummary="withOutAndErr"
+ errorproperty="test.errors"
+ failureproperty="test.failures"
+ showoutput="on"
+ dir="${hy.sound.bin.test}"
+ jvm="${test.jre.home}/bin/java">
+
+ <jvmarg value="-showversion"/>
+
+ <env key="JAVA_HOME" value="${test.jre.home}"/>
+
+ <classpath>
+ <pathelement path="${hy.sound.bin.test}"/>
+ </classpath>
+ <classpath location="${hy.hdk}/build/test/support.jar" />
+
+ <formatter type="xml" />
+
+ <test name="${test.case}" todir="${hy.tests.reports}"
+ if="test.case" />
+
+ <batchtest todir="${hy.tests.reports}" haltonfailure="no"
+ unless="test.case">
+
+ <fileset dir="${hy.sound.src.test.java}">
+ <exclude name="org/apache/harmony/sound/tests/javax/sound/midi/ShortMessageTest.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ <antcall target="touch-failures-file" />
+ <antcall target="touch-errors-file" />
+ </target>
+
+ <target name="touch-failures-file" if="test.failures">
+ <echo file="${hy.tests.reports}/test.failures"
+ append="true">sound${line.separator}</echo>
+ </target>
+
+ <target name="touch-errors-file" if="test.errors">
+ <echo file="${hy.tests.reports}/test.errors"
+ append="true">sound${line.separator}</echo>
+ </target>
+
+</project>
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/make/hyproperties.xml?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/make/hyproperties.xml (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/make/hyproperties.xml Sat Jul 22 14:05:04 2006
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<hy>
+ <sound location=".">
+ <src>
+ <main>
+ <java location="src/main/java" />
+ <resources location="src/main/resources" />
+ </main>
+ <test>
+ <java location="src/test/java" />
+ <resources location="src/test/resources" />
+ </test>
+ <natives location="src/natives" />
+ </src>
+ <bin>
+ <main location="bin/main" />
+ <test location="bin/test" />
+ </bin>
+ <packaging>
+ <jarname>sound</jarname>
+ </packaging>
+ </sound>
+
+ <hdk location="../../deploy" />
+ <jdk location="../../deploy/jdk" />
+ <build location="../../build/classes" />
+
+ <tests>
+ <reports location="../../build/test_report" />
+ </tests>
+</hy>
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/make/hyproperties.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/make/patternset.txt
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/make/patternset.txt?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/make/patternset.txt (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/make/patternset.txt Sat Jul 22 14:05:04 2006
@@ -0,0 +1,15 @@
+# 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.
+
+javax/sound/midi/*
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/make/patternset.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ControllerEventListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ControllerEventListener.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ControllerEventListener.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ControllerEventListener.java Sat Jul 22 14:05:04 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.midi;
+
+import java.util.EventListener;
+
+public interface ControllerEventListener extends EventListener {
+ void controlChange(ShortMessage event);
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ControllerEventListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Instrument.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Instrument.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Instrument.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Instrument.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,30 @@
+/*
+ * 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.midi;
+
+public abstract class Instrument extends SoundbankResource {
+ private Patch patch;
+
+ protected Instrument(Soundbank soundbank, Patch patch, String name, Class<?> dataClass) {
+ super(soundbank, name, dataClass);
+ this.patch = patch;
+ }
+
+ public Patch getPatch() {
+ return patch;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Instrument.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/InvalidMidiDataException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/InvalidMidiDataException.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/InvalidMidiDataException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/InvalidMidiDataException.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,29 @@
+/*
+ * 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.midi;
+
+public class InvalidMidiDataException extends Exception {
+ private static final long serialVersionUID = 2780771756789932067L;
+
+ public InvalidMidiDataException() {
+ super();
+ }
+
+ public InvalidMidiDataException(String message) {
+ super(message);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/InvalidMidiDataException.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaEventListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaEventListener.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaEventListener.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaEventListener.java Sat Jul 22 14:05:04 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.midi;
+
+import java.util.EventListener;
+
+public interface MetaEventListener extends EventListener {
+ void meta(MetaMessage meta);
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaEventListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,119 @@
+/*
+ * 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.midi;
+
+public class MetaMessage extends MidiMessage {
+ public static final int META = 255;
+
+ private int type;
+
+ private byte[] data;
+
+ public MetaMessage() {
+ super(new byte[] { -1, 0 });
+ data = new byte[0];
+ type = 0;
+ }
+
+ protected MetaMessage(byte[] data) {
+ super(data);
+ if (data.length >= 2) {
+ type = (int) (data[1] & 0xFF);
+ } else {
+ type = 0;
+ }
+ if (data.length > 3) {
+ int n = 3;
+ while (data[n - 1] < 0)
+ n++;
+ this.data = new byte[data.length - n];
+ for (int i = n; i < data.length; i++) {
+ this.data[i - n] = data[i];
+ }
+ } else {
+ this.data = new byte[0];
+ }
+
+ }
+
+ public Object clone() {
+ return new MetaMessage(this.getMessage());
+ }
+
+ public byte[] getData() {
+ return data.clone();
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException {
+ //FIXME
+ if (type < 0 || type >= 128) {
+ throw new InvalidMidiDataException("Invalid meta event with type " + type);
+ }
+ if (length < 0 || (data != null && length > data.length)) {
+ throw new InvalidMidiDataException("length out of bounds: " + length);
+ }
+ try {
+ if (data == null) {
+ if (length != 0) {
+ throw new NullPointerException();
+ }
+ super.setMessage(new byte[] { -1, (byte) type, 0 }, 3);
+ this.data = new byte[0];
+ } else {
+ int div = 128;
+ int n = 1;
+ int ost;
+ int sm = 0;
+ while (length / div != 0) {
+ n++;
+ div *= 128;
+ }
+ int ln = n;
+ byte[] tdata = new byte[length + ln + 2];
+ div = 1;
+ ost = (length / div) % 128;
+ while (n != 0) {
+ tdata[n - 1 + 2] = (byte) (ost + sm);
+ n--;
+ div *= 128;
+ ost = (length / div) % 128;
+ sm = 128;
+ }
+ tdata[0] = -1;
+ tdata[1] = (byte) type;
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ tdata[2 + ln + i] = data[i];
+ }
+ }
+ super.setMessage(tdata, length + 2 + ln);
+ this.data = new byte[length];
+ if (length > 0) {
+ for (int i = 0; i < length; i++)
+ this.data[i] = data[i];
+ }
+ }
+ } catch (InvalidMidiDataException e) {
+ throw e;
+ }
+ this.type = type;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiChannel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiChannel.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiChannel.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiChannel.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,71 @@
+/*
+ * 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.midi;
+
+public interface MidiChannel {
+ void allNotesOff();
+
+ void allSoundOff();
+
+ void controlChange(int controller, int value);
+
+ int getChannelPressure();
+
+ int getController(int controller);
+
+ boolean getMono();
+
+ boolean getMute();
+
+ boolean getOmni();
+
+ int getPitchBend();
+
+ int getPolyPressure(int noteNumber);
+
+ int getProgram();
+
+ boolean getSolo();
+
+ boolean localControl(boolean on);
+
+ void noteOff(int noteNumber);
+
+ void noteOff(int noteNumber, int velocity);
+
+ void noteOn(int noteNumber, int velocity);
+
+ void programChange(int program);
+
+ void programChange(int bank, int program);
+
+ void resetAllControllers();
+
+ void setChannelPressure(int pressure);
+
+ void setMono(boolean on);
+
+ void setMute(boolean mute);
+
+ void setOmni(boolean on);
+
+ void setPitchBend(int bend);
+
+ void setPolyPressure(int noteNumber, int pressure);
+
+ void setSolo(boolean soloState);
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiChannel.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,121 @@
+/*
+ * 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.midi;
+
+import java.util.List;
+
+public interface MidiDevice {
+ class Info {
+ private String name;
+
+ private String vendor;
+
+ private String description;
+
+ private String version;
+
+ protected Info(String name, String vendor, String description, String version) {
+ this.name = name;
+ this.vendor = vendor;
+ this.description = description;
+ this.version = version;
+ }
+
+ public final boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final Info other = (Info) obj;
+ if (description == null) {
+ if (other.description != null)
+ return false;
+ } else if (!description.equals(other.description))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (vendor == null) {
+ if (other.vendor != null)
+ return false;
+ } else if (!vendor.equals(other.vendor))
+ return false;
+ if (version == null) {
+ if (other.version != null)
+ return false;
+ } else if (!version.equals(other.version))
+ return false;
+ return true;
+ }
+
+ public final String getDescription() {
+ return description;
+ }
+
+ public final String getName() {
+ return name;
+ }
+
+ public final String getVendor() {
+ return vendor;
+ }
+
+ public final String getVersion() {
+ return version;
+ }
+
+ public final int hashCode() {
+ final int PRIME = 31;
+ int result = super.hashCode();
+ result = PRIME * result + ((description == null) ? 0 : description.hashCode());
+ result = PRIME * result + ((name == null) ? 0 : name.hashCode());
+ result = PRIME * result + ((vendor == null) ? 0 : vendor.hashCode());
+ result = PRIME * result + ((version == null) ? 0 : version.hashCode());
+ return result;
+ }
+
+ public final String toString() {
+ return name;
+ }
+ }
+
+ void close();
+
+ MidiDevice.Info getDeviceInfo();
+
+ int getMaxReceivers();
+
+ int getMaxTransmitters();
+
+ long getMicrosecondPosition();
+
+ Receiver getReceiver() throws MidiUnavailableException;
+
+ List<Receiver> getReceivers();
+
+ Transmitter getTransmitter() throws MidiUnavailableException;
+
+ List<Transmitter> getTransmitters();
+
+ boolean isOpen();
+
+ void open() throws MidiUnavailableException;
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiEvent.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiEvent.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiEvent.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,37 @@
+/*
+ * 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.midi;
+
+public class MidiEvent {
+ public MidiEvent(MidiMessage message, long tick) {
+ //TODO
+ }
+
+ public MidiMessage getMessage() {
+ //TODO
+ return null;
+ }
+
+ public long getTick() {
+ //TODO
+ return 1L;
+ }
+
+ public void setTick(long tick) {
+ //TODO
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiFileFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiFileFormat.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiFileFormat.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiFileFormat.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,78 @@
+/*
+ * 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.midi;
+
+import java.util.Map;
+
+public class MidiFileFormat {
+ public static final int UNKNOWN_LENGTH = -1;
+
+ protected int byteLength;
+
+ protected float divisionType;
+
+ protected long microsecondLength;
+
+ protected int resolution;
+
+ protected int type;
+
+ public MidiFileFormat(int type, float divisionType, int resolution, int bytes,
+ long microseconds) {
+ //TODO
+ }
+
+ public MidiFileFormat(int type, float divisionType, int resolution, int bytes,
+ long microseconds, Map<String, Object> properties) {
+ //TODO
+ }
+
+ public int getByteLength() {
+ //TODO
+ return 1;
+ }
+
+ public float getDivisionType() {
+ //TODO
+ return 1.0F;
+ }
+
+ public long getMicrosecondLength() {
+ //TODO
+ return 1L;
+ }
+
+ public Object getProperty(String key) {
+ //TODO
+ return null;
+ }
+
+ public int getResolution() {
+ //TODO
+ return 1;
+ }
+
+ public int getType() {
+ //TODO
+ return 1;
+ }
+
+ public Map<String, Object> properties() {
+ //TODO
+ return null;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiFileFormat.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,73 @@
+/*
+ * 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.midi;
+
+public abstract class MidiMessage implements Cloneable {
+ private int status;
+
+ protected byte[] data;
+
+ protected int length;
+
+ protected MidiMessage(byte[] data) {
+ if (data == null || data.length == 0) {
+ data = null;
+ } else {
+ length = data.length;
+ status = (int) (data[0] & 0xFF);
+ this.data = data.clone();
+ }
+ }
+
+ public abstract Object clone();
+
+ public int getLength() {
+ return length;
+ }
+
+ public byte[] getMessage() {
+ return data.clone();
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ protected void setMessage(byte[] data, int length) throws InvalidMidiDataException {
+ //FIXME
+ /**
+ * this method should throw out IndexOutOfBoundsException when
+ * I use negative length
+ */
+ if (length < 0)
+ throw new IndexOutOfBoundsException();
+
+ byte[] tdata = new byte[length];
+ if (length == 0 && data != null) {
+ status = 0;
+ } else {
+ for (int i = 0; i < length; i++) {
+ tdata[i] = data[i];
+ }
+ status = (int) (data[0] & 0xFF);
+ this.length = length;
+ }
+ this.length = length;
+ this.data = tdata;
+
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,142 @@
+/*
+ * 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.midi;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+public class MidiSystem {
+ public static MidiDevice getMidiDevice(MidiDevice.Info info)
+ throws MidiUnavailableException {
+ //TODO
+ return null;
+ }
+
+ public static MidiDevice.Info[] getMidiDeviceInfo() {
+ //TODO
+ return null;
+ }
+
+ public static MidiFileFormat getMidiFileFormat(File file) throws InvalidMidiDataException,
+ IOException {
+ //TODO
+ return null;
+ }
+
+ public static MidiFileFormat getMidiFileFormat(InputStream stream)
+ throws InvalidMidiDataException, IOException {
+ //TODO
+ return null;
+ }
+
+ public static MidiFileFormat getMidiFileFormat(URL url) throws InvalidMidiDataException,
+ IOException {
+ //TODO
+ return null;
+ }
+
+ public static int[] getMidiFileTypes() {
+ //TODO
+ return null;
+ }
+
+ public static int[] getMidiFileTypes(Sequence sequence) {
+ //TODO
+ return null;
+ }
+
+ public static Receiver getReceiver() throws MidiUnavailableException {
+ //TODO
+ return null;
+ }
+
+ public static Sequence getSequence(File file) throws InvalidMidiDataException, IOException {
+ //TODO
+ return null;
+ }
+
+ public static Sequence getSequence(InputStream stream) throws InvalidMidiDataException,
+ IOException {
+ //TODO
+ return null;
+ }
+
+ public static Sequence getSequence(URL url) throws InvalidMidiDataException, IOException {
+ //TODO
+ return null;
+ }
+
+ public static Sequencer getSequencer() throws MidiUnavailableException {
+ //TODO
+ return null;
+ }
+
+ public static Sequencer getSequencer(boolean connected) throws MidiUnavailableException {
+ //TODO
+ return null;
+ }
+
+ public static Soundbank getSoundbank(File file) throws InvalidMidiDataException,
+ IOException {
+ //TODO
+ return null;
+ }
+
+ public static Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException,
+ IOException {
+ //TODO
+ return null;
+ }
+
+ public static Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException {
+ //TODO
+ return null;
+ }
+
+ public static Synthesizer getSynthesizer() throws MidiUnavailableException {
+ //TODO
+ return null;
+ }
+
+ public static Transmitter getTransmitter() throws MidiUnavailableException {
+ //TODO
+ return null;
+ }
+
+ public static boolean isFileTypeSupported(int fileType) {
+ //TODO
+ return false;
+ }
+
+ public static boolean isFileTypeSupported(int fileType, Sequence sequence) {
+ //TODO
+ return false;
+ }
+
+ public static int write(Sequence in, int type, File out) throws IOException {
+ //TODO
+ return 1;
+ }
+
+ public static int write(Sequence in, int fileType, OutputStream out) throws IOException {
+ //TODO
+ return 1;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiUnavailableException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiUnavailableException.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiUnavailableException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiUnavailableException.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,29 @@
+/*
+ * 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.midi;
+
+public class MidiUnavailableException extends Exception {
+ private static final long serialVersionUID = 6093809578628944323L;
+
+ public MidiUnavailableException() {
+ super();
+ }
+
+ public MidiUnavailableException(String message) {
+ super(message);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiUnavailableException.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Patch.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Patch.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Patch.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Patch.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,36 @@
+/*
+ * 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.midi;
+
+public class Patch {
+ private int bank;
+
+ private int program;
+
+ public Patch(int bank, int program) {
+ this.bank = bank;
+ this.program = program;
+ }
+
+ public int getBank() {
+ return bank;
+ }
+
+ public int getProgram() {
+ return program;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Patch.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Receiver.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Receiver.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Receiver.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Receiver.java Sat Jul 22 14:05:04 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.midi;
+
+public interface Receiver {
+ void close();
+
+ void send(MidiMessage message, long timeStamp);
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Receiver.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequence.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequence.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequence.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequence.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,87 @@
+/*
+ * 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.midi;
+
+import java.util.Vector;
+
+public class Sequence {
+ public static final float PPQ = 0.0f;
+
+ public static final float SMPTE_24 = 24.0f;
+
+ public static final float SMPTE_25 = 25.0f;
+
+ public static final float SMPTE_30 = 30.0f;
+
+ public static final float SMPTE_30DROP = 29.969999313354492f;
+
+ protected float divisionType;
+
+ protected int resolution;
+
+ protected Vector<Track> tracks;
+
+ public Sequence(float divisionType, int resolution) throws InvalidMidiDataException {
+ //TODO
+ }
+
+ public Sequence(float divisionType, int resolution, int numTracks)
+ throws InvalidMidiDataException {
+ //TODO
+ }
+
+ public Track createTrack() {
+ //TODO
+ return null;
+ }
+
+ public boolean deleteTrack(Track track) {
+ //TODO
+ return false;
+ }
+
+ public float getDivisionType() {
+ //TODO
+ return 1.0f;
+ }
+
+ public long getMicrosecondLength() {
+ //TODO
+ return 1L;
+ }
+
+ public Patch[] getPatchList() {
+ //TODO
+ return null;
+ }
+
+ public int getResolution() {
+ //TODO
+ return 1;
+ }
+
+ public long getTickLength() {
+ //TODO
+ return 1L;
+ }
+
+ public Track[] getTracks() {
+ //TODO
+ return null;
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequence.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,154 @@
+/*
+ * 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.midi;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public interface Sequencer extends MidiDevice {
+ int LOOP_CONTINUOUSLY = -1;
+
+ class SyncMode {
+ public static final SyncMode INTERNAL_CLOCK = new SyncMode("INTERNAL_CLOCK");
+
+ public static final SyncMode MIDI_SYNC = new SyncMode("MIDI_SYNC");
+
+ public static final SyncMode MIDI_TIME_CODE = new SyncMode("MIDI_TIME_CODE");
+
+ public static final SyncMode NO_SYNC = new SyncMode("NO_SYNC");
+
+ private String name;
+
+ protected SyncMode(String name) {
+ this.name = name;
+ }
+
+ public final boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SyncMode other = (SyncMode) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+ public final int hashCode() {
+ final int PRIME = 31;
+ int result = super.hashCode();
+ result = PRIME * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ public final String toString() {
+ return name;
+ }
+ }
+
+ int[] addControllerEventListener(ControllerEventListener listener, int[] controllers);
+
+ boolean addMetaEventListener(MetaEventListener listener);
+
+ int getLoopCount();
+
+ long getLoopEndPoint();
+
+ long getLoopStartPoint();
+
+ Sequencer.SyncMode getMasterSyncMode();
+
+ Sequencer.SyncMode[] getMasterSyncModes();
+
+ long getMicrosecondLength();
+
+ long getMicrosecondPosition();
+
+ Sequence getSequence();
+
+ Sequencer.SyncMode getSlaveSyncMode();
+
+ Sequencer.SyncMode[] getSlaveSyncModes();
+
+ float getTempoFactor();
+
+ float getTempoInBPM();
+
+ float getTempoInMPQ();
+
+ long getTickLength();
+
+ long getTickPosition();
+
+ boolean getTrackMute(int track);
+
+ void getTrackSolo(int track, boolean solo);
+
+ boolean isRecording();
+
+ boolean isRunning();
+
+ void recordDisable(Track track);
+
+ void recordEnable(Track track, int channel);
+
+ int[] removeControllerEventListener(ControllerEventListener listener, int[] controllers);
+
+ void removeMetaEventListener(MetaEventListener listener);
+
+ void setLoopCount(int count);
+
+ void setLoopEndPoint(long tick);
+
+ void setLoopStartPoint(long tick);
+
+ void setMasterSyncMode(Sequencer.SyncMode sync);
+
+ void setMicrosecondPosition(long microseconds);
+
+ void setSequence(InputStream stream) throws IOException, InvalidMidiDataException;
+
+ void setSequence(Sequence sequence) throws InvalidMidiDataException;
+
+ void setSlaveSyncMode(Sequencer.SyncMode sync);
+
+ void setTempoFactor(float factor);
+
+ void setTempoInBPM(float bpm);
+
+ void setTempoInMPQ(float mpq);
+
+ void setTickPosition(long tick);
+
+ void setTrackMute(int track, boolean mute);
+
+ void setTrackSolo(int track, boolean solo);
+
+ void start();
+
+ void startRecording();
+
+ void stop();
+
+ void stopRecording();
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,109 @@
+/*
+ * 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.midi;
+
+public class ShortMessage extends MidiMessage {
+ public static final int ACTIVE_SENSING = 254;
+
+ public static final int CHANNEL_PRESSURE = 208;
+
+ public static final int CONTINUE = 251;
+
+ public static final int CONTROL_CHANGE = 176;
+
+ public static final int END_OF_EXCLUSIVE = 247;
+
+ public static final int MIDI_TIME_CODE = 241;
+
+ public static final int NOTE_OFF = 128;
+
+ public static final int NOTE_ON = 144;
+
+ public static final int PITCH_BEND = 224;
+
+ public static final int POLY_PRESSURE = 160;
+
+ public static final int PROGRAM_CHANGE = 192;
+
+ public static final int SONG_POSITION_POINTER = 242;
+
+ public static final int SONG_SELECT = 243;
+
+ public static final int START = 250;
+
+ public static final int STOP = 252;
+
+ public static final int SYSTEM_RESET = 255;
+
+ public static final int TIMING_CLOCK = 248;
+
+ public static final int TUNE_REQUEST = 246;
+
+ public ShortMessage() {
+ //TODO
+ super(null);
+ }
+
+ protected ShortMessage(byte[] data) {
+ //TODO
+ super(data);
+ }
+
+ public Object clone() {
+ //TODO
+ return null;
+ }
+
+ public int getChannel() {
+ //TODO
+ return 1;
+ }
+
+ public int getCommand() {
+ //TODO
+ return 1;
+ }
+
+ public int getData1() {
+ //TODO
+ return 1;
+ }
+
+ public int getData2() {
+ //TODO
+ return 1;
+ }
+
+ protected final int getDataLength(int status) throws InvalidMidiDataException {
+ //TODO
+ return 1;
+ }
+
+ public void setMessage(int status) throws InvalidMidiDataException {
+ //TODO
+ }
+
+ public void setMessage(int status, int data1, int data2) throws InvalidMidiDataException {
+ //TODO
+ }
+
+ public void setMessage(int command, int channel, int data1, int data2)
+ throws InvalidMidiDataException {
+ //TODO
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Soundbank.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Soundbank.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Soundbank.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Soundbank.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.midi;
+
+public interface Soundbank {
+ String getDescription();
+
+ Instrument getInstrument(Patch patch);
+
+ Instrument[] getInstruments();
+
+ String getName();
+
+ SoundbankResource[] getResources();
+
+ String getVendor();
+
+ String getVersion();
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Soundbank.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SoundbankResource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SoundbankResource.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SoundbankResource.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SoundbankResource.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,44 @@
+/*
+ * 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.midi;
+
+public abstract class SoundbankResource {
+ private Soundbank soundbank;
+ private String name;
+ private Class<?> dataClass;
+
+ protected SoundbankResource(Soundbank soundbank, String name, Class<?> dataClass) {
+ super();
+ this.soundbank = soundbank;
+ this.name = name;
+ this.dataClass = dataClass;
+ }
+
+ public abstract Object getData();
+
+ public Class<?> getDataClass() {
+ return dataClass;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Soundbank getSoundbank() {
+ return soundbank;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SoundbankResource.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Synthesizer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Synthesizer.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Synthesizer.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Synthesizer.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,49 @@
+/*
+ * 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.midi;
+
+public interface Synthesizer extends MidiDevice {
+ Instrument[] getAvailableInstruments();
+
+ MidiChannel[] getChannels();
+
+ Soundbank getDefaultSoundbank();
+
+ long getLatency();
+
+ Instrument[] getLoadedInstruments();
+
+ int getMaxPolyphony();
+
+ VoiceStatus[] getVoiceStatus();
+
+ boolean isSoundbankSupported(Soundbank soundbank);
+
+ boolean loadAllInstruments(Soundbank soundbank);
+
+ boolean loadInstrument(Instrument instrument);
+
+ boolean loadInstruments(Soundbank soundbank, Patch[] patchList);
+
+ boolean remapInstrument(Instrument from, Instrument to);
+
+ void unloadAllInstruments(Soundbank soundbank);
+
+ void unloadInstrument(Instrument instrument);
+
+ void unloadInstruments(Soundbank soundbank, Patch[] patchList);
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Synthesizer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,50 @@
+/*
+ * 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.midi;
+
+public class SysexMessage extends MidiMessage {
+ public static final int SPECIAL_SYSTEM_EXCLUSIVE = 247;
+
+ public static final int SYSTEM_EXCLUSIVE = 240;
+
+ public SysexMessage() {
+ //TODO
+ super(null);
+ }
+
+ protected SysexMessage(byte[] data) {
+ super(data);
+ }
+
+ public Object clone() {
+ //TODO
+ return null;
+ }
+
+ public byte[] getData() {
+ //TODO
+ return null;
+ }
+
+ public void setMessage(byte[] data, int length) throws InvalidMidiDataException {
+ //TODO
+ }
+
+ public void setMessage(int status, byte[] data, int length) throws InvalidMidiDataException {
+ //TODO
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,44 @@
+/*
+ * 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.midi;
+
+public class Track {
+ public boolean add(MidiEvent event) {
+ //TODO
+ return false;
+ }
+
+ public MidiEvent get(int index) throws ArrayIndexOutOfBoundsException {
+ //TODO
+ return null;
+ }
+
+ public boolean remove(MidiEvent event) {
+ //TODO
+ return false;
+ }
+
+ public int size() {
+ //TODO
+ return 1;
+ }
+
+ public long ticks() {
+ //TODO
+ return 1L;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Transmitter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Transmitter.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Transmitter.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Transmitter.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,26 @@
+/*
+ * 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.midi;
+
+public interface Transmitter {
+ void close();
+
+ Receiver getReceiver();
+
+ void setReceiver(Receiver receiver);
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Transmitter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/VoiceStatus.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/VoiceStatus.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/VoiceStatus.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/VoiceStatus.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,35 @@
+/*
+ * 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.midi;
+
+public class VoiceStatus {
+ public boolean active;
+
+ public int bank;
+
+ public int channel;
+
+ public int note;
+
+ public int program;
+
+ public int volume;
+
+ public VoiceStatus() {
+ // TODO
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/VoiceStatus.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.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/InstrumentTest.java?rev=424630&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java Sat Jul 22 14:05:04 2006
@@ -0,0 +1,74 @@
+/*
+ * 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 org.apache.harmony.sound.tests.javax.sound.midi;
+
+import javax.sound.midi.Instrument;
+import javax.sound.midi.Patch;
+import javax.sound.midi.Soundbank;
+
+import junit.framework.TestCase;
+
+public class InstrumentTest extends TestCase {
+ /**
+ * Test the method Instrument.getPatch()
+ */
+ public void test_getPatch() {
+ Instrument1 inst = new Instrument1(null, null, null, null);
+ assertNull(inst.getPatch());
+
+ Instrument1 inst2 = new Instrument1(null, new Patch(10, 20), "Test", null);
+ assertEquals(10, inst2.getPatch().getBank());
+ assertEquals(20, inst2.getPatch().getProgram());
+
+ Instrument1 inst3 = new Instrument1(null, new Patch(-10, 208), "Test", null);
+ assertEquals(-10, inst3.getPatch().getBank());
+ assertEquals(208, inst3.getPatch().getProgram());
+ }
+
+ /**
+ * Test the method Instrument.getName()
+ */
+ public void test_getName() {
+ Instrument1 inst = new Instrument1(null, null, null, null);
+ assertNull(inst.getName());
+
+ Instrument1 inst2 = new Instrument1(null, new Patch(10, 20), "Test", null);
+ assertEquals("Test",inst2.getName());
+ }
+
+ /**
+ * Test the method Instrument.getDataClass()
+ */
+ public void test_getDataClass() {
+ Instrument1 inst = new Instrument1(null, null, null, null);
+ assertNull(inst.getDataClass());
+ }
+
+ /**
+ * Subsidiary class in order to use constructor
+ * of class Instrument, because it declared as protected
+ */
+ static class Instrument1 extends Instrument {
+ Instrument1(Soundbank soundbank, Patch patch, String name, Class<?> dataClass) {
+ super(soundbank, patch, name, dataClass);
+ }
+
+ public Object getData() {
+ return null;
+ }
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java
------------------------------------------------------------------------------
svn:eol-style = native