uk.org.toot.midi.core.channel
Class ChannelReadWriteMidiInput

java.lang.Object
  extended by uk.org.toot.midi.core.channel.ChannelReadWriteMidiInput
All Implemented Interfaces:
MidiChannelReaderProvider, MidiChannelWriterProvider, MidiInput, MidiPort, MidiTransport

public class ChannelReadWriteMidiInput
extends java.lang.Object
implements MidiInput, MidiChannelReaderProvider, MidiChannelWriterProvider

This implementation class is intended to be used by midi synthesizers. It provides a rich channel-based read/write API. It is provided as a MidiInput adapter which simplifies decoding the written state for reads. As such it is suitable for use with external midi synths. May not be suitable to implement a midi synth though, that probably needs the state we decode!!!

Author:
Steve Taylor

Constructor Summary
ChannelReadWriteMidiInput(MidiInput input)
           
 
Method Summary
 void firePropertyChange(java.lang.String property, int index, int oldVal, int newVal)
          A convenience method for the MidiChannels.
 MidiChannelReader getChannelReader(int chan)
          Return a MidiChannelReader for the specified channel index.
 MidiChannelWriter getChannelWriter(int chan)
          Return a MidiChannelWriter for the specified channel index.
 java.lang.String getName()
           
 java.beans.PropertyChangeSupport getPropertyChangeSupport()
           
 void transport(javax.sound.midi.MidiMessage msg, long timestamp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelReadWriteMidiInput

public ChannelReadWriteMidiInput(MidiInput input)
                          throws javax.sound.midi.MidiUnavailableException
Throws:
javax.sound.midi.MidiUnavailableException
Method Detail

getChannelReader

public MidiChannelReader getChannelReader(int chan)
Description copied from interface: MidiChannelReaderProvider
Return a MidiChannelReader for the specified channel index.

Specified by:
getChannelReader in interface MidiChannelReaderProvider

getChannelWriter

public MidiChannelWriter getChannelWriter(int chan)
Description copied from interface: MidiChannelWriterProvider
Return a MidiChannelWriter for the specified channel index.

Specified by:
getChannelWriter in interface MidiChannelWriterProvider

transport

public void transport(javax.sound.midi.MidiMessage msg,
                      long timestamp)
Specified by:
transport in interface MidiTransport

getName

public java.lang.String getName()
Specified by:
getName in interface MidiPort

getPropertyChangeSupport

public java.beans.PropertyChangeSupport getPropertyChangeSupport()

firePropertyChange

public void firePropertyChange(java.lang.String property,
                               int index,
                               int oldVal,
                               int newVal)
A convenience method for the MidiChannels. Do not create a PropertyChangeSupport here because it won't have any listeners to fire events to!



Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.