Skip to content

Commit

Permalink
Have fake Opus CdjStatus reflect metadata archive availability
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed May 5, 2024
1 parent 31cce00 commit 650ead2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/deepsymmetry/beatlink/CdjStatus.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.deepsymmetry.beatlink;

import org.deepsymmetry.beatlink.data.OpusProvider;
import org.deepsymmetry.beatlink.data.SlotReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -643,10 +645,10 @@ public CdjStatus(DatagramPacket packet) {
if (Util.isOpusQuad(deviceName)) {
trackSourcePlayer = translateOpusPlayerNumbers(packetBytes[40]);
trackSourceSlot = findOpusTrackSourceSlot();
// isLocalSdLoaded() == true
packetBytes[115] = 0;
// isLocalUsbLoaded() == true
packetBytes[111] = 0;
// Indicate whether we have a metadata archive available for the SD slot:
packetBytes[115] = (byte) ((OpusProvider.getInstance().findDatabase(SlotReference.getSlotReference(1, TrackSourceSlot.SD_SLOT)) == null) ? 4 : 0);
// Indicate whether we have a metadata archive available for the USB slot:
packetBytes[111] = (byte) ((OpusProvider.getInstance().findDatabase(SlotReference.getSlotReference(1, TrackSourceSlot.USB_SLOT)) == null) ? 4 : 0);
} else {
trackSourcePlayer = packetBytes[40];
trackSourceSlot = findTrackSourceSlot();
Expand Down

0 comments on commit 650ead2

Please sign in to comment.