org.niffty
Class RiffMeasureStartTimeSlice

java.lang.Object
  |
  +--org.niffty.RiffMeasureStartTimeSlice

public class RiffMeasureStartTimeSlice
extends java.lang.Object

A RiffMeasureStartTimeSlice provides static methods for encoding/decoding a MeasureStartTimeSlice using RIFF.


Method Summary
static void addTimeSlices(RIFF parentInput, MeasureStartTimeSlice measureStart)
          This reads event TimeSlice chunks from parentInput's input stream until the next measure start time slice or no more bytesRemaining in the parentInput, adding the TimeSlice objects to the measureStart's time slice list.
static MeasureStartTimeSlice maybeNew(RIFF parentInput)
          Peek into the parentInput's input stream and if the next item is a NIFF time slice with type MEASURE_START, return a new MeasureStartTimeSlice.
static MeasureStartTimeSlice newInstance(RIFF parentInput)
          Creates new MeasureStartTimeSlice from the parentInput's input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static MeasureStartTimeSlice newInstance(RIFF parentInput)
                                         throws java.io.IOException,
                                                RIFFFormatException
Creates new MeasureStartTimeSlice from the parentInput's input stream. The next object in the input stream must be a time slice with type MEASURE_START. After creating the MeasureStartTimeSlice, you can call addTimeSlices() to store the event time slices for this measure start time slice.

Parameters:
parentInput - the parent RIFF object being used to read the input stream
java.io.IOException
RIFFFormatException
See Also:
addTimeSlices(org.niffty.RIFF, org.niffty.MeasureStartTimeSlice)

maybeNew

public static MeasureStartTimeSlice maybeNew(RIFF parentInput)
                                      throws java.io.IOException,
                                             RIFFFormatException
Peek into the parentInput's input stream and if the next item is a NIFF time slice with type MEASURE_START, return a new MeasureStartTimeSlice. Otherwise, return null and leave the input stream unchanged.

Parameters:
parentInput - the parent RIFF object being used to read the input stream
java.io.IOException
RIFFFormatException

addTimeSlices

public static void addTimeSlices(RIFF parentInput,
                                 MeasureStartTimeSlice measureStart)
                          throws java.io.IOException,
                                 RIFFFormatException
This reads event TimeSlice chunks from parentInput's input stream until the next measure start time slice or no more bytesRemaining in the parentInput, adding the TimeSlice objects to the measureStart's time slice list. When this reads the TimeSlice, it also adds the subsequent music symbols to it.

Parameters:
parentInput - the parent RIFF object being used to read the input stream
measureStart - the MeasureStartTimeSlice to which TimeSlice objects are added.
java.io.IOException
RIFFFormatException
See Also:
TimeSlice