Class MixerStatus


  • public class MixerStatus
    extends DeviceUpdate
    Represents a status update sent by a mixer on a DJ Link network.
    Author:
    James Elliott
    • Field Detail

      • MASTER_HAND_OFF

        public static final int MASTER_HAND_OFF
        The byte within a status packet which indicates that the device is in the process of handing off the tempo master role to anther device, labeled Mh in the Packet Analysis document. Normally it holds the value 0xff, but during a tempo master hand-off, it holds the device number of the incoming tempo master, until that device asserts the master state, after which this device will stop doing so.
        See Also:
        Constant Field Values
      • MINIMUM_PACKET_SIZE

        public static final int MINIMUM_PACKET_SIZE
        The smallest packet size from which we can be constructed. Anything less than this and we are missing crucial information.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MixerStatus

        public MixerStatus​(DatagramPacket packet)
        Constructor sets all the immutable interpreted fields based on the packet content.
        Parameters:
        packet - the beat announcement packet that was received
    • Method Detail

      • getBpm

        public int getBpm()
        Get the BPM at the time of the update. This is an integer representing the BPM times 100, so 120.5 BPM would be represented by the value 12050.
        Specified by:
        getBpm in class DeviceUpdate
        Returns:
        the current BPM to two decimal places multiplied by 100
      • getBeatWithinBar

        public 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). The mixer makes no effort to synchronize down beats with players, however, so this value is of little use.
        Specified by:
        getBeatWithinBar in class DeviceUpdate
        Returns:
        the beat number within the current measure of music, as far as the mixer knows
      • isBeatWithinBarMeaningful

        public 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.
        Specified by:
        isBeatWithinBarMeaningful in class DeviceUpdate
        Returns:
        false because mixers make no effort to line up their beats with rekordbox-identified measures
      • getPitch

        public int getPitch()
        Description copied from class: DeviceUpdate
        Get the device pitch at the time of the update. This is an integer ranging from 0 to 2097152, which corresponds to a range between completely stopping playback to playing at twice normal tempo. The equivalent percentage value can be obtained by passing the pitch to 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.
        Specified by:
        getPitch in class DeviceUpdate
        Returns:
        the raw effective device pitch at the time of the update
      • isTempoMaster

        public boolean isTempoMaster()
        Is this mixer reporting itself to be the current tempo master?
        Specified by:
        isTempoMaster in class DeviceUpdate
        Returns:
        true if the mixer that sent this update is the master
      • isSynced

        public boolean isSynced()
        Was the mixer in Sync mode when this update was sent? Unless someone has been sending sync control packets using a package like Beat Link, this will generally return true.
        Specified by:
        isSynced in class DeviceUpdate
        Returns:
        true if the sync flag was set
      • getDeviceMasterIsBeingYieldedTo

        public Integer getDeviceMasterIsBeingYieldedTo()
        Description copied from class: DeviceUpdate
        If this packet indicates the device in the process of yielding the tempo master role to another player, this will hold the device number of that player, otherwise it will be null.
        Specified by:
        getDeviceMasterIsBeingYieldedTo in class DeviceUpdate
        Returns:
        the device number, if any, this update is yielding the tempo master role to
      • getEffectiveTempo

        public double getEffectiveTempo()
        Description copied from class: DeviceUpdate
        Get the effective tempo reflected by this update, which reflects both its track BPM and pitch as needed.
        Specified by:
        getEffectiveTempo in class DeviceUpdate
        Returns:
        the beats per minute this device is reporting