public class CdjStatus extends DeviceUpdate
| Modifier and Type | Class and Description |
|---|---|
static class |
CdjStatus.PlayState1
The possible values of the first play state found in the packet, labeled P1 in Figure 11 of
the Packet Analysis document.
|
static class |
CdjStatus.PlayState2
The possible values of the second play state found in the packet, labeled P2 in Figure 11 of
the Packet Analysis document.
|
static class |
CdjStatus.PlayState3
The possible values of the third play state found in the packet, labeled P3 in Figure 11 of
the Packet Analysis document.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MASTER_FLAG
The bit within the status flag that indicates the player is the tempo master, as illustrated in Figure 12 of
the Packet Analysis document.
|
static int |
ON_AIR_FLAG
The bit within the status flag that indicates the player is on the air, as illustrated in Figure 12 of the
Packet Analysis document.
|
static int |
PLAYING_FLAG
The bit within the status flag that indicates the player is playing, as illustrated in Figure 12 of the
Packet Analysis document.
|
static int |
STATUS_FLAGS
The byte within the packet which contains useful status information, labeled F in Figure 11 of the
Packet Analysis document.
|
static int |
SYNCED_FLAG
The bit within the status flag that indicates the player is synced, as illustrated in Figure 12 of the
Packet Analysis document.
|
address, deviceName, deviceNumber, packetBytes, timestamp| Constructor and Description |
|---|
CdjStatus(DatagramPacket packet)
Constructor sets all the immutable interpreted fields based on the packet content.
|
| Modifier and Type | Method and Description |
|---|---|
String |
formatCueCountdown()
Format a cue countdown indicator in the same way as the CDJ would at this point in the track.
|
int |
getBeatNumber()
Identify the beat of the track that being played.
|
int |
getBeatWithinBar()
Get the position within a measure of music at which the most recent beat occurred (a value from 1 to 4, where 1
represents the down beat).
|
int |
getBpm()
Get the track BPM at the time of the update.
|
int |
getCueCountdown()
How many beats away is the next cue point in the track? If there is no saved cue point after the current play
location, or if it is further than 64 bars ahead, the value 511 is returned (and the CDJ will display
"--.- bars").
|
double |
getEffectiveTempo()
Get the effective tempo reflected by this update, which reflect both its track BPM and pitch as needed.
|
String |
getFirmwareVersion()
Return the firmware version string reported in the packet.
|
long |
getPacketNumber()
Return the sequence number of this update packet, a value that increments with each packet sent.
|
int |
getPitch()
Get the device pitch at the time of the update.
|
int |
getPitch(int number)
Get a specific copy of the device pitch information at the time of the update.
|
CdjStatus.PlayState1 |
getPlayState1()
Get the first play state found in the packet, labeled P1 in Figure 11 of the
Packet Analysis document.
|
CdjStatus.PlayState2 |
getPlayState2()
Get the second play state found in the packet, labeled P2 in Figure 11 of the
Packet Analysis document.
|
CdjStatus.PlayState3 |
getPlayState3()
Get the third play state found in the packet, labeled P3 in Figure 11 of the
Packet Analysis document.
|
int |
getSyncNumber()
Get the counter identifying how many times the tempo master has changed.
|
int |
getTrackNumber()
Get the track number of the loaded track.
|
boolean |
isAtEnd()
Is the player currently stopped at the end of a track?
|
boolean |
isBeatWithinBarMeaningful()
Returns
true if this beat is coming from a device where getBeatWithinBar() can reasonably
be expected to have musical significance, because it respects the way a track was configured within rekordbox. |
boolean |
isBusy()
Check if the player is doing anything.
|
boolean |
isCued()
Is the player currently cued?
|
boolean |
isLinkedUsbAvailable()
Is USB media available somewhere on the network?
|
boolean |
isLocalUsbEmpty()
Is USB media absent from this particular CDJ?
|
boolean |
isLocalUsbLoaded()
Is USB media loaded in this particular CDJ?
|
boolean |
isLocalUsbUnloading()
Is USB media being unloaded from this particular CDJ?
|
boolean |
isLooping()
Is the player currently playing a loop?
|
boolean |
isOnAir()
Was the CDJ on the air when this update was sent?
A player is considered to be on the air when it is connected to a mixer channel that is not faded out.
|
boolean |
isPaused()
Is the player currently paused?
|
boolean |
isPlaying()
Was the CDJ playing a track when this update was sent?
|
boolean |
isPlayingBackwards()
Is the player currently playing backwards?
|
boolean |
isPlayingCdjMode()
Is the player currently playing with the jog wheel in CDJ mode?
|
boolean |
isPlayingForwards()
Is the player currently playing forwards?
|
boolean |
isPlayingVinylMode()
Is the player currently playing with the jog wheel in Vinyl mode?
|
boolean |
isSearching()
Is the player currently searching?
|
boolean |
isSynced()
Was the CDJ in Sync mode when this update was sent?
|
boolean |
isTempoMaster()
Is this CDJ reporting itself to be the current tempo master?
|
boolean |
isTrackLoaded()
Is a track loaded?
|
String |
toString() |
getAddress, getDeviceName, getDeviceNumber, getPacketBytes, getTimestamppublic static final int STATUS_FLAGS
public static final int ON_AIR_FLAG
public static final int SYNCED_FLAG
public static final int MASTER_FLAG
public static final int PLAYING_FLAG
public CdjStatus(DatagramPacket packet)
packet - the beat announcement packet that was receivedpublic CdjStatus.PlayState1 getPlayState1()
public CdjStatus.PlayState2 getPlayState2()
public CdjStatus.PlayState3 getPlayState3()
public int getPitch()
Util.pitchToPercentage(long), and the corresponding
fractional scaling value by passing it to Util.pitchToMultiplier(long).
CDJ update packets actually have four copies of the pitch value which behave slightly differently under
different circumstances. This method returns one which seems to provide the most useful information (labeled
Pitch1 in Figure 11 of the
Packet Analysis document),
reflecting the effective BPM currently being played when it is combined with the track BPM. To probe the other
pitch values that were reported, you can use getPitch(int).
public int getPitch(int number)
Util.pitchToPercentage(long),
and the corresponding fractional scaling value by passing it to Util.pitchToMultiplier(long).
CDJ update packets contain four copies of the pitch value which behave slightly differently under
different circumstances, labeled Pitch1 through Pitch4 in Figure 11 of the
Packet Analysis document.
This method returns the one you choose by specifying number. If all you want is the current effective
pitch, you can use getPitch().
number - the subscript identifying the copy of the pitch information you are interested inpublic int getBpm()
When the CDJ has just started up and no track has been loaded, it will report a BPM of 65535.
public int getBeatWithinBar()
When the track being played has not been analyzed by rekordbox, or is playing on a non-nexus player, this value will always be zero.
getBeatWithinBar in class DeviceUpdatepublic boolean isBeatWithinBarMeaningful()
true if this beat is coming from a device where getBeatWithinBar() can reasonably
be expected to have musical significance, because it respects the way a track was configured within rekordbox.
For CDJs this is true whenever the value is not zero (i.e. this is a nexus player playing a track that
was analyzed by rekordbox), because players report their beats according to rekordbox-identified measures.isBeatWithinBarMeaningful in class DeviceUpdatepublic boolean isTempoMaster()
isTempoMaster in class DeviceUpdatetrue if the player that sent this update is the masterpublic double getEffectiveTempo()
DeviceUpdategetEffectiveTempo in class DeviceUpdatepublic boolean isPlaying()
public boolean isSynced()
public boolean isOnAir()
public boolean isLocalUsbLoaded()
public boolean isLocalUsbUnloading()
public boolean isLocalUsbEmpty()
public boolean isTrackLoaded()
public boolean isLooping()
public boolean isPaused()
public boolean isCued()
public boolean isSearching()
public boolean isAtEnd()
public boolean isPlayingForwards()
public boolean isPlayingBackwards()
public boolean isPlayingVinylMode()
public boolean isPlayingCdjMode()
public boolean isLinkedUsbAvailable()
public boolean isBusy()
public int getTrackNumber()
public int getSyncNumber()
public int getBeatNumber()
When the track being played has not been analyzed by rekordbox, or is being played on a non-nexus player, this information is not available, and the value -1 is returned.
public int getCueCountdown()
formatCueCountdown()public String formatCueCountdown()
getCueCountdown()public String getFirmwareVersion()
public long getPacketNumber()
Copyright © 2016 Deep Symmetry, LLC. All rights reserved.