public class CrateDigger extends Object
Uses the Crate Digger library to
provide an even more reliable source of track metadata, even when there are four players in use on the network
and the VirtualCdj is forced to use a non-standard player number.
To take advantage of these capabilities, simply call the start() method and then use the
MetadataFinder as you would have without this class.
| Modifier and Type | Field and Description |
|---|---|
File |
downloadDirectory
The folder into which database exports and track analysis files will be downloaded.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDatabaseListener(DatabaseListener listener)
Adds the specified database listener to receive updates when a rekordbox database has been obtained for a
media slot, or when the underlying media for a database has been unmounted so it is no longer relevant.
|
org.deepsymmetry.cratedigger.Database |
findDatabase(DataReference reference)
Find the database we have downloaded and parsed that can provide information about the supplied data
reference, if any.
|
org.deepsymmetry.cratedigger.Database |
findDatabase(SlotReference slot)
Find the database we have downloaded and parsed that can provide information about the supplied slot
reference, if any.
|
Set<DatabaseListener> |
getDatabaseListeners() |
static CrateDigger |
getInstance()
Get the singleton instance of this class.
|
int |
getRetryLimit()
Check how many times we will try to download a file from a player before giving up.
|
static String |
humanReadableByteCount(long bytes,
boolean si)
Format a number of bytes in a human-centric format.
|
boolean |
isRunning()
Check whether we are currently running.
|
void |
removeDatabaseListener(DatabaseListener listener)
Removes the specified database listener so that it no longer receives updates when there
are changes to the available set of rekordbox databases.
|
void |
setRetryLimit(int limit)
Set how many times we will try to download a file from a player before giving up.
|
void |
start()
Start finding track metadata for all active players using the NFS server on the players to pull the exported
database and track analysis files.
|
void |
stop()
Stop finding track metadata for all active players.
|
String |
toString() |
public final File downloadDirectory
public int getRetryLimit()
public void setRetryLimit(int limit)
limit - the maximum number of attempts we will make when a file download failspublic boolean isRunning()
public static String humanReadableByteCount(long bytes, boolean si)
bytes - the number of bytessi - {code @true} if should use SI interpretation where k=1000public org.deepsymmetry.cratedigger.Database findDatabase(DataReference reference)
reference - identifies the location from which data is desiredpublic org.deepsymmetry.cratedigger.Database findDatabase(SlotReference slot)
slot - identifies the slot from which data is desiredpublic void start()
throws Exception
MetadataFinder if it is not already
running, because we build on its features. This will transitively start many of the other Beat Link subsystems,
and stopping any of them will stop us as well.Exception - if there is a problem starting the required componentspublic void stop()
public static CrateDigger getInstance()
public void addDatabaseListener(DatabaseListener listener)
listener is null or already present in the set of registered listeners, no exception is
thrown and no action is performed.
To reduce latency, updates are delivered to listeners directly on the thread that is receiving packets
from the network, so if you want to interact with user interface objects in listener methods, you need to use
javax.swing.SwingUtilities.invokeLater(Runnable)
to do so on the Event Dispatch Thread.
Even if you are not interacting with user interface objects, any code in the listener method
must finish quickly, or it will add latency for other listeners, and updates will back up.
If you want to perform lengthy processing of any sort, do so on another thread.
listener - the cache update listener to addpublic void removeDatabaseListener(DatabaseListener listener)
listener is null or not present
in the set of registered listeners, no exception is thrown and no action is performed.listener - the cache update listener to removepublic Set<DatabaseListener> getDatabaseListeners()
Copyright © 2016–2019 Deep Symmetry, LLC. All rights reserved.