Previous  Next          Package

Class MIDICompose.MIDIContainer

java.lang.Object
   |
   +----MIDICompose.MIDIObject
           |
           +----MIDICompose.MIDIContainer

public class MIDIContainer
extends MIDIObject
implements Channelable, Lengthable

A MIDIContainer can store any MIDIObjects. Each new element is appended after the last one. If the length of the MIDIContainer is changed, all MIDIObjects deltaTimes (and lengths if Lengthable) are changed to a new value. If the MIDIContainer is turned round, the last element will become the first one and vice versa. Sometimes you will need objects that are compact and can't be turned round. Set type to LINKED. A LINKED MIDIContainer will turn round all elements that can turn round, but the order of the elements will not be changed. If you want your objects to be absolute in time, set type to ABSOLUTE. Default type is FREE. A MIDIContainer can store MIDIObjects that send on all MIDI-channels. If you want to send only on one MIDI-channel you have to enable channelable. If you do so, all old and new elements that are Channelable, will set to the same channel.

Variable Index

 o ABSOLUTE
Methods setLength() and turnRound() are disabled.
 o FREE
All methods work.
 o LINKED
Method turnRound() will not change the order in MIDIContainer but only turn round its elements.

Constructor Index

 o MIDIContainer()
Creates new MIDIContainer.
 o MIDIContainer(int)
Creates new MIDIContainer that only sends on one channel.
 o MIDIContainer(int, int)
Creates new MIDIContainer with deltaTime and type.
 o MIDIContainer(int, int, int)
Creates new MIDIContainer with deltaTime and type that only sends on one channel.
 o MIDIContainer(MIDIContainer)
Creates new MIDIContainer that is equal to another one.

Method Index

All methods from interfaces are implemented, but not listed here!
 o append(MIDIObject)
Appends a copy of a MIDIObject.
 o appendAt(MIDIObject, int)
Appends a copy of a MIDIObject at a certain position.
 o channelable()
Returns whether MIDIContainer is channelable or not.
 o position()
Returns current position.
 o type()
Returns type.
 o setChannelable(int)
Sets MIDIContainer to send only on one channel.
 o setPosition(int)
Sets position to which next MIDIObject will be appended.
 o setType(int)
Sets type.

 o amountAt(int)
Returns amount at index (or -1 if element at index is not Amountable).
 o channelAt(int)
Returns channel at index (or -1 if element at index is not Channelable).
 o deltaTimeAt(int)
Returns deltaTime at index.
 o lengthAt(int)
Returns length at index (or 0 if element at index is not Lengthable).
 o pitchAt(int)
Returns pitch at index (or -1 if element at index is not Pitchable).
 o setAmountAt(int, int)
Sets amount at index (if element at index is Amountable).
 o setChannelAt(int, int)
Sets channel at index (if element at index is Channelable).
 o setDeltaTimeAt(int, int)
Sets delteTime at index.
 o setLengthAt(int, int)
Sets length at index (if element at index is Lengthable).
 o setPitchAt(int, int)
Sets pitch at index (if element at index is Pitchable).

Constructors

 o MIDIContainer
 public MIDIContainer()
Creates a new FREE-typed MIDIContainer that can send on all channels.
 o MIDIContainer
 public MIDIContainer(int channel)
Creates a new FREE-typed MIDIContainer that only sends on one channel.

Parameters:
channel - any int between 0 and 15 (CHAN_1...CHAN_16).
 o MIDIContainer
 public MIDIContainer(int deltaTime,
                      int type,
                      int channel)
Creates a new MIDIContainer that only sends on one channel.

Parameters:
deltaTime - any int (>= 0).
type - FREE, LINKED or ABSOLUTE.
channel - any int between 0 and 15 (CHAN_1...CHAN_16).
 o MIDIContainer
 public MIDIContainer(int deltaTime,
                      int type)
Creates a new MIDIContainer that can send on all channels.

Parameters:
deltaTime - any int (>= 0).
type - FREE, LINKED or ABSOLUTE.
 o MIDIContainer
 protected MIDIContainer(MIDIContainer object)
Creates a new MIDIContainer that is a copy of object.

Parameters:
object - any MIDIContainer.

Methods

 o append
 public void append(MIDIObject object)
Appends a copy of object at the current position and sets position after its end.

Parameters:
object - any MIDIObject.
 o appendAt
 public void appendAt(MIDIObject object,
                      int position)
Appends a copy of object at position and sets position after its end.

Parameters:
object - any MIDIObject.
position - any int (>= 0).
 o channelable
 public boolean channelable()
Returns whether this is channelable or not.

Returns:
false if this can send on all channels, true if it only sends on one channel.
 o setChannelable
 public void setChannelable(int channel)
Sets channelable to true and the MIDI-channel to channel.

Parameters:
channel - any int between 0 and 15 (CHAN_1...CHAN_16).
 o type
 public int type()
Returns the current type.

Returns:
FREE, LINKED or ABSOLUTE.
 o setType
 public void setType(int type)
Sets the type.

Parameters:
type - FREE, LINKED or ABSOLUTE.
 o position
 public int position()
Returns the current position.

Returns:
any int (>= 0).
 o setPosition
 public void setPosition(int position)
Sets the position.

Parameters:
position - any int (>= 0).

 Previous  Next          Package