code: TrackMetadata queryMetadata(final DataReference track, final CdjStatus.TrackType trackType, final Client client)
              throws IOException, InterruptedException, TimeoutException {
  
          // Send the metadata menu request
          if (client.tryLockingForMenuOperations(20, TimeUnit.SECONDS)) {
              try {
                  final Message.KnownType requestType = (trackType == CdjStatus.TrackType.REKORDBOX) ?
                          Message.KnownType.REKORDBOX_METADATA_REQ : Message.KnownType.UNANALYZED_METADATA_REQ;
                  final Message response = client.menuRequestTyped(requestType, Message.MenuIdentifier.MAIN_MENU,
                          track.slot, trackType, new NumberField(track.rekordboxId));
                  final long count = response.getMenuResultsCount();
                  if (count == Message.NO_MENU_RESULTS_AVAILABLE) {
                      return null;
                  }
  
                  // Gather the cue list and all the metadata menu items
                  final List<Message> items = client.renderMenuItems(Message.MenuIdentifier.MAIN_MENU, track.slot, trackType, response);
                  final CueList cueList = getCueList(track.rekordboxId, track.slot, client);
                  return new TrackMetadata(track, trackType, items, cueList);
              } finally {
                  client.unlockForMenuOperations();
              }
          } else {
              throw new TimeoutException("Unable to lock the player for menu operations");
          }
      }
docs: Request metadata for a specific track ID, given a dbserver connection to a player that has already been set up.
  Separated into its own method so it could be used multiple times with the same connection when gathering
  all track metadata.
  
  @param track uniquely identifies the track whose metadata is desired
  @param trackType identifies the type of track being requested, which affects the type of metadata request
  message that must be used
  @param client the dbserver client that is communicating with the appropriate player
  
  @return the retrieved metadata, or {@code null} if there is no such track
  
  @throws IOException if there is a communication problem
  @throws InterruptedException if the thread is interrupted while trying to lock the client for menu operations
  @throws TimeoutException if we are unable to lock the client for menu operations