com.frinika.sequencer.model
Class NoteEvent

java.lang.Object
  extended by com.frinika.sequencer.model.MultiEvent
      extended by com.frinika.sequencer.model.ChannelEvent
          extended by com.frinika.sequencer.model.NoteEvent
All Implemented Interfaces:
Item, EditHistoryRecordable, Selectable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class NoteEvent
extends ChannelEvent

Author:
Peter Johan Salomonsen
See Also:
Serialized Form

Nested Class Summary
static class NoteEvent.EndComparator
           
static class NoteEvent.NoteComparator
           
static class NoteEvent.StartComparator
          Utility comparators for sorted sets.
 
Field Summary
static NoteEvent.EndComparator endComparator
           
static java.util.Comparator<NoteEvent> noteComparator
           
static NoteEvent.StartComparator startComparator
           
 
Fields inherited from class com.frinika.sequencer.model.MultiEvent
startTick
 
Constructor Summary
NoteEvent(FrinikaTrackWrapper track, long startTick, int note, int velocity, int channel, long duration)
          Deprecated.  
NoteEvent(MidiPart part, long startTick, int note, int velocity, int channel, long duration)
           
 
Method Summary
 void commitAddImpl()
          Add the MidiEvents generated by this MultiEvent to the track
 long getDuration()
           
 long getEndTick()
          sub classes should override this.
 int getNote()
           
 java.lang.String getNoteName()
           
 int getValue()
           
 int getVelocity()
           
 boolean isDrumHit()
           
 void restoreFromClone(EditHistoryRecordable object)
          On removal the EditHistoryContainer will attempt to clone the object - and if restored later it will use the restoreFromClone method to restore the cloned data on the original instance.
 long rightTickForMove()
          PLease override if need be
 void setDuration(long duration)
           
 void setEndEvent(javax.sound.midi.MidiEvent endEvent)
           
 void setNote(int note)
           
 void setValue(int val)
           
 void setVelocity(int velocity)
           
 void validate()
          PJL HACK NOT DO NOT USE
 
Methods inherited from class com.frinika.sequencer.model.ChannelEvent
getChannel, setChannel
 
Methods inherited from class com.frinika.sequencer.model.MultiEvent
addToModel, clone, commitAdd, commitChanges, compareTo, deepCopy, deepMove, detachedCopy, getMidiPart, getMultiEventEndTickComparable, getPart, getStartTick, getTrack, getTrackerColumn, getValueUI, isSelected, isZombie, leftTickForMove, removeFromModel, setSelected, setStartTick, setTrackerColumn, setValueUI
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noteComparator

public static final java.util.Comparator<NoteEvent> noteComparator

startComparator

public static final NoteEvent.StartComparator startComparator

endComparator

public static final NoteEvent.EndComparator endComparator
Constructor Detail

NoteEvent

public NoteEvent(FrinikaTrackWrapper track,
                 long startTick,
                 int note,
                 int velocity,
                 int channel,
                 long duration)
Deprecated. 

Constructor for creating a note event. For registering the new note event in the track use FrinikaTrackWrapper.add(MultiEvent evt)

Parameters:
track -
startTick -
note -
velocity -
channel -
duration -

NoteEvent

public NoteEvent(MidiPart part,
                 long startTick,
                 int note,
                 int velocity,
                 int channel,
                 long duration)
Parameters:
group -
startTick -
note -
velocity -
channel -
duration -
Method Detail

setEndEvent

public void setEndEvent(javax.sound.midi.MidiEvent endEvent)

getEndTick

public long getEndTick()
Description copied from class: MultiEvent
sub classes should override this.

Specified by:
getEndTick in class MultiEvent
Returns:
Returns the endTick

getNote

public int getNote()

getNoteName

public java.lang.String getNoteName()

setNote

public void setNote(int note)

getVelocity

public int getVelocity()

setVelocity

public void setVelocity(int velocity)

getDuration

public long getDuration()
Returns:
Returns the duration.

setDuration

public void setDuration(long duration)
Parameters:
duration - The duration to set.

commitAddImpl

public void commitAddImpl()
Description copied from class: MultiEvent
Add the MidiEvents generated by this MultiEvent to the track


restoreFromClone

public void restoreFromClone(EditHistoryRecordable object)
Description copied from interface: EditHistoryRecordable
On removal the EditHistoryContainer will attempt to clone the object - and if restored later it will use the restoreFromClone method to restore the cloned data on the original instance.


setValue

public void setValue(int val)
Overrides:
setValue in class MultiEvent

getValue

public int getValue()
Overrides:
getValue in class MultiEvent

rightTickForMove

public long rightTickForMove()
Description copied from class: MultiEvent
PLease override if need be

Specified by:
rightTickForMove in interface Selectable
Overrides:
rightTickForMove in class MultiEvent

isDrumHit

public boolean isDrumHit()

validate

public void validate()
PJL HACK NOT DO NOT USE