Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

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: (event: string | symbol, listener: (...args: any[]) => void) => EventEmitter = ...

Type declaration

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

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

            • Rest ...args: any[]

            Returns void

      Returns EventEmitter

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

Type declaration

    • <P, T>(event: P, listener: (...args: ListenerType<MixstatusEvents[P]>) => void): T
    • (event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void
    • Type parameters

      • P: keyof MixstatusEvents

      • T

      Parameters

      • event: P
      • listener: (...args: ListenerType<MixstatusEvents[P]>) => void
          • (...args: ListenerType<MixstatusEvents[P]>): void
          • Parameters

            • Rest ...args: ListenerType<MixstatusEvents[P]>

            Returns void

      Returns T

    • Parameters

      • event: typeof assignmentCompatibilityHack
      • listener: (...args: any[]) => any
          • (...args: any[]): any
          • Parameters

            • Rest ...args: any[]

            Returns any

      Returns void

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

Type declaration

    • <P, T>(event: P, listener: (...args: ListenerType<MixstatusEvents[P]>) => void): T
    • (event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void
    • Type parameters

      • P: keyof MixstatusEvents

      • T

      Parameters

      • event: P
      • listener: (...args: ListenerType<MixstatusEvents[P]>) => void
          • (...args: ListenerType<MixstatusEvents[P]>): void
          • Parameters

            • Rest ...args: ListenerType<MixstatusEvents[P]>

            Returns void

      Returns T

    • Parameters

      • event: typeof assignmentCompatibilityHack
      • listener: (...args: any[]) => any
          • (...args: any[]): any
          • Parameters

            • Rest ...args: any[]

            Returns any

      Returns void

Methods

  • #handleOnairChange(state: State): void
  • Parameters

    Returns void

  • #handlePlaystateChange(lastState: State, state: State): void
  • Called to indicate that a device has reported a different playState than it had previously reported.

    Parameters

    Returns void

  • #markPlayerStopped(__namedParameters: State): void
  • Parameters

    Returns void

  • #onAir(state: State): boolean
  • 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

  • #playerMayBeFirst(state: State): void
  • 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

  • #playerMayStop(__namedParameters: State): 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

    Returns void

  • #promoteNextPlayer(): void
  • Locate the player that has been playing for the longest time and is onair, and report that device as now playing.

    Returns void

  • #promotePlayer(state: State): void
  • Report a player as 'live'. Will not report the state if the player has already previously been reported as live.

    Parameters

    Returns void

  • #setMayStop(): Promise<void>
  • Returns Promise<void>

  • Update the configration

    Parameters

    Returns void

  • handleState(state: State): void
  • Feed a CDJStatus state object to the mix state processor

    Parameters

    Returns void

  • triggerNextTrack(): void
  • Manually reports the track that has been playing the longest which has not yet been reported as live.

    Returns void

Generated using TypeDoc