Index: modules/sound/src/main/java/common/javax/sound/midi/Patch.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/Patch.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/Patch.java (revision 0) @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +package javax.sound.midi; + +public class Patch +{ + public Patch( int bank, int program ) + { + //TODO + } + + public int getBank() + { + //TODO + return 1; + } + + public int getProgram() + { + //TODO + return 1; + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/InvalidMidiDataException.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/InvalidMidiDataException.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/InvalidMidiDataException.java (revision 0) @@ -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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +package javax.sound.midi; + +public class InvalidMidiDataException extends Exception +{ + public InvalidMidiDataException() + { + //TODO + } + + public InvalidMidiDataException( String message ) + { + //TODO + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/Track.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/Track.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/Track.java (revision 0) @@ -0,0 +1,55 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +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; + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/MidiEvent.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/MidiEvent.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/MidiEvent.java (revision 0) @@ -0,0 +1,46 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +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 + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/MidiUnavailableException.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/MidiUnavailableException.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/MidiUnavailableException.java (revision 0) @@ -0,0 +1,14 @@ +package javax.sound.midi; + +public class MidiUnavailableException extends Exception +{ + public MidiUnavailableException() + { + //TODO + } + + public MidiUnavailableException( String message ) + { + //TODO + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/MidiMessage.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/MidiMessage.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/MidiMessage.java (revision 0) @@ -0,0 +1,90 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +package javax.sound.midi; + +public abstract class MidiMessage implements Cloneable +{ + private int m_status; + + protected byte[] data; + protected int length; + + protected MidiMessage( byte[] data ) + { + if( data == null || data.length == 0 ) + { + data = null; + } + else + { + length = data.length; + m_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 m_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 ) + { + m_status = 0; + } + else + { + for( int i = 0; i < length; i++ ) + { + tdata[i] = data[i]; + } + m_status = (int)( data[0] & 0xFF ); + this.length = length; + } + this.length = length; + this.data = tdata; + + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/MidiSystem.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/MidiSystem.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/MidiSystem.java (revision 0) @@ -0,0 +1,178 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +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; + } +} \ No newline at end of file Index: modules/sound/src/main/java/common/javax/sound/midi/Sequence.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/Sequence.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/Sequence.java (revision 0) @@ -0,0 +1,98 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +package javax.sound.midi; + +import java.util.Vector; + +public class Sequence +{ + protected float divisionType; + protected int resolution; + protected Vector tracks; + + 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; + + 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; + } + + +} Index: modules/sound/src/main/java/common/javax/sound/midi/VoiceStatus.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/VoiceStatus.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/VoiceStatus.java (revision 0) @@ -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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +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 + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/MidiFileFormat.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/MidiFileFormat.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/MidiFileFormat.java (revision 0) @@ -0,0 +1,88 @@ +/* + * 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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +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 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 properties() + { + //TODO + return null; + } +} Index: modules/sound/src/main/java/common/javax/sound/midi/SoundbankResource.java =================================================================== --- modules/sound/src/main/java/common/javax/sound/midi/SoundbankResource.java (revision 0) +++ modules/sound/src/main/java/common/javax/sound/midi/SoundbankResource.java (revision 0) @@ -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. + */ + +/** + * @author Evgeny S. Sidorenko + */ + +package javax.sound.midi; + +public abstract class SoundbankResource +{ + protected SoundbankResource( Soundbank soundBank, String name, Class dataClass ) + { + //TODO + } + + public abstract Object getData(); + + public Class getDataClass() + { + //TODO + return null; + } + + public String getName() + { + //TODO + return null; + } + + public Soundbank getSoundbank() + { + //TODO + return null; + } +}