public abstract class DeviceUpdate extends Object
| Modifier and Type | Field and Description |
|---|---|
protected InetAddress |
address
The address from which this device update was received.
|
protected String |
deviceName
The name of the device sending the update.
|
protected int |
deviceNumber
The player/device number sending the update.
|
protected byte[] |
packetBytes
The packet data containing the device update.
|
protected long |
timestamp
When this update was received.
|
| Constructor and Description |
|---|
DeviceUpdate(DatagramPacket packet,
String name,
int length)
Constructor sets all the immutable interpreted fields based on the packet content.
|
| Modifier and Type | Method and Description |
|---|---|
InetAddress |
getAddress()
Get the address of the device from which this update was seen.
|
abstract int |
getBeatWithinBar()
Get the position within a measure of music at which this beat falls (a value from 1 to 4, where 1 represents
the down beat).
|
String |
getDeviceName()
Get the name reported by the device sending the update.
|
int |
getDeviceNumber()
Get the player/device number reporting the update.
|
abstract double |
getEffectiveTempo()
Get the effective tempo reflected by this update, which reflect both its track BPM and pitch as needed.
|
byte[] |
getPacketBytes()
Get the raw data bytes of the device update packet.
|
long |
getTimestamp()
Get the timestamp recording when the device update was received.
|
abstract boolean |
isBeatWithinBarMeaningful()
Returns
true if this update 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. |
abstract boolean |
isTempoMaster()
Is this device reporting itself to be the current tempo master?
|
protected final InetAddress address
protected final long timestamp
protected final String deviceName
protected final int deviceNumber
protected final byte[] packetBytes
public DeviceUpdate(DatagramPacket packet, String name, int length)
packet - the device update packet that was receivedname - the type of packet that is being processed, in case a problem needs to be reportedlength - the expected length of the packetpublic InetAddress getAddress()
public long getTimestamp()
public String getDeviceName()
public int getDeviceNumber()
public byte[] getPacketBytes()
public abstract boolean isTempoMaster()
true if the device that sent this update is the masterIllegalStateException - if the VirtualCdj is not running.public abstract double getEffectiveTempo()
public abstract int getBeatWithinBar()
isBeatWithinBarMeaningful().public abstract boolean isBeatWithinBarMeaningful()
true if this update 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.Copyright © 2016 Deep Symmetry, LLC. All rights reserved.