public class BeatGrid extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
beatCount
The number of beats in the track.
|
DataReference |
dataReference
The unique identifier that was used to request this beat grid.
|
| Constructor and Description |
|---|
BeatGrid(DataReference reference,
ByteBuffer buffer)
Constructor for reading from a cache file.
|
BeatGrid(DataReference reference,
Message message)
Constructor for when reading from the network.
|
| Modifier and Type | Method and Description |
|---|---|
int |
findBeatAtTime(long milliseconds)
Finds the beat in which the specified track position falls.
|
int |
getBeatWithinBar(int beatNumber)
Returns the musical count of the specified beat, represented by Bb in Figure 11 of
the Packet Analysis document.
|
ByteBuffer |
getRawData()
Get the raw bytes of the beat grid as it was read over the network.
|
long |
getTimeWithinTrack(int beatNumber)
Returns the time at which the specified beat falls within the track.
|
String |
toString() |
public final DataReference dataReference
public final int beatCount
public BeatGrid(DataReference reference, Message message)
reference - the unique database reference that was used to request this waveform detailmessage - the response that contained the beat grid datapublic BeatGrid(DataReference reference, ByteBuffer buffer)
reference - the unique database reference that was used to request this waveform detailbuffer - the raw bytes representing the beat gridpublic ByteBuffer getRawData()
public long getTimeWithinTrack(int beatNumber)
beatNumber - the beat number desired, must fall within the range 1..beatCountIllegalArgumentException - if number is less than 0 or greater than beatCountpublic int getBeatWithinBar(int beatNumber)
beatNumber - the number of the beat of interest, must fall within the range 1..beatCountIllegalArgumentException - if number is less than 1 or greater than beatCountpublic int findBeatAtTime(long milliseconds)
milliseconds - how long the track has been playingCopyright © 2016–2018 Deep Symmetry, LLC. All rights reserved.