Class MixstatusProcessor

MixstatusProcessor is a configurable processor which when fed device state will attempt to accurately determine events that happen within the DJ set.

The following events are fired:

  • nowPlaying: The track is considered playing and on air to the audience.
  • stopped: The track was stopped / paused / went off-air.

Additionally the following non-track status are reported:

  • setStarted: The first track has begun playing.
  • setEnded: The TimeBetweenSets has passed since any tracks were live.

See Config for configuration options.

Config options may be changed after the processor has been created and is actively receiving state updates.

Hierarchy

  • MixstatusProcessor

Constructors

Properties

#cancelSetEnding?: (() => void)

Type declaration

    • (): void
    • When we are waiting for a set to end, use this to cancel the timer.

      Returns void

The configuration for this instance of the processor

#emitter: Emitter = ...

Used to fire track mix status events

#isSetActive: boolean = false

Incidates if we're currentiny in an active DJ set

#lastStartTime: Map<number, number> = ...

Records when each device last started playing a track

#lastState: Map<number, State> = ...

Records the most recent state of each player

#lastStoppedTimes: Map<number, number> = ...

Records when a device entered a 'may stop' state. If it's in the state for long enough it will be reported as stopped.

#livePlayers: Set<number> = ...

Records which players have been reported as 'live'

off: ((eventName: string | symbol, listener: ((...args: any[]) => void)) => EventEmitter) = ...

Type declaration

    • (eventName: string | symbol, listener: ((...args: any[]) => void)): EventEmitter
    • Alias for emitter.removeListener().

      Since

      v10.0.0

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns EventEmitter

on: {
    <P, T>(this: T, event: P, listener: ((...args: ListenerType<MixstatusEvents[P]>) => void)): T;
    (event: typeof assignmentCompatibilityHack, listener: ((...args: any[]) => any)): void;
} = ...

Type declaration

once: {
    <P, T>(this: T, event: P, listener: ((...args: ListenerType<MixstatusEvents[P]>) => void)): T;
    (event: typeof assignmentCompatibilityHack, listener: ((...args: any[]) => any)): void;
} = ...

Type declaration

Methods

  • Parameters

    Returns void

  • Called to indicate that a device has reported a different playState than it had previously reported.

    Parameters

    Returns void

  • Parameters

    • __namedParameters: State

    Returns void

  • Helper to account for the useOnAirStatus config. If not configured with this flag the state will always be determined as on air.

    Parameters

    Returns boolean

  • Called to indicate that we think this player may be the first one to start playing. Will check if no other players are playing, if so it will report the player as now playing.

    Parameters

    Returns void

  • Called when the player is in a state where it is no longer playing, but may come back onair. Examples are slip pause, or 'cutting' a track on the mixer taking it offair.

    Parameters

    • __namedParameters: State

    Returns void

  • Locate the player that has been playing for the longest time and is onair, and report that device as now playing.

    Returns void

  • Report a player as 'live'. Will not report the state if the player has already previously been reported as live.

    Parameters

    Returns void

  • Returns Promise<void>

  • Feed a CDJStatus state object to the mix state processor

    Parameters

    Returns void

  • Manually reports the track that has been playing the longest which has not yet been reported as live.

    Returns void

Generated using TypeDoc