public class WaveformPreview extends Object
| Modifier and Type | Field and Description |
|---|---|
DataReference |
dataReference
The unique identifier that was used to request this waveform preview.
|
static Color |
INTENSE_COLOR
The color at which segments of the blue waveform marked most intense are drawn.
|
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.
|
int |
maxHeight
Holds the maximum height of any point along the waveform, so that it can drawn in a normalized manner to fit
its display area.
|
static Color |
NORMAL_COLOR
The color at which non-intense blue waveform segments are drawn.
|
Message |
rawMessage
The message holding the preview as it was read over the network, if it came from the dbserver.
|
int |
segmentCount
The pixel width (number of waveform preview columns) available.
|
| Constructor and Description |
|---|
WaveformPreview(DataReference reference,
ByteBuffer data,
boolean isColor)
Constructor when creating from an external caching mechanism.
|
WaveformPreview(DataReference reference,
org.deepsymmetry.cratedigger.pdb.RekordboxAnlz anlzFile)
Constructor when received from Crate Digger.
|
| Modifier and Type | Method and Description |
|---|---|
JComponent |
createViewComponent(TrackMetadata metadata)
Create a standard Swing component which can be added to a user interface that will draw this waveform preview,
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 preview data
|
Color |
segmentColor(int segment,
boolean front)
Determine the color of the waveform given an index into it.
|
int |
segmentHeight(int segment,
boolean front)
Determine the height of the preview given an index into it.
|
String |
toString() |
public static final int LEADING_DBSERVER_COLOR_JUNK_BYTES
public final DataReference dataReference
public final Message rawMessage
public final boolean isColor
public final int segmentCount
public final int maxHeight
public static final Color INTENSE_COLOR
public static final Color NORMAL_COLOR
public WaveformPreview(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 WaveformPreview(DataReference reference, ByteBuffer data, boolean isColor)
reference - the unique database reference that was used to request this waveform previewdata - the expanded data as will be returned by getData()isColor - indicates whether the data represents a color previewpublic ByteBuffer getData()
public JComponent createViewComponent(TrackMetadata metadata)
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
positionspublic int segmentHeight(int segment,
boolean front)
segment - the index of the waveform preview segment to examinefront - if true the height of the front (brighter) segment of a color waveform preview is returned,
otherwise the height of the back (dimmer) segment is returned. Has no effect for blue previews.public Color segmentColor(int segment, boolean front)
segment - the index of the first waveform byte to examinefront - if true the front (brighter) segment of a color waveform preview is returned,
otherwise the back (dimmer) segment is returned. Has no effect for blue previews.Copyright © 2016–2019 Deep Symmetry, LLC. All rights reserved.