public class MetadataFinder extends Object
THIS CLASS IS NOT YET READY FOR USE.
Although it worked great for an entire weekend during which my network configuration remained constant, as soon as I reconfigured the network to remove the managed switch I was using to watch traffic between CDJs, the particular packets which had been working started to crash the process in the CDJs which responds to metadata queries, meaning they would need to be turned off and back on before any other CDJ could get Link Info from them.
We need to figure out how the byte patterns below need to change based on the network configuration, or based on values found in the device announcement or status packets, or in earlier response packets, in order to make this reliable and safe to use.
This goes along with the comment on the usbPacketTemplates
array; perhaps if we can understand what is different about the
packets that need to be sent to each player, we can understand how
to accommodate the network configuration, and how to construct
packets that always work.
| Modifier and Type | Field and Description |
|---|---|
static int |
METADATA_PORT
The port on which we contact players to ask them for metadata information.
|
| Constructor and Description |
|---|
MetadataFinder() |
| Modifier and Type | Method and Description |
|---|---|
static Map<Integer,TrackMetadata> |
getLatestMetadata()
Get all currently known metadata.
|
static TrackMetadata |
getLatestMetadataFor(DeviceUpdate update)
Look up the track metadata we have for a given player, identified by a status update received from that player.
|
static TrackMetadata |
getLatestMetadataFor(int player)
Look up the track metadata we have for a given player number.
|
static boolean |
isRunning()
Check whether we are currently running.
|
static TrackMetadata |
requestMetadataFrom(CdjStatus status)
Given a status update from a CDJ, find the metadata for the track that it has loaded, if any.
|
static TrackMetadata |
requestMetadataFrom(int player,
CdjStatus.TrackSourceSlot slot,
int rekordboxId)
Ask the specified player for metadata about the track in the specified slot with the specified rekordbox ID.
|
static void |
start()
Start finding track metadata for all active players.
|
static void |
stop()
Stop finding track metadata for all active players.
|
public static final int METADATA_PORT
public static TrackMetadata requestMetadataFrom(CdjStatus status)
status - the CDJ status update that will be used to determine the loaded track and ask the appropriate
player for metadata about itpublic static TrackMetadata requestMetadataFrom(int player, CdjStatus.TrackSourceSlot slot, int rekordboxId)
player - the player number whose track is of interestslot - the slot in which the track can be foundrekordboxId - the track of interestpublic static boolean isRunning()
public static Map<Integer,TrackMetadata> getLatestMetadata()
public static TrackMetadata getLatestMetadataFor(int player)
player - the device number whose track metadata is desiredpublic static TrackMetadata getLatestMetadataFor(DeviceUpdate update)
update - a status update from the player for which track metadata is desiredpublic static void start()
throws Exception
VirtualCdj if it is not already
running, because we need it to send us device status updates to notice when new tracks are loaded.Exception - if there is a problem starting the required componentspublic static void stop()
Copyright © 2016 Deep Symmetry, LLC. All rights reserved.