Skip to content

Commit

Permalink
Merge pull request #79 from cprepos/cprepos-remove-player-song-struct…
Browse files Browse the repository at this point in the history
…ures

remove unused map playersong structures
  • Loading branch information
brunchboy authored Jul 16, 2024
2 parents 710ed4e + 1ddaa14 commit 375a858
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/main/java/org/deepsymmetry/beatlink/VirtualRekordbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ public void requestPSSI() throws IOException{
}
}

/**
* Keeps track of the PSSI bytes we have received for each player.
*/
private final Map<Integer, ByteBuffer> playerSongStructures = new ConcurrentHashMap<>();

/**
* Keeps track of the source slots we've matched to metadata archives for each player.
*/
Expand All @@ -270,7 +265,6 @@ public void requestPSSI() throws IOException{
*/
@API(status = API.Status.EXPERIMENTAL)
public void clearPlayerCaches(int usbSlotNumber){
playerSongStructures.remove(usbSlotNumber);
playerTrackSourceSlots.remove(usbSlotNumber);
}

Expand Down Expand Up @@ -342,7 +336,6 @@ private DeviceUpdate buildUpdate(DatagramPacket packet) {

// If source player number is zero the deck does not have a song loaded, clear the PSSI and source slot we had for that player.
if (status.getTrackSourcePlayer() == 0) {
playerSongStructures.remove(status.getDeviceNumber());
playerTrackSourceSlots.remove(status.getDeviceNumber());
}
return status;
Expand All @@ -369,7 +362,6 @@ private DeviceUpdate buildUpdate(DatagramPacket packet) {
if (rekordboxId != 0) {
final ByteBuffer pssiFromOpus = ByteBuffer.wrap(Arrays.copyOfRange(data, 0x35, data.length));
final int player = Util.translateOpusPlayerNumbers(data[0x21]);
playerSongStructures.put(player, pssiFromOpus);
// Also record the conceptual source slot that represents the USB slot from which this track seems to have been loaded
final int sourceSlot = OpusProvider.getInstance().findMatchingUsbSlotForTrack(rekordboxId, player, pssiFromOpus);
if (sourceSlot != 0) { // We found a match, record it.
Expand Down

0 comments on commit 375a858

Please sign in to comment.