public class WaveformDetail extends Object
| Modifier and Type | Field and Description |
|---|---|
static Color[] |
COLOR_MAP
The different colors the monochrome (blue) waveform can be based on its intensity.
|
DataReference |
dataReference
The unique identifier that was used to request this waveform detail.
|
boolean |
isColor
Indicates whether this is an NXS2-style color waveform, or a monochrome (blue) waveform.
|
static int |
LEADING_DBSERVER_COLOR_JUNK_BYTES
The number of bytes at the start of the color waveform data to be skipped when that was loaded using the
nxs2 ANLZ tag request.
|
static int |
LEADING_DBSERVER_JUNK_BYTES
The number of bytes at the start of the waveform data which do not seem to be valid or used when it is served
by the dbserver protocol.
|
Message |
rawMessage
The message holding the detail as it was read over the network.
|
| Constructor and Description |
|---|
WaveformDetail(DataReference reference,
ByteBuffer data,
boolean isColor)
Constructor for use with external caching mechanisms.
|
WaveformDetail(DataReference reference,
Message message)
Constructor when reading from the network or a cache file.
|
WaveformDetail(DataReference reference,
org.deepsymmetry.cratedigger.pdb.RekordboxAnlz anlzFile)
Constructor when received from Crate Digger.
|
| Modifier and Type | Method and Description |
|---|---|
JComponent |
createViewComponent(TrackMetadata metadata,
BeatGrid beatGrid)
Create a standard Swing component which can be added to a user interface that will draw this waveform detail,
optionally including annotations like the current playback position and minute markers (if you supply
TrackMetadata so the total length can be determined), and cue markers (if you also supply a
CueList). |
ByteBuffer |
getData()
Get the raw bytes of the waveform detail data
|
int |
getFrameCount()
Count the half-frames of waveform available.
|
long |
getTotalTime()
Determine how long the track plays, in milliseconds.
|
Color |
segmentColor(int segment,
int scale)
Determine the color of the waveform given an index into it.
|
int |
segmentHeight(int segment,
int scale)
Determine the height of the waveform given an index into it.
|
String |
toString() |
public static final int LEADING_DBSERVER_JUNK_BYTES
public static final int LEADING_DBSERVER_COLOR_JUNK_BYTES
public final DataReference dataReference
public final Message rawMessage
public final boolean isColor
public static final Color[] COLOR_MAP
public WaveformDetail(DataReference reference, Message message)
reference - the unique database reference that was used to request this waveform detailmessage - the response that contains the previewpublic WaveformDetail(DataReference reference, org.deepsymmetry.cratedigger.pdb.RekordboxAnlz anlzFile)
reference - the unique database reference that was used to request this waveform previewanlzFile - the parsed rekordbox track analysis file containing the waveform previewpublic WaveformDetail(DataReference reference, ByteBuffer data, boolean isColor)
reference - the unique database reference that was used to request this waveform previewdata - the waveform data as will be returned by getData()isColor - indicates whether the data represents a color waveformpublic ByteBuffer getData()
public int getFrameCount()
public long getTotalTime()
public JComponent createViewComponent(TrackMetadata metadata, BeatGrid beatGrid)
TrackMetadata so the total length can be determined), and cue markers (if you also supply a
CueList). The playback position can bemetadata - Information about the track whose waveform we are drawing, so we can translate times into
positionsbeatGrid - The locations of all the beats in the track, so they can be drawnpublic int segmentHeight(int segment,
int scale)
scale is larger than 1 we are zoomed out,
so we determine an average height of scale segments starting with the specified one.segment - the index of the first waveform byte to examinescale - the number of wave segments being drawn as a single pixel columnpublic Color segmentColor(int segment, int scale)
scale is larger than 1 we are zoomed out,
so we determine an average color of scale segments starting with the specified one.segment - the index of the first waveform byte to examinescale - the number of wave segments being drawn as a single pixel columnCopyright © 2016–2019 Deep Symmetry, LLC. All rights reserved.