The local database is responsible for syncing the remote rekordbox databases of media slots on a device into in-memory sqlite databases.

This service will attempt to ensure the in-memory databases for each media device that is connected to a CDJ is locally kept in sync. Fetching the database for any media slot of it's not already cached.

Hierarchy

  • LocalDatabase

Constructors

Properties

#dbs: DatabaseItem[] = []

The current available databases

#deviceManager: DeviceManager
#emitter: Emitter = ...

The EventEmitter that will report database events

#hostDevice: Device
#slotLocks: Map<string, Mutex> = ...

Locks for each device slot: ${device.id}-${slot}. Used when making track requets.

#statusEmitter: StatusEmitter
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<DatabaseEvents[P]>) => void)): T;
    (event: typeof assignmentCompatibilityHack, listener: ((...args: any[]) => any)): void;
} = ...

Type declaration

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

Type declaration

Methods

  • Closes the database connection and removes the database entry when a device is removed.

    Parameters

    Returns void

  • Disconnects the local database connection for the specified device

    Parameters

    Returns void

  • Gets the sqlite ORM service for to a database hydrated with the media metadata for the provided device slot.

    If the database has not already been hydrated this will first hydrate the database, which may take some time depending on the size of the database.

    Returns

    null if no rekordbox media present

    Parameters

    Returns Promise<null | MetadataORM>

  • Preload the databases for all connected devices.

    Returns Promise<void>

Generated using TypeDoc