public abstract class DeviceUpdate extends Object
| 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 the most recent beat fell (a value from 1 to 4, where 1 represents
the down beat).
|
abstract int |
getBpm()
Get the playback BPM at the time of the update.
|
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 reflects both its track BPM and pitch as needed.
|
byte[] |
getPacketBytes()
Get the raw data bytes of the device update packet.
|
abstract int |
getPitch()
Get the device pitch at the time of the update.
|
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?
|
String |
toString() |
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 int getPitch()
Util.pitchToPercentage(long), and the corresponding
fractional scaling value by passing it to Util.pitchToMultiplier(long). Mixers always report a pitch
of +0%, so tempo changes are purely reflected in the BPM value.public abstract int getBpm()
When the CDJ has just started up and no track has been loaded, it will report a BPM of 65535.
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–2018 Deep Symmetry, LLC. All rights reserved.