From 650ead2c452447fd8e1087a0f77245b496b3e3ab Mon Sep 17 00:00:00 2001 From: James Elliott Date: Sat, 4 May 2024 22:15:20 -0500 Subject: [PATCH] Have fake Opus CdjStatus reflect metadata archive availability --- src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java b/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java index 6f92b1b..56a2964 100644 --- a/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java +++ b/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java @@ -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; @@ -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();