code: private int chooseAskingPlayerNumber(int targetPlayer) {
          final int fakeDevice = VirtualCdj.getInstance().getDeviceNumber();
          if ((targetPlayer > 15) || (fakeDevice >= 1 && fakeDevice <= 4)) {
              return fakeDevice;
          }
  
          for (DeviceAnnouncement candidate : DeviceFinder.getInstance().getCurrentDevices()) {
              final int realDevice = candidate.getNumber();
              if (realDevice != targetPlayer && realDevice >= 1 && realDevice <= 4) {
                  final DeviceUpdate lastUpdate =  VirtualCdj.getInstance().getLatestStatusFor(realDevice);
                  if (lastUpdate instanceof CdjStatus &&
                          ((CdjStatus) lastUpdate).getTrackSourcePlayer() != targetPlayer) {
                      return candidate.getNumber();
                  }
              }
          }
          throw new IllegalStateException("No player number available to query player " + targetPlayer +
                  ". If such a player is present on the network, it must be using Link to play a track from " +
                  "our target player, so we can't steal its channel number.");
      }
docs: Finds a valid  player number that is currently visible but which is different from the one specified, so it can
  be used as the source player for a query being sent to the specified one. If the virtual CDJ is running on an
  acceptable player number (which must be 1-4 to request metadata from an actual CDJ, but can be anything if we
  are talking to rekordbox), uses that, since it will always be safe. Otherwise, tries to borrow the player number
  of another actual CDJ on the network, but we can't do that if the player we want to impersonate has mounted
  a track from the player that we want to talk to.
  
  @param targetPlayer the player to which a metadata query is being sent
  
  @return some other currently active player number, ideally not a real player, but sometimes we have to
  
  @throws IllegalStateException if there is no other player number available to use