Package com.softsynth.midifile
Class MIDIFileEvent
java.lang.Object
com.softsynth.midifile.MIDIFileEvent
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
MIDIFileSysExEvent
public class MIDIFileEvent
extends java.lang.Object
implements java.lang.Cloneable
Contains information for an event found in a MIDIFile
- Author:
- Phil Burk (C) 1999 SoftSynth.com
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MIDIFileEvent(int ticks, int command, int data1, int data2)Create an event to store a basic MIDI Message -
Method Summary
Modifier and Type Method Description java.lang.Objectclone()Clones contents of event.intgetChannel()Returns (command&0x0F)+1.intgetCommand()Returns entire command byte, eg.doublegetSeconds()intgetTicks()Returns time in ticks.voidsetSeconds(double seconds)Set time in seconds.voidsetTicks(int ticks)Set time in ticks.java.lang.StringtoString()voidwrite(MIDIFileOutput mfout)Write a MIDIFileEvent to a MIDIFile on disk.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
command
public int command -
data1
public int data1 -
data2
public int data2
-
-
Constructor Details
-
MIDIFileEvent
public MIDIFileEvent(int ticks, int command, int data1, int data2)Create an event to store a basic MIDI Message- Parameters:
ticks- MIDIFile time-stampcommand- MIDI Command, eg. NOTE_ON.data1- First data byte of message.data2- Second optional data byte of message.
-
-
Method Details
-
setTicks
public void setTicks(int ticks)Set time in ticks. -
getTicks
public int getTicks()Returns time in ticks. -
setSeconds
public void setSeconds(double seconds)Set time in seconds. -
getSeconds
public double getSeconds() -
getCommand
public int getCommand()Returns entire command byte, eg. 0x93 -
getChannel
public int getChannel()Returns (command&0x0F)+1. Only valid for ChannelMessages -
write
Write a MIDIFileEvent to a MIDIFile on disk.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
clone
public java.lang.Object clone()Clones contents of event.
-