com.frinika.sequencer.model
Class MultiEvent

java.lang.Object
  extended by com.frinika.sequencer.model.MultiEvent
All Implemented Interfaces:
Item, EditHistoryRecordable, Selectable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
ChannelEvent, MetaEvent, NotationEvent, SubsetMultiEvent, SysexEvent

public abstract class MultiEvent
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable, EditHistoryRecordable, Item, Selectable, java.lang.Cloneable

MultiEvent is a representation of one or more MidiEvents that form a note pair, a control change/pitch bend envelope or a single MidiEvent. Note that the clone() method must be implemented for all non-abstract extensions of the MultiEvent class. This is for the edithistory to work properly.

Author:
Peter Johan Salomonsen
See Also:
Serialized Form

Field Summary
protected  long startTick
           
 
Constructor Summary
  MultiEvent(FrinikaTrackWrapper track, long startTick)
          Deprecated.  
protected MultiEvent(long startTick)
           
  MultiEvent(MidiPart part, long startTick)
           
 
Method Summary
 void addToModel()
          Add to the model making sure the history is informed
 java.lang.Object clone()
          If restoration from a clone is needed - this method should return a clone otherwise throw the CloneNotSupportedException
 void commitAdd()
          Add the MidiEvents generated by this MultiEvent to the track and fire CommitEvent to CommitListener
 void commitChanges()
          Deprecated. Do not use this - it was previously used by processors - but they're broken - the correct procedure is: remove from part - change - add to part again
 int compareTo(java.lang.Object obj)
           
 Selectable deepCopy(Selectable parent)
          Complete copy of object.
 void deepMove(long tick)
          Move object and all children by tick
 MultiEvent detachedCopy()
          Create a parentless copy to allow serialiation without explosions
abstract  long getEndTick()
          sub classes should override this.
 MidiPart getMidiPart()
           
 MultiEventEndTickComparable getMultiEventEndTickComparable()
          Get a comparable wrapper for sorting on end tick
 MidiPart getPart()
           
 long getStartTick()
           
 FrinikaTrackWrapper getTrack()
          Deprecated.  
 java.lang.Integer getTrackerColumn()
          The prefered column to use in a tracker view.
 int getValue()
           
 int getValueUI()
           
 boolean isSelected()
           
 boolean isZombie()
           
 long leftTickForMove()
          return the left tick mark for move operations without quantize a move to destTick should move item by destTick - leftTickForMove();
 void removeFromModel()
          Remove from model making sure the history is informed
 long rightTickForMove()
          PLease override if need be
 void setSelected(boolean yes)
          set selected flag (for GUI use only)
 void setStartTick(long startTick)
           
 void setTrackerColumn(int column)
           
 void setValue(int val)
           
 void setValueUI(int val)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.frinika.sequencer.model.EditHistoryRecordable
restoreFromClone
 

Field Detail

startTick

protected long startTick
Constructor Detail

MultiEvent

protected MultiEvent(long startTick)

MultiEvent

public MultiEvent(FrinikaTrackWrapper track,
                  long startTick)
Deprecated. 

Parameters:
track -
startTick -

MultiEvent

public MultiEvent(MidiPart part,
                  long startTick)
Method Detail

getStartTick

public long getStartTick()
Returns:
Returns the startTick.

getEndTick

public abstract long getEndTick()
sub classes should override this.

Returns:
Returns the endTick

setStartTick

public void setStartTick(long startTick)
Parameters:
startTick - The startTick to set.

getTrack

public final FrinikaTrackWrapper getTrack()
Deprecated. 

Returns:

getMidiPart

public MidiPart getMidiPart()

commitAdd

public void commitAdd()
Add the MidiEvents generated by this MultiEvent to the track and fire CommitEvent to CommitListener


commitChanges

public void commitChanges()
Deprecated. Do not use this - it was previously used by processors - but they're broken - the correct procedure is: remove from part - change - add to part again

This method will be run by the processor handler


compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

setSelected

public void setSelected(boolean yes)
Description copied from interface: Selectable
set selected flag (for GUI use only)

Specified by:
setSelected in interface Item
Specified by:
setSelected in interface Selectable

isSelected

public boolean isSelected()
Specified by:
isSelected in interface Item

detachedCopy

public MultiEvent detachedCopy()
Create a parentless copy to allow serialiation without explosions


deepCopy

public Selectable deepCopy(Selectable parent)
Description copied from interface: Selectable
Complete copy of object.

Specified by:
deepCopy in interface Selectable
Parameters:
parent - owner of the new object;
Returns:

getPart

public MidiPart getPart()

getValue

public int getValue()

setValue

public void setValue(int val)

getValueUI

public int getValueUI()

setValueUI

public void setValueUI(int val)

deepMove

public void deepMove(long tick)
Description copied from interface: Selectable
Move object and all children by tick

Specified by:
deepMove in interface Selectable

removeFromModel

public void removeFromModel()
Description copied from interface: Selectable
Remove from model making sure the history is informed

Specified by:
removeFromModel in interface Selectable

addToModel

public void addToModel()
Description copied from interface: Selectable
Add to the model making sure the history is informed

Specified by:
addToModel in interface Selectable

leftTickForMove

public long leftTickForMove()
Description copied from interface: Selectable
return the left tick mark for move operations without quantize a move to destTick should move item by destTick - leftTickForMove();

Specified by:
leftTickForMove in interface Selectable
Returns:

rightTickForMove

public long rightTickForMove()
PLease override if need be

Specified by:
rightTickForMove in interface Selectable

getTrackerColumn

public java.lang.Integer getTrackerColumn()
The prefered column to use in a tracker view. In case of no prefered column NULL is returned

Returns:

setTrackerColumn

public void setTrackerColumn(int column)

getMultiEventEndTickComparable

public MultiEventEndTickComparable getMultiEventEndTickComparable()
Get a comparable wrapper for sorting on end tick

Returns:

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: EditHistoryRecordable
If restoration from a clone is needed - this method should return a clone otherwise throw the CloneNotSupportedException

Specified by:
clone in interface EditHistoryRecordable
Overrides:
clone in class java.lang.Object
Returns:
Throws:
java.lang.CloneNotSupportedException

isZombie

public boolean isZombie()