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.
-
ABSOLUTE
- Methods setLength() and turnRound() are disabled.
-
FREE
- All methods work.
-
LINKED
- Method turnRound() will not change the order in MIDIContainer but only turn round
its elements.
-
MIDIContainer()
- Creates new MIDIContainer.
-
MIDIContainer(int)
- Creates new MIDIContainer that only sends on one channel.
-
MIDIContainer(int, int)
- Creates new MIDIContainer with deltaTime and type.
-
MIDIContainer(int, int, int)
- Creates new MIDIContainer with deltaTime and type that only sends on one channel.
-
MIDIContainer(MIDIContainer)
- Creates new MIDIContainer that is equal to another one.
All methods from interfaces are implemented, but not listed here!
-
append(MIDIObject)
- Appends a copy of a MIDIObject.
-
appendAt(MIDIObject, int)
- Appends a copy of a MIDIObject at a certain position.
-
channelable()
- Returns whether MIDIContainer is channelable or not.
-
position()
- Returns current position.
-
type()
- Returns type.
-
setChannelable(int)
- Sets MIDIContainer to send only on one channel.
-
setPosition(int)
- Sets position to which next MIDIObject will be appended.
-
setType(int)
- Sets type.
-
amountAt(int)
- Returns amount at index (or -1 if element at index is not Amountable).
-
channelAt(int)
- Returns channel at index (or -1 if element at index is not Channelable).
-
deltaTimeAt(int)
- Returns deltaTime at index.
-
lengthAt(int)
- Returns length at index (or 0 if element at index is not Lengthable).
-
pitchAt(int)
- Returns pitch at index (or -1 if element at index is not Pitchable).
-
setAmountAt(int, int)
- Sets amount at index (if element at index is Amountable).
-
setChannelAt(int, int)
- Sets channel at index (if element at index is Channelable).
-
setDeltaTimeAt(int, int)
- Sets delteTime at index.
-
setLengthAt(int, int)
- Sets length at index (if element at index is Lengthable).
-
setPitchAt(int, int)
- Sets pitch at index (if element at index is Pitchable).
MIDIContainer
public MIDIContainer()
- Creates a new FREE-typed MIDIContainer that can send on all channels.
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).
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).
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.
MIDIContainer
protected MIDIContainer(MIDIContainer object)
- Creates a new MIDIContainer that is a copy of object.
- Parameters:
- object - any MIDIContainer.
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.
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).
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.
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).
type
public int type()
- Returns the current type.
- Returns:
- FREE, LINKED or ABSOLUTE.
setType
public void setType(int type)
- Sets the type.
- Parameters:
- type - FREE, LINKED or ABSOLUTE.
position
public int position()
- Returns the current position.
- Returns:
- any int (>= 0).
setPosition
public void setPosition(int position)
- Sets the position.
- Parameters:
- position - any int (>= 0).
Previous Next Package