id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
163,900 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java | MetadataCache.findTrackIdAtOffset | private static int findTrackIdAtOffset(SlotReference slot, Client client, int offset) throws IOException {
Message entry = client.renderMenuItems(Message.MenuIdentifier.MAIN_MENU, slot.slot, CdjStatus.TrackType.REKORDBOX, offset, 1).get(0);
if (entry.getMenuItemType() == Message.MenuItemType.UNKNOWN) {
... | java | private static int findTrackIdAtOffset(SlotReference slot, Client client, int offset) throws IOException {
Message entry = client.renderMenuItems(Message.MenuIdentifier.MAIN_MENU, slot.slot, CdjStatus.TrackType.REKORDBOX, offset, 1).get(0);
if (entry.getMenuItemType() == Message.MenuItemType.UNKNOWN) {
... | [
"private",
"static",
"int",
"findTrackIdAtOffset",
"(",
"SlotReference",
"slot",
",",
"Client",
"client",
",",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"Message",
"entry",
"=",
"client",
".",
"renderMenuItems",
"(",
"Message",
".",
"MenuIdentifier",
"... | As part of checking whether a metadata cache can be auto-mounted for a particular media slot, this method
looks up the track at the specified offset within the player's track list, and returns its rekordbox ID.
@param slot the slot being considered for auto-attaching a metadata cache
@param client the connection to th... | [
"As",
"part",
"of",
"checking",
"whether",
"a",
"metadata",
"cache",
"can",
"be",
"auto",
"-",
"mounted",
"for",
"a",
"particular",
"media",
"slot",
"this",
"method",
"looks",
"up",
"the",
"track",
"at",
"the",
"specified",
"offset",
"within",
"the",
"play... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java#L1036-L1042 |
163,901 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.isPacketLongEnough | private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expectedLength + " bytes and got " +
lengt... | java | private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expectedLength + " bytes and got " +
lengt... | [
"private",
"boolean",
"isPacketLongEnough",
"(",
"DatagramPacket",
"packet",
",",
"int",
"expectedLength",
",",
"String",
"name",
")",
"{",
"final",
"int",
"length",
"=",
"packet",
".",
"getLength",
"(",
")",
";",
"if",
"(",
"length",
"<",
"expectedLength",
... | Helper method to check that we got the right size packet.
@param packet a packet that has been received
@param expectedLength the number of bytes we expect it to contain
@param name the description of the packet in case we need to report issues with the length
@return {@code true} if enough bytes were received to pro... | [
"Helper",
"method",
"to",
"check",
"that",
"we",
"got",
"the",
"right",
"size",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L72-L86 |
163,902 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.stop | public synchronized void stop() {
if (isRunning()) {
socket.get().close();
socket.set(null);
deliverLifecycleAnnouncement(logger, false);
}
} | java | public synchronized void stop() {
if (isRunning()) {
socket.get().close();
socket.set(null);
deliverLifecycleAnnouncement(logger, false);
}
} | [
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"socket",
".",
"get",
"(",
")",
".",
"close",
"(",
")",
";",
"socket",
".",
"set",
"(",
"null",
")",
";",
"deliverLifecycleAnnouncement",
"(",
"logge... | Stop listening for beats. | [
"Stop",
"listening",
"for",
"beats",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L212-L218 |
163,903 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.deliverSyncCommand | private void deliverSyncCommand(byte command) {
for (final SyncListener listener : getSyncListeners()) {
try {
switch (command) {
case 0x01:
listener.becomeMaster();
case 0x10:
listener.setSyncMo... | java | private void deliverSyncCommand(byte command) {
for (final SyncListener listener : getSyncListeners()) {
try {
switch (command) {
case 0x01:
listener.becomeMaster();
case 0x10:
listener.setSyncMo... | [
"private",
"void",
"deliverSyncCommand",
"(",
"byte",
"command",
")",
"{",
"for",
"(",
"final",
"SyncListener",
"listener",
":",
"getSyncListeners",
"(",
")",
")",
"{",
"try",
"{",
"switch",
"(",
"command",
")",
"{",
"case",
"0x01",
":",
"listener",
".",
... | Send a sync command to all registered listeners.
@param command the byte which identifies the type of sync command we received | [
"Send",
"a",
"sync",
"command",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L344-L365 |
163,904 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.deliverMasterYieldCommand | private void deliverMasterYieldCommand(int toPlayer) {
for (final MasterHandoffListener listener : getMasterHandoffListeners()) {
try {
listener.yieldMasterTo(toPlayer);
} catch (Throwable t) {
logger.warn("Problem delivering master yield command to listen... | java | private void deliverMasterYieldCommand(int toPlayer) {
for (final MasterHandoffListener listener : getMasterHandoffListeners()) {
try {
listener.yieldMasterTo(toPlayer);
} catch (Throwable t) {
logger.warn("Problem delivering master yield command to listen... | [
"private",
"void",
"deliverMasterYieldCommand",
"(",
"int",
"toPlayer",
")",
"{",
"for",
"(",
"final",
"MasterHandoffListener",
"listener",
":",
"getMasterHandoffListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"yieldMasterTo",
"(",
"toPlayer",
")",
... | Send a master handoff yield command to all registered listeners.
@param toPlayer the device number to which we are being instructed to yield the tempo master role | [
"Send",
"a",
"master",
"handoff",
"yield",
"command",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L423-L431 |
163,905 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.deliverMasterYieldResponse | private void deliverMasterYieldResponse(int fromPlayer, boolean yielded) {
for (final MasterHandoffListener listener : getMasterHandoffListeners()) {
try {
listener.yieldResponse(fromPlayer, yielded);
} catch (Throwable t) {
logger.warn("Problem delivering... | java | private void deliverMasterYieldResponse(int fromPlayer, boolean yielded) {
for (final MasterHandoffListener listener : getMasterHandoffListeners()) {
try {
listener.yieldResponse(fromPlayer, yielded);
} catch (Throwable t) {
logger.warn("Problem delivering... | [
"private",
"void",
"deliverMasterYieldResponse",
"(",
"int",
"fromPlayer",
",",
"boolean",
"yielded",
")",
"{",
"for",
"(",
"final",
"MasterHandoffListener",
"listener",
":",
"getMasterHandoffListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"yieldRespo... | Send a master handoff yield response to all registered listeners.
@param fromPlayer the device number that is responding to our request that it yield the tempo master role to us
@param yielded will be {@code true} if we should now be the tempo master | [
"Send",
"a",
"master",
"handoff",
"yield",
"response",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L439-L447 |
163,906 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.deliverOnAirUpdate | private void deliverOnAirUpdate(Set<Integer> audibleChannels) {
for (final OnAirListener listener : getOnAirListeners()) {
try {
listener.channelsOnAir(audibleChannels);
} catch (Throwable t) {
logger.warn("Problem delivering channels on-air update to list... | java | private void deliverOnAirUpdate(Set<Integer> audibleChannels) {
for (final OnAirListener listener : getOnAirListeners()) {
try {
listener.channelsOnAir(audibleChannels);
} catch (Throwable t) {
logger.warn("Problem delivering channels on-air update to list... | [
"private",
"void",
"deliverOnAirUpdate",
"(",
"Set",
"<",
"Integer",
">",
"audibleChannels",
")",
"{",
"for",
"(",
"final",
"OnAirListener",
"listener",
":",
"getOnAirListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"channelsOnAir",
"(",
"audibleCh... | Send a channels on-air update to all registered listeners.
@param audibleChannels holds the device numbers of all channels that can currently be heard in the mixer output | [
"Send",
"a",
"channels",
"on",
"-",
"air",
"update",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L505-L513 |
163,907 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.deliverFaderStartCommand | private void deliverFaderStartCommand(Set<Integer> playersToStart, Set<Integer> playersToStop) {
for (final FaderStartListener listener : getFaderStartListeners()) {
try {
listener.fadersChanged(playersToStart, playersToStop);
} catch (Throwable t) {
logge... | java | private void deliverFaderStartCommand(Set<Integer> playersToStart, Set<Integer> playersToStop) {
for (final FaderStartListener listener : getFaderStartListeners()) {
try {
listener.fadersChanged(playersToStart, playersToStop);
} catch (Throwable t) {
logge... | [
"private",
"void",
"deliverFaderStartCommand",
"(",
"Set",
"<",
"Integer",
">",
"playersToStart",
",",
"Set",
"<",
"Integer",
">",
"playersToStop",
")",
"{",
"for",
"(",
"final",
"FaderStartListener",
"listener",
":",
"getFaderStartListeners",
"(",
")",
")",
"{"... | Send a fader start command to all registered listeners.
@param playersToStart contains the device numbers of all players that should start playing
@param playersToStop contains the device numbers of all players that should stop playing | [
"Send",
"a",
"fader",
"start",
"command",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L572-L580 |
163,908 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Message.java | Message.write | public void write(WritableByteChannel channel) throws IOException {
logger.debug("Writing> {}", this);
for (Field field : fields) {
field.write(channel);
}
} | java | public void write(WritableByteChannel channel) throws IOException {
logger.debug("Writing> {}", this);
for (Field field : fields) {
field.write(channel);
}
} | [
"public",
"void",
"write",
"(",
"WritableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Writing> {}\"",
",",
"this",
")",
";",
"for",
"(",
"Field",
"field",
":",
"fields",
")",
"{",
"field",
".",
"write",
"(",
... | Writes the message to the specified channel, for example when creating metadata cache files.
@param channel the channel to which it should be written
@throws IOException if there is a problem writing to the channel | [
"Writes",
"the",
"message",
"to",
"the",
"specified",
"channel",
"for",
"example",
"when",
"creating",
"metadata",
"cache",
"files",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Message.java#L1068-L1073 |
163,909 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.setFindDetails | public final void setFindDetails(boolean findDetails) {
this.findDetails.set(findDetails);
if (findDetails) {
primeCache(); // Get details for any tracks that were already loaded on players.
} else {
// Inform our listeners, on the proper thread, that the detailed wavefo... | java | public final void setFindDetails(boolean findDetails) {
this.findDetails.set(findDetails);
if (findDetails) {
primeCache(); // Get details for any tracks that were already loaded on players.
} else {
// Inform our listeners, on the proper thread, that the detailed wavefo... | [
"public",
"final",
"void",
"setFindDetails",
"(",
"boolean",
"findDetails",
")",
"{",
"this",
".",
"findDetails",
".",
"set",
"(",
"findDetails",
")",
";",
"if",
"(",
"findDetails",
")",
"{",
"primeCache",
"(",
")",
";",
"// Get details for any tracks that were ... | Set whether we should retrieve the waveform details in addition to the waveform previews.
@param findDetails if {@code true}, both types of waveform will be retrieved, if {@code false} only previews
will be retrieved | [
"Set",
"whether",
"we",
"should",
"retrieve",
"the",
"waveform",
"details",
"in",
"addition",
"to",
"the",
"waveform",
"previews",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L57-L74 |
163,910 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.setColorPreferred | public final void setColorPreferred(boolean preferColor) {
if (this.preferColor.compareAndSet(!preferColor, preferColor) && isRunning()) {
stop();
try {
start();
} catch (Exception e) {
logger.error("Unexplained exception restarting; we had bee... | java | public final void setColorPreferred(boolean preferColor) {
if (this.preferColor.compareAndSet(!preferColor, preferColor) && isRunning()) {
stop();
try {
start();
} catch (Exception e) {
logger.error("Unexplained exception restarting; we had bee... | [
"public",
"final",
"void",
"setColorPreferred",
"(",
"boolean",
"preferColor",
")",
"{",
"if",
"(",
"this",
".",
"preferColor",
".",
"compareAndSet",
"(",
"!",
"preferColor",
",",
"preferColor",
")",
"&&",
"isRunning",
"(",
")",
")",
"{",
"stop",
"(",
")",... | Set whether we should obtain color versions of waveforms and previews when they are available. This will only
affect waveforms loaded after the setting has been changed. If this changes the setting, and we were running,
stop and restart in order to flush and reload the correct waveform versions.
@param preferColor if ... | [
"Set",
"whether",
"we",
"should",
"obtain",
"color",
"versions",
"of",
"waveforms",
"and",
"previews",
"when",
"they",
"are",
"available",
".",
"This",
"will",
"only",
"affect",
"waveforms",
"loaded",
"after",
"the",
"setting",
"has",
"been",
"changed",
".",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L100-L109 |
163,911 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.clearDeckPreview | private void clearDeckPreview(TrackMetadataUpdate update) {
if (previewHotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {
deliverWaveformPreviewUpdate(update.player, null);
}
} | java | private void clearDeckPreview(TrackMetadataUpdate update) {
if (previewHotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {
deliverWaveformPreviewUpdate(update.player, null);
}
} | [
"private",
"void",
"clearDeckPreview",
"(",
"TrackMetadataUpdate",
"update",
")",
"{",
"if",
"(",
"previewHotCache",
".",
"remove",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
")",
"!=",
"null",
")",
"{",
"deli... | We have received an update that invalidates the waveform preview for a player, so clear it and alert
any listeners if this represents a change. This does not affect the hot cues; they will stick around until the
player loads a new track that overwrites one or more of them.
@param update the update which means we have ... | [
"We",
"have",
"received",
"an",
"update",
"that",
"invalidates",
"the",
"waveform",
"preview",
"for",
"a",
"player",
"so",
"clear",
"it",
"and",
"alert",
"any",
"listeners",
"if",
"this",
"represents",
"a",
"change",
".",
"This",
"does",
"not",
"affect",
"... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L219-L223 |
163,912 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.clearDeckDetail | private void clearDeckDetail(TrackMetadataUpdate update) {
if (detailHotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {
deliverWaveformDetailUpdate(update.player, null);
}
} | java | private void clearDeckDetail(TrackMetadataUpdate update) {
if (detailHotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {
deliverWaveformDetailUpdate(update.player, null);
}
} | [
"private",
"void",
"clearDeckDetail",
"(",
"TrackMetadataUpdate",
"update",
")",
"{",
"if",
"(",
"detailHotCache",
".",
"remove",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
")",
"!=",
"null",
")",
"{",
"delive... | We have received an update that invalidates the waveform detail for a player, so clear it and alert
any listeners if this represents a change. This does not affect the hot cues; they will stick around until the
player loads a new track that overwrites one or more of them.
@param update the update which means we have n... | [
"We",
"have",
"received",
"an",
"update",
"that",
"invalidates",
"the",
"waveform",
"detail",
"for",
"a",
"player",
"so",
"clear",
"it",
"and",
"alert",
"any",
"listeners",
"if",
"this",
"represents",
"a",
"change",
".",
"This",
"does",
"not",
"affect",
"t... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L232-L236 |
163,913 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.clearWaveforms | private void clearWaveforms(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(previewHotCache.keySet())) {
if (deck.player == player) {
... | java | private void clearWaveforms(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(previewHotCache.keySet())) {
if (deck.player == player) {
... | [
"private",
"void",
"clearWaveforms",
"(",
"DeviceAnnouncement",
"announcement",
")",
"{",
"final",
"int",
"player",
"=",
"announcement",
".",
"getNumber",
"(",
")",
";",
"// Iterate over a copy to avoid concurrent modification issues",
"for",
"(",
"DeckReference",
"deck",... | We have received notification that a device is no longer on the network, so clear out all its waveforms.
@param announcement the packet which reported the device’s disappearance | [
"We",
"have",
"received",
"notification",
"that",
"a",
"device",
"is",
"no",
"longer",
"on",
"the",
"network",
"so",
"clear",
"out",
"all",
"its",
"waveforms",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L255-L275 |
163,914 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.updatePreview | private void updatePreview(TrackMetadataUpdate update, WaveformPreview preview) {
previewHotCache.put(DeckReference.getDeckReference(update.player, 0), preview); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueLis... | java | private void updatePreview(TrackMetadataUpdate update, WaveformPreview preview) {
previewHotCache.put(DeckReference.getDeckReference(update.player, 0), preview); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueLis... | [
"private",
"void",
"updatePreview",
"(",
"TrackMetadataUpdate",
"update",
",",
"WaveformPreview",
"preview",
")",
"{",
"previewHotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"preview",
")",... | We have obtained a waveform preview for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this waveform preview
@param preview the waveform preview which we retrieved | [
"We",
"have",
"obtained",
"a",
"waveform",
"preview",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L283-L293 |
163,915 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.updateDetail | private void updateDetail(TrackMetadataUpdate update, WaveformDetail detail) {
detailHotCache.put(DeckReference.getDeckReference(update.player, 0), detail); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Ent... | java | private void updateDetail(TrackMetadataUpdate update, WaveformDetail detail) {
detailHotCache.put(DeckReference.getDeckReference(update.player, 0), detail); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Ent... | [
"private",
"void",
"updateDetail",
"(",
"TrackMetadataUpdate",
"update",
",",
"WaveformDetail",
"detail",
")",
"{",
"detailHotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"detail",
")",
";... | We have obtained waveform detail for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this waveform detail
@param detail the waveform detail which we retrieved | [
"We",
"have",
"obtained",
"waveform",
"detail",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L301-L311 |
163,916 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.getLoadedPreviews | @SuppressWarnings("WeakerAccess")
public Map<DeckReference, WaveformPreview> getLoadedPreviews() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<DeckReference, WaveformPreview>(previewHotCache));
... | java | @SuppressWarnings("WeakerAccess")
public Map<DeckReference, WaveformPreview> getLoadedPreviews() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<DeckReference, WaveformPreview>(previewHotCache));
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Map",
"<",
"DeckReference",
",",
"WaveformPreview",
">",
"getLoadedPreviews",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"// Make a copy so callers get an immutable snapshot of the current state.",
"retur... | Get the waveform previews available for all tracks currently loaded in any player, either on the play deck, or
in a hot cue.
@return the previews associated with all current players, including for any tracks loaded in their hot cue slots
@throws IllegalStateException if the WaveformFinder is not running | [
"Get",
"the",
"waveform",
"previews",
"available",
"for",
"all",
"tracks",
"currently",
"loaded",
"in",
"any",
"player",
"either",
"on",
"the",
"play",
"deck",
"or",
"in",
"a",
"hot",
"cue",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L321-L326 |
163,917 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.getLoadedDetails | @SuppressWarnings("WeakerAccess")
public Map<DeckReference, WaveformDetail> getLoadedDetails() {
ensureRunning();
if (!isFindingDetails()) {
throw new IllegalStateException("WaveformFinder is not configured to find waveform details.");
}
// Make a copy so callers get an i... | java | @SuppressWarnings("WeakerAccess")
public Map<DeckReference, WaveformDetail> getLoadedDetails() {
ensureRunning();
if (!isFindingDetails()) {
throw new IllegalStateException("WaveformFinder is not configured to find waveform details.");
}
// Make a copy so callers get an i... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Map",
"<",
"DeckReference",
",",
"WaveformDetail",
">",
"getLoadedDetails",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"if",
"(",
"!",
"isFindingDetails",
"(",
")",
")",
"{",
"throw",
"new... | Get the waveform details available for all tracks currently loaded in any player, either on the play deck, or
in a hot cue.
@return the details associated with all current players, including for any tracks loaded in their hot cue slots
@throws IllegalStateException if the WaveformFinder is not running or requesting w... | [
"Get",
"the",
"waveform",
"details",
"available",
"for",
"all",
"tracks",
"currently",
"loaded",
"in",
"any",
"player",
"either",
"on",
"the",
"play",
"deck",
"or",
"in",
"a",
"hot",
"cue",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L336-L344 |
163,918 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.requestPreviewInternal | private WaveformPreview requestPreviewInternal(final DataReference trackReference, final boolean failIfPassive) {
// First check if we are using cached data for this slot
MetadataCache cache = MetadataFinder.getInstance().getMetadataCache(SlotReference.getSlotReference(trackReference));
if (cac... | java | private WaveformPreview requestPreviewInternal(final DataReference trackReference, final boolean failIfPassive) {
// First check if we are using cached data for this slot
MetadataCache cache = MetadataFinder.getInstance().getMetadataCache(SlotReference.getSlotReference(trackReference));
if (cac... | [
"private",
"WaveformPreview",
"requestPreviewInternal",
"(",
"final",
"DataReference",
"trackReference",
",",
"final",
"boolean",
"failIfPassive",
")",
"{",
"// First check if we are using cached data for this slot",
"MetadataCache",
"cache",
"=",
"MetadataFinder",
".",
"getIns... | Ask the specified player for the waveform preview in the specified slot with the specified rekordbox ID,
using cached media instead if it is available, and possibly giving up if we are in passive mode.
@param trackReference uniquely identifies the desired waveform preview
@param failIfPassive will prevent the request ... | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"waveform",
"preview",
"in",
"the",
"specified",
"slot",
"with",
"the",
"specified",
"rekordbox",
"ID",
"using",
"cached",
"media",
"instead",
"if",
"it",
"is",
"available",
"and",
"possibly",
"giving",
"up",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L410-L447 |
163,919 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.requestWaveformPreviewFrom | public WaveformPreview requestWaveformPreviewFrom(final DataReference dataReference) {
ensureRunning();
for (WaveformPreview cached : previewHotCache.values()) {
if (cached.dataReference.equals(dataReference)) { // Found a hot cue hit, use it.
return cached;
}
... | java | public WaveformPreview requestWaveformPreviewFrom(final DataReference dataReference) {
ensureRunning();
for (WaveformPreview cached : previewHotCache.values()) {
if (cached.dataReference.equals(dataReference)) { // Found a hot cue hit, use it.
return cached;
}
... | [
"public",
"WaveformPreview",
"requestWaveformPreviewFrom",
"(",
"final",
"DataReference",
"dataReference",
")",
"{",
"ensureRunning",
"(",
")",
";",
"for",
"(",
"WaveformPreview",
"cached",
":",
"previewHotCache",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"c... | Ask the specified player for the specified waveform preview from the specified media slot, first checking if we
have a cached copy.
@param dataReference uniquely identifies the desired waveform preview
@return the preview, if it was found, or {@code null}
@throws IllegalStateException if the WaveformFinder is not ru... | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"specified",
"waveform",
"preview",
"from",
"the",
"specified",
"media",
"slot",
"first",
"checking",
"if",
"we",
"have",
"a",
"cached",
"copy",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L459-L467 |
163,920 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.getWaveformPreview | WaveformPreview getWaveformPreview(int rekordboxId, SlotReference slot, Client client)
throws IOException {
final NumberField idField = new NumberField(rekordboxId);
// First try to get the NXS2-style color waveform if we are supposed to.
if (preferColor.get()) {
try {
... | java | WaveformPreview getWaveformPreview(int rekordboxId, SlotReference slot, Client client)
throws IOException {
final NumberField idField = new NumberField(rekordboxId);
// First try to get the NXS2-style color waveform if we are supposed to.
if (preferColor.get()) {
try {
... | [
"WaveformPreview",
"getWaveformPreview",
"(",
"int",
"rekordboxId",
",",
"SlotReference",
"slot",
",",
"Client",
"client",
")",
"throws",
"IOException",
"{",
"final",
"NumberField",
"idField",
"=",
"new",
"NumberField",
"(",
"rekordboxId",
")",
";",
"// First try to... | Requests the waveform preview for a specific track ID, given a connection to a player that has already been
set up.
@param rekordboxId the track whose waveform preview is desired
@param slot identifies the media slot we are querying
@param client the dbserver client that is communicating with the appropriate player
@... | [
"Requests",
"the",
"waveform",
"preview",
"for",
"a",
"specific",
"track",
"ID",
"given",
"a",
"connection",
"to",
"a",
"player",
"that",
"has",
"already",
"been",
"set",
"up",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L480-L502 |
163,921 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.requestWaveformDetailFrom | public WaveformDetail requestWaveformDetailFrom(final DataReference dataReference) {
ensureRunning();
for (WaveformDetail cached : detailHotCache.values()) {
if (cached.dataReference.equals(dataReference)) { // Found a hot cue hit, use it.
return cached;
}
... | java | public WaveformDetail requestWaveformDetailFrom(final DataReference dataReference) {
ensureRunning();
for (WaveformDetail cached : detailHotCache.values()) {
if (cached.dataReference.equals(dataReference)) { // Found a hot cue hit, use it.
return cached;
}
... | [
"public",
"WaveformDetail",
"requestWaveformDetailFrom",
"(",
"final",
"DataReference",
"dataReference",
")",
"{",
"ensureRunning",
"(",
")",
";",
"for",
"(",
"WaveformDetail",
"cached",
":",
"detailHotCache",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"cache... | Ask the specified player for the specified waveform detail from the specified media slot, first checking if we
have a cached copy.
@param dataReference uniquely identifies the desired waveform detail
@return the waveform detail, if it was found, or {@code null}
@throws IllegalStateException if the WaveformFinder is ... | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"specified",
"waveform",
"detail",
"from",
"the",
"specified",
"media",
"slot",
"first",
"checking",
"if",
"we",
"have",
"a",
"cached",
"copy",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L563-L571 |
163,922 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.getWaveformDetail | WaveformDetail getWaveformDetail(int rekordboxId, SlotReference slot, Client client)
throws IOException {
final NumberField idField = new NumberField(rekordboxId);
// First try to get the NXS2-style color waveform if we are supposed to.
if (preferColor.get()) {
try {
... | java | WaveformDetail getWaveformDetail(int rekordboxId, SlotReference slot, Client client)
throws IOException {
final NumberField idField = new NumberField(rekordboxId);
// First try to get the NXS2-style color waveform if we are supposed to.
if (preferColor.get()) {
try {
... | [
"WaveformDetail",
"getWaveformDetail",
"(",
"int",
"rekordboxId",
",",
"SlotReference",
"slot",
",",
"Client",
"client",
")",
"throws",
"IOException",
"{",
"final",
"NumberField",
"idField",
"=",
"new",
"NumberField",
"(",
"rekordboxId",
")",
";",
"// First try to g... | Requests the waveform detail for a specific track ID, given a connection to a player that has already been
set up.
@param rekordboxId the track whose waveform detail is desired
@param slot identifies the media slot we are querying
@param client the dbserver client that is communicating with the appropriate player
@re... | [
"Requests",
"the",
"waveform",
"detail",
"for",
"a",
"specific",
"track",
"ID",
"given",
"a",
"connection",
"to",
"a",
"player",
"that",
"has",
"already",
"been",
"set",
"up",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L584-L603 |
163,923 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.deliverWaveformPreviewUpdate | private void deliverWaveformPreviewUpdate(final int player, final WaveformPreview preview) {
final Set<WaveformListener> listeners = getWaveformListeners();
if (!listeners.isEmpty()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
... | java | private void deliverWaveformPreviewUpdate(final int player, final WaveformPreview preview) {
final Set<WaveformListener> listeners = getWaveformListeners();
if (!listeners.isEmpty()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
... | [
"private",
"void",
"deliverWaveformPreviewUpdate",
"(",
"final",
"int",
"player",
",",
"final",
"WaveformPreview",
"preview",
")",
"{",
"final",
"Set",
"<",
"WaveformListener",
">",
"listeners",
"=",
"getWaveformListeners",
"(",
")",
";",
"if",
"(",
"!",
"listen... | Send a waveform preview update announcement to all registered listeners.
@param player the player whose waveform preview has changed
@param preview the new waveform preview, if any | [
"Send",
"a",
"waveform",
"preview",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L671-L689 |
163,924 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.deliverWaveformDetailUpdate | private void deliverWaveformDetailUpdate(final int player, final WaveformDetail detail) {
if (!getWaveformListeners().isEmpty()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final WaveformDetailUpdate update = new Wav... | java | private void deliverWaveformDetailUpdate(final int player, final WaveformDetail detail) {
if (!getWaveformListeners().isEmpty()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final WaveformDetailUpdate update = new Wav... | [
"private",
"void",
"deliverWaveformDetailUpdate",
"(",
"final",
"int",
"player",
",",
"final",
"WaveformDetail",
"detail",
")",
"{",
"if",
"(",
"!",
"getWaveformListeners",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"("... | Send a waveform detail update announcement to all registered listeners.
@param player the player whose waveform detail has changed
@param detail the new waveform detail, if any | [
"Send",
"a",
"waveform",
"detail",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L697-L714 |
163,925 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.primeCache | private void primeCache() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {
if (entry.getKey().hotCue == 0) { /... | java | private void primeCache() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {
if (entry.getKey().hotCue == 0) { /... | [
"private",
"void",
"primeCache",
"(",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"DeckReference",
",",
"TrackMetada... | Send ourselves "updates" about any tracks that were loaded before we started, or before we were requesting
details, since we missed them. | [
"Send",
"ourselves",
"updates",
"about",
"any",
"tracks",
"that",
"were",
"loaded",
"before",
"we",
"started",
"or",
"before",
"we",
"were",
"requesting",
"details",
"since",
"we",
"missed",
"them",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L823-L834 |
163,926 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.stop | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
MetadataFinder.getInstance().removeTrackMetadataListener(metadataListener);
running.set(false);
pendingUpdates.clear();
queueHandler.interrupt();
queueHandler = ... | java | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
MetadataFinder.getInstance().removeTrackMetadataListener(metadataListener);
running.set(false);
pendingUpdates.clear();
queueHandler.interrupt();
queueHandler = ... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"removeTrackMetadataListener",
"(",
"metadataListener... | Stop finding waveforms for all active players. | [
"Stop",
"finding",
"waveforms",
"for",
"all",
"active",
"players",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L877-L908 |
163,927 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.clearArt | private void clearArt(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
if (deck.player == player) {
... | java | private void clearArt(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
if (deck.player == player) {
... | [
"private",
"void",
"clearArt",
"(",
"DeviceAnnouncement",
"announcement",
")",
"{",
"final",
"int",
"player",
"=",
"announcement",
".",
"getNumber",
"(",
")",
";",
"// Iterate over a copy to avoid concurrent modification issues",
"for",
"(",
"DeckReference",
"deck",
":"... | We have received notification that a device is no longer on the network, so clear out its artwork.
@param announcement the packet which reported the device’s disappearance | [
"We",
"have",
"received",
"notification",
"that",
"a",
"device",
"is",
"no",
"longer",
"on",
"the",
"network",
"so",
"clear",
"out",
"its",
"artwork",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L152-L169 |
163,928 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.updateArt | private void updateArt(TrackMetadataUpdate update, AlbumArt art) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), art); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry entry : update.met... | java | private void updateArt(TrackMetadataUpdate update, AlbumArt art) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), art); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry entry : update.met... | [
"private",
"void",
"updateArt",
"(",
"TrackMetadataUpdate",
"update",
",",
"AlbumArt",
"art",
")",
"{",
"hotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"art",
")",
";",
"// Main deck",
... | We have obtained album art for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this art
@param art the album art which we retrieved | [
"We",
"have",
"obtained",
"album",
"art",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L177-L187 |
163,929 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.getLoadedArt | public Map<DeckReference, AlbumArt> getLoadedArt() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<DeckReference, AlbumArt>(hotCache));
} | java | public Map<DeckReference, AlbumArt> getLoadedArt() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<DeckReference, AlbumArt>(hotCache));
} | [
"public",
"Map",
"<",
"DeckReference",
",",
"AlbumArt",
">",
"getLoadedArt",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"// Make a copy so callers get an immutable snapshot of the current state.",
"return",
"Collections",
".",
"unmodifiableMap",
"(",
"new",
"HashMap",... | Get the art available for all tracks currently loaded in any player, either on the play deck, or in a hot cue.
@return the album art associated with all current players, including for any tracks loaded in their hot cue slots
@throws IllegalStateException if the ArtFinder is not running | [
"Get",
"the",
"art",
"available",
"for",
"all",
"tracks",
"currently",
"loaded",
"in",
"any",
"player",
"either",
"on",
"the",
"play",
"deck",
"or",
"in",
"a",
"hot",
"cue",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L196-L200 |
163,930 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.requestArtworkInternal | private AlbumArt requestArtworkInternal(final DataReference artReference, final CdjStatus.TrackType trackType,
final boolean failIfPassive) {
// First check if we are using cached data for this slot.
MetadataCache cache = MetadataFinder.getInstance().getMetad... | java | private AlbumArt requestArtworkInternal(final DataReference artReference, final CdjStatus.TrackType trackType,
final boolean failIfPassive) {
// First check if we are using cached data for this slot.
MetadataCache cache = MetadataFinder.getInstance().getMetad... | [
"private",
"AlbumArt",
"requestArtworkInternal",
"(",
"final",
"DataReference",
"artReference",
",",
"final",
"CdjStatus",
".",
"TrackType",
"trackType",
",",
"final",
"boolean",
"failIfPassive",
")",
"{",
"// First check if we are using cached data for this slot.",
"Metadata... | Ask the specified player for the album art in the specified slot with the specified rekordbox ID,
using cached media instead if it is available, and possibly giving up if we are in passive mode.
@param artReference uniquely identifies the desired album art
@param trackType the kind of track that owns the art
@param fa... | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"album",
"art",
"in",
"the",
"specified",
"slot",
"with",
"the",
"specified",
"rekordbox",
"ID",
"using",
"cached",
"media",
"instead",
"if",
"it",
"is",
"available",
"and",
"possibly",
"giving",
"up",
"if",... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L280-L326 |
163,931 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.requestArtworkFrom | public AlbumArt requestArtworkFrom(final DataReference artReference, final CdjStatus.TrackType trackType) {
ensureRunning();
AlbumArt artwork = findArtInMemoryCaches(artReference); // First check the in-memory artwork caches.
if (artwork == null) {
artwork = requestArtworkInternal(a... | java | public AlbumArt requestArtworkFrom(final DataReference artReference, final CdjStatus.TrackType trackType) {
ensureRunning();
AlbumArt artwork = findArtInMemoryCaches(artReference); // First check the in-memory artwork caches.
if (artwork == null) {
artwork = requestArtworkInternal(a... | [
"public",
"AlbumArt",
"requestArtworkFrom",
"(",
"final",
"DataReference",
"artReference",
",",
"final",
"CdjStatus",
".",
"TrackType",
"trackType",
")",
"{",
"ensureRunning",
"(",
")",
";",
"AlbumArt",
"artwork",
"=",
"findArtInMemoryCaches",
"(",
"artReference",
"... | Ask the specified player for the specified artwork from the specified media slot, first checking if we have a
cached copy.
@param artReference uniquely identifies the desired artwork
@param trackType the kind of track that owns the artwork
@return the artwork, if it was found, or {@code null}
@throws IllegalStateExc... | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"specified",
"artwork",
"from",
"the",
"specified",
"media",
"slot",
"first",
"checking",
"if",
"we",
"have",
"a",
"cached",
"copy",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L339-L346 |
163,932 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.getArtwork | AlbumArt getArtwork(int artworkId, SlotReference slot, CdjStatus.TrackType trackType, Client client)
throws IOException {
// Send the artwork request
Message response = client.simpleRequest(Message.KnownType.ALBUM_ART_REQ, Message.KnownType.ALBUM_ART,
client.buildRMST(Messag... | java | AlbumArt getArtwork(int artworkId, SlotReference slot, CdjStatus.TrackType trackType, Client client)
throws IOException {
// Send the artwork request
Message response = client.simpleRequest(Message.KnownType.ALBUM_ART_REQ, Message.KnownType.ALBUM_ART,
client.buildRMST(Messag... | [
"AlbumArt",
"getArtwork",
"(",
"int",
"artworkId",
",",
"SlotReference",
"slot",
",",
"CdjStatus",
".",
"TrackType",
"trackType",
",",
"Client",
"client",
")",
"throws",
"IOException",
"{",
"// Send the artwork request",
"Message",
"response",
"=",
"client",
".",
... | Request the artwork with a particular artwork ID, given a connection to a player that has already been set up.
@param artworkId identifies the album art to retrieve
@param slot the slot identifier from which the associated track was loaded
@param trackType the kind of track that owns the artwork
@param client the dbse... | [
"Request",
"the",
"artwork",
"with",
"a",
"particular",
"artwork",
"ID",
"given",
"a",
"connection",
"to",
"a",
"player",
"that",
"has",
"already",
"been",
"set",
"up",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L360-L369 |
163,933 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.findArtInMemoryCaches | private AlbumArt findArtInMemoryCaches(DataReference artReference) {
// First see if we can find the new track in the hot cache as a hot cue
for (AlbumArt cached : hotCache.values()) {
if (cached.artReference.equals(artReference)) { // Found a hot cue hit, use it.
return cac... | java | private AlbumArt findArtInMemoryCaches(DataReference artReference) {
// First see if we can find the new track in the hot cache as a hot cue
for (AlbumArt cached : hotCache.values()) {
if (cached.artReference.equals(artReference)) { // Found a hot cue hit, use it.
return cac... | [
"private",
"AlbumArt",
"findArtInMemoryCaches",
"(",
"DataReference",
"artReference",
")",
"{",
"// First see if we can find the new track in the hot cache as a hot cue",
"for",
"(",
"AlbumArt",
"cached",
":",
"hotCache",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"c... | Look for the specified album art in both the hot cache of loaded tracks and the longer-lived LRU cache.
@param artReference uniquely identifies the desired album art
@return the art, if it was found in one of our caches, or {@code null} | [
"Look",
"for",
"the",
"specified",
"album",
"art",
"in",
"both",
"the",
"hot",
"cache",
"of",
"loaded",
"tracks",
"and",
"the",
"longer",
"-",
"lived",
"LRU",
"cache",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L383-L393 |
163,934 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.deliverAlbumArtUpdate | private void deliverAlbumArtUpdate(int player, AlbumArt art) {
if (!getAlbumArtListeners().isEmpty()) {
final AlbumArtUpdate update = new AlbumArtUpdate(player, art);
for (final AlbumArtListener listener : getAlbumArtListeners()) {
try {
listener.album... | java | private void deliverAlbumArtUpdate(int player, AlbumArt art) {
if (!getAlbumArtListeners().isEmpty()) {
final AlbumArtUpdate update = new AlbumArtUpdate(player, art);
for (final AlbumArtListener listener : getAlbumArtListeners()) {
try {
listener.album... | [
"private",
"void",
"deliverAlbumArtUpdate",
"(",
"int",
"player",
",",
"AlbumArt",
"art",
")",
"{",
"if",
"(",
"!",
"getAlbumArtListeners",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"AlbumArtUpdate",
"update",
"=",
"new",
"AlbumArtUpdate",
"(",
... | Send an album art update announcement to all registered listeners. | [
"Send",
"an",
"album",
"art",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L450-L462 |
163,935 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/AlbumArt.java | AlbumArt.getImage | public BufferedImage getImage() {
ByteBuffer artwork = getRawBytes();
artwork.rewind();
byte[] imageBytes = new byte[artwork.remaining()];
artwork.get(imageBytes);
try {
return ImageIO.read(new ByteArrayInputStream(imageBytes));
} catch (IOException e) {
... | java | public BufferedImage getImage() {
ByteBuffer artwork = getRawBytes();
artwork.rewind();
byte[] imageBytes = new byte[artwork.remaining()];
artwork.get(imageBytes);
try {
return ImageIO.read(new ByteArrayInputStream(imageBytes));
} catch (IOException e) {
... | [
"public",
"BufferedImage",
"getImage",
"(",
")",
"{",
"ByteBuffer",
"artwork",
"=",
"getRawBytes",
"(",
")",
";",
"artwork",
".",
"rewind",
"(",
")",
";",
"byte",
"[",
"]",
"imageBytes",
"=",
"new",
"byte",
"[",
"artwork",
".",
"remaining",
"(",
")",
"... | Given the byte buffer containing album art, build an actual image from it for easy rendering.
@return the newly-created image, ready to be drawn | [
"Given",
"the",
"byte",
"buffer",
"containing",
"album",
"art",
"build",
"an",
"actual",
"image",
"from",
"it",
"for",
"easy",
"rendering",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/AlbumArt.java#L52-L63 |
163,936 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | CdjStatus.findTrackSourceSlot | private TrackSourceSlot findTrackSourceSlot() {
TrackSourceSlot result = TRACK_SOURCE_SLOT_MAP.get(packetBytes[41]);
if (result == null) {
return TrackSourceSlot.UNKNOWN;
}
return result;
} | java | private TrackSourceSlot findTrackSourceSlot() {
TrackSourceSlot result = TRACK_SOURCE_SLOT_MAP.get(packetBytes[41]);
if (result == null) {
return TrackSourceSlot.UNKNOWN;
}
return result;
} | [
"private",
"TrackSourceSlot",
"findTrackSourceSlot",
"(",
")",
"{",
"TrackSourceSlot",
"result",
"=",
"TRACK_SOURCE_SLOT_MAP",
".",
"get",
"(",
"packetBytes",
"[",
"41",
"]",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"TrackSourceSlot",
"... | Determine the enum value corresponding to the track source slot found in the packet.
@return the proper value | [
"Determine",
"the",
"enum",
"value",
"corresponding",
"to",
"the",
"track",
"source",
"slot",
"found",
"in",
"the",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java#L489-L495 |
163,937 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | CdjStatus.findTrackType | private TrackType findTrackType() {
TrackType result = TRACK_TYPE_MAP.get(packetBytes[42]);
if (result == null) {
return TrackType.UNKNOWN;
}
return result;
} | java | private TrackType findTrackType() {
TrackType result = TRACK_TYPE_MAP.get(packetBytes[42]);
if (result == null) {
return TrackType.UNKNOWN;
}
return result;
} | [
"private",
"TrackType",
"findTrackType",
"(",
")",
"{",
"TrackType",
"result",
"=",
"TRACK_TYPE_MAP",
".",
"get",
"(",
"packetBytes",
"[",
"42",
"]",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"TrackType",
".",
"UNKNOWN",
";",
"}",
... | Determine the enum value corresponding to the track type found in the packet.
@return the proper value | [
"Determine",
"the",
"enum",
"value",
"corresponding",
"to",
"the",
"track",
"type",
"found",
"in",
"the",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java#L502-L508 |
163,938 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | CdjStatus.findPlayState1 | private PlayState1 findPlayState1() {
PlayState1 result = PLAY_STATE_1_MAP.get(packetBytes[123]);
if (result == null) {
return PlayState1.UNKNOWN;
}
return result;
} | java | private PlayState1 findPlayState1() {
PlayState1 result = PLAY_STATE_1_MAP.get(packetBytes[123]);
if (result == null) {
return PlayState1.UNKNOWN;
}
return result;
} | [
"private",
"PlayState1",
"findPlayState1",
"(",
")",
"{",
"PlayState1",
"result",
"=",
"PLAY_STATE_1_MAP",
".",
"get",
"(",
"packetBytes",
"[",
"123",
"]",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"PlayState1",
".",
"UNKNOWN",
";",
... | Determine the enum value corresponding to the first play state found in the packet.
@return the proper value | [
"Determine",
"the",
"enum",
"value",
"corresponding",
"to",
"the",
"first",
"play",
"state",
"found",
"in",
"the",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java#L515-L521 |
163,939 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | CdjStatus.findPlayState3 | private PlayState3 findPlayState3() {
PlayState3 result = PLAY_STATE_3_MAP.get(packetBytes[157]);
if (result == null) {
return PlayState3.UNKNOWN;
}
return result;
} | java | private PlayState3 findPlayState3() {
PlayState3 result = PLAY_STATE_3_MAP.get(packetBytes[157]);
if (result == null) {
return PlayState3.UNKNOWN;
}
return result;
} | [
"private",
"PlayState3",
"findPlayState3",
"(",
")",
"{",
"PlayState3",
"result",
"=",
"PLAY_STATE_3_MAP",
".",
"get",
"(",
"packetBytes",
"[",
"157",
"]",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"PlayState3",
".",
"UNKNOWN",
";",
... | Determine the enum value corresponding to the third play state found in the packet.
@return the proper value | [
"Determine",
"the",
"enum",
"value",
"corresponding",
"to",
"the",
"third",
"play",
"state",
"found",
"in",
"the",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java#L550-L556 |
163,940 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | CdjStatus.isPlaying | @SuppressWarnings("WeakerAccess")
public boolean isPlaying() {
if (packetBytes.length >= 212) {
return (packetBytes[STATUS_FLAGS] & PLAYING_FLAG) > 0;
} else {
final PlayState1 state = getPlayState1();
return state == PlayState1.PLAYING || state == PlayState1.LOO... | java | @SuppressWarnings("WeakerAccess")
public boolean isPlaying() {
if (packetBytes.length >= 212) {
return (packetBytes[STATUS_FLAGS] & PLAYING_FLAG) > 0;
} else {
final PlayState1 state = getPlayState1();
return state == PlayState1.PLAYING || state == PlayState1.LOO... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"boolean",
"isPlaying",
"(",
")",
"{",
"if",
"(",
"packetBytes",
".",
"length",
">=",
"212",
")",
"{",
"return",
"(",
"packetBytes",
"[",
"STATUS_FLAGS",
"]",
"&",
"PLAYING_FLAG",
")",
">",
"... | Was the CDJ playing a track when this update was sent?
@return true if the play flag was set, or, if this seems to be a non-nexus player, if <em>P<sub>1</sub></em>
has a value corresponding to a playing state. | [
"Was",
"the",
"CDJ",
"playing",
"a",
"track",
"when",
"this",
"update",
"was",
"sent?"
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java#L719-L728 |
163,941 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/CdjStatus.java | CdjStatus.formatCueCountdown | @SuppressWarnings("WeakerAccess")
public String formatCueCountdown() {
int count = getCueCountdown();
if (count == 511) {
return "--.-";
}
if ((count >= 1) && (count <= 256)) {
int bars = (count - 1) / 4;
int beats = ((count - 1) % 4) + 1;
... | java | @SuppressWarnings("WeakerAccess")
public String formatCueCountdown() {
int count = getCueCountdown();
if (count == 511) {
return "--.-";
}
if ((count >= 1) && (count <= 256)) {
int bars = (count - 1) / 4;
int beats = ((count - 1) % 4) + 1;
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"String",
"formatCueCountdown",
"(",
")",
"{",
"int",
"count",
"=",
"getCueCountdown",
"(",
")",
";",
"if",
"(",
"count",
"==",
"511",
")",
"{",
"return",
"\"--.-\"",
";",
"}",
"if",
"(",
"... | Format a cue countdown indicator in the same way as the CDJ would at this point in the track.
@return the value that the CDJ would display to indicate the distance to the next cue
@see #getCueCountdown() | [
"Format",
"a",
"cue",
"countdown",
"indicator",
"in",
"the",
"same",
"way",
"as",
"the",
"CDJ",
"would",
"at",
"this",
"point",
"in",
"the",
"track",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/CdjStatus.java#L1011-L1030 |
163,942 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.clearDeck | private void clearDeck(TrackMetadataUpdate update) {
if (hotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {
deliverBeatGridUpdate(update.player, null);
}
} | java | private void clearDeck(TrackMetadataUpdate update) {
if (hotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {
deliverBeatGridUpdate(update.player, null);
}
} | [
"private",
"void",
"clearDeck",
"(",
"TrackMetadataUpdate",
"update",
")",
"{",
"if",
"(",
"hotCache",
".",
"remove",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
")",
"!=",
"null",
")",
"{",
"deliverBeatGridUpd... | We have received an update that invalidates the beat grid for a player, so clear it and alert
any listeners if this represents a change. This does not affect the hot cues; they will stick around until the
player loads a new track that overwrites one or more of them.
@param update the update which means we have no beat... | [
"We",
"have",
"received",
"an",
"update",
"that",
"invalidates",
"the",
"beat",
"grid",
"for",
"a",
"player",
"so",
"clear",
"it",
"and",
"alert",
"any",
"listeners",
"if",
"this",
"represents",
"a",
"change",
".",
"This",
"does",
"not",
"affect",
"the",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L131-L135 |
163,943 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.clearBeatGrids | private void clearBeatGrids(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
if (deck.player == player) {
... | java | private void clearBeatGrids(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
if (deck.player == player) {
... | [
"private",
"void",
"clearBeatGrids",
"(",
"DeviceAnnouncement",
"announcement",
")",
"{",
"final",
"int",
"player",
"=",
"announcement",
".",
"getNumber",
"(",
")",
";",
"// Iterate over a copy to avoid concurrent modification issues",
"for",
"(",
"DeckReference",
"deck",... | We have received notification that a device is no longer on the network, so clear out all its beat grids.
@param announcement the packet which reported the device’s disappearance | [
"We",
"have",
"received",
"notification",
"that",
"a",
"device",
"is",
"no",
"longer",
"on",
"the",
"network",
"so",
"clear",
"out",
"all",
"its",
"beat",
"grids",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L142-L153 |
163,944 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.updateBeatGrid | private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), beatGrid); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry ent... | java | private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), beatGrid); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry ent... | [
"private",
"void",
"updateBeatGrid",
"(",
"TrackMetadataUpdate",
"update",
",",
"BeatGrid",
"beatGrid",
")",
"{",
"hotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"beatGrid",
")",
";",
"... | We have obtained a beat grid for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this beat grid
@param beatGrid the beat grid which we retrieved | [
"We",
"have",
"obtained",
"a",
"beat",
"grid",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L161-L171 |
163,945 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.getLoadedBeatGrids | @SuppressWarnings("WeakerAccess")
public Map<DeckReference, BeatGrid> getLoadedBeatGrids() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<DeckReference, BeatGrid>(hotCache));
} | java | @SuppressWarnings("WeakerAccess")
public Map<DeckReference, BeatGrid> getLoadedBeatGrids() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<DeckReference, BeatGrid>(hotCache));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Map",
"<",
"DeckReference",
",",
"BeatGrid",
">",
"getLoadedBeatGrids",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"// Make a copy so callers get an immutable snapshot of the current state.",
"return",
... | Get the beat grids available for all tracks currently loaded in any player, either on the play deck, or
in a hot cue.
@return the beat grids associated with all current players, including for any tracks loaded in their hot cue slots
@throws IllegalStateException if the BeatGridFinder is not running | [
"Get",
"the",
"beat",
"grids",
"available",
"for",
"all",
"tracks",
"currently",
"loaded",
"in",
"any",
"player",
"either",
"on",
"the",
"play",
"deck",
"or",
"in",
"a",
"hot",
"cue",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L181-L186 |
163,946 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.requestBeatGridFrom | public BeatGrid requestBeatGridFrom(final DataReference track) {
for (BeatGrid cached : hotCache.values()) {
if (cached.dataReference.equals(track)) { // Found a hot cue hit, use it.
return cached;
}
}
return requestBeatGridInternal(track, false);
} | java | public BeatGrid requestBeatGridFrom(final DataReference track) {
for (BeatGrid cached : hotCache.values()) {
if (cached.dataReference.equals(track)) { // Found a hot cue hit, use it.
return cached;
}
}
return requestBeatGridInternal(track, false);
} | [
"public",
"BeatGrid",
"requestBeatGridFrom",
"(",
"final",
"DataReference",
"track",
")",
"{",
"for",
"(",
"BeatGrid",
"cached",
":",
"hotCache",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"cached",
".",
"dataReference",
".",
"equals",
"(",
"track",
")"... | Ask the specified player for the beat grid of the track in the specified slot with the specified rekordbox ID,
first checking if we have a cache we can use instead.
@param track uniquely identifies the track whose beat grid is desired
@return the beat grid, if any | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"beat",
"grid",
"of",
"the",
"track",
"in",
"the",
"specified",
"slot",
"with",
"the",
"specified",
"rekordbox",
"ID",
"first",
"checking",
"if",
"we",
"have",
"a",
"cache",
"we",
"can",
"use",
"instead",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L278-L285 |
163,947 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.getBeatGrid | BeatGrid getBeatGrid(int rekordboxId, SlotReference slot, Client client)
throws IOException {
Message response = client.simpleRequest(Message.KnownType.BEAT_GRID_REQ, null,
client.buildRMST(Message.MenuIdentifier.DATA, slot.slot), new NumberField(rekordboxId));
if (response.k... | java | BeatGrid getBeatGrid(int rekordboxId, SlotReference slot, Client client)
throws IOException {
Message response = client.simpleRequest(Message.KnownType.BEAT_GRID_REQ, null,
client.buildRMST(Message.MenuIdentifier.DATA, slot.slot), new NumberField(rekordboxId));
if (response.k... | [
"BeatGrid",
"getBeatGrid",
"(",
"int",
"rekordboxId",
",",
"SlotReference",
"slot",
",",
"Client",
"client",
")",
"throws",
"IOException",
"{",
"Message",
"response",
"=",
"client",
".",
"simpleRequest",
"(",
"Message",
".",
"KnownType",
".",
"BEAT_GRID_REQ",
",... | Requests the beat grid for a specific track ID, given a connection to a player that has already been set up.
@param rekordboxId the track of interest
@param slot identifies the media slot we are querying
@param client the dbserver client that is communicating with the appropriate player
@return the retrieved beat gri... | [
"Requests",
"the",
"beat",
"grid",
"for",
"a",
"specific",
"track",
"ID",
"given",
"a",
"connection",
"to",
"a",
"player",
"that",
"has",
"already",
"been",
"set",
"up",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L298-L307 |
163,948 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.deliverBeatGridUpdate | private void deliverBeatGridUpdate(int player, BeatGrid beatGrid) {
if (!getBeatGridListeners().isEmpty()) {
final BeatGridUpdate update = new BeatGridUpdate(player, beatGrid);
for (final BeatGridListener listener : getBeatGridListeners()) {
try {
list... | java | private void deliverBeatGridUpdate(int player, BeatGrid beatGrid) {
if (!getBeatGridListeners().isEmpty()) {
final BeatGridUpdate update = new BeatGridUpdate(player, beatGrid);
for (final BeatGridListener listener : getBeatGridListeners()) {
try {
list... | [
"private",
"void",
"deliverBeatGridUpdate",
"(",
"int",
"player",
",",
"BeatGrid",
"beatGrid",
")",
"{",
"if",
"(",
"!",
"getBeatGridListeners",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"BeatGridUpdate",
"update",
"=",
"new",
"BeatGridUpdate",
... | Send a beat grid update announcement to all registered listeners.
@param player the player whose beat grid information has changed
@param beatGrid the new beat grid associated with that player, if any | [
"Send",
"a",
"beat",
"grid",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L372-L384 |
163,949 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.stop | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
MetadataFinder.getInstance().removeTrackMetadataListener(metadataListener);
running.set(false);
pendingUpdates.clear();
queueHandler.interrupt();
queueHandler = ... | java | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
MetadataFinder.getInstance().removeTrackMetadataListener(metadataListener);
running.set(false);
pendingUpdates.clear();
queueHandler.interrupt();
queueHandler = ... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"removeTrackMetadataListener",
"(",
"metadataListener... | Stop finding beat grids for all active players. | [
"Stop",
"finding",
"beat",
"grids",
"for",
"all",
"active",
"players",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L502-L526 |
163,950 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.interpolateTimeSinceUpdate | private long interpolateTimeSinceUpdate(TrackPositionUpdate update, long currentTimestamp) {
if (!update.playing) {
return update.milliseconds;
}
long elapsedMillis = (currentTimestamp - update.timestamp) / 1000000;
long moved = Math.round(update.pitch * elapsedMillis);
... | java | private long interpolateTimeSinceUpdate(TrackPositionUpdate update, long currentTimestamp) {
if (!update.playing) {
return update.milliseconds;
}
long elapsedMillis = (currentTimestamp - update.timestamp) / 1000000;
long moved = Math.round(update.pitch * elapsedMillis);
... | [
"private",
"long",
"interpolateTimeSinceUpdate",
"(",
"TrackPositionUpdate",
"update",
",",
"long",
"currentTimestamp",
")",
"{",
"if",
"(",
"!",
"update",
".",
"playing",
")",
"{",
"return",
"update",
".",
"milliseconds",
";",
"}",
"long",
"elapsedMillis",
"=",... | Figure out, based on how much time has elapsed since we received an update, and the playback position,
speed, and direction at the time of that update, where the player will be now.
@param update the most recent update received from a player
@param currentTimestamp the nanosecond timestamp representing when we want to... | [
"Figure",
"out",
"based",
"on",
"how",
"much",
"time",
"has",
"elapsed",
"since",
"we",
"received",
"an",
"update",
"and",
"the",
"playback",
"position",
"speed",
"and",
"direction",
"at",
"the",
"time",
"of",
"that",
"update",
"where",
"the",
"player",
"w... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L151-L161 |
163,951 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.interpolateTimeFromUpdate | private long interpolateTimeFromUpdate(TrackPositionUpdate lastTrackUpdate, CdjStatus newDeviceUpdate,
BeatGrid beatGrid) {
final int beatNumber = newDeviceUpdate.getBeatNumber();
final boolean noLongerPlaying = !newDeviceUpdate.isPlaying();
// If we h... | java | private long interpolateTimeFromUpdate(TrackPositionUpdate lastTrackUpdate, CdjStatus newDeviceUpdate,
BeatGrid beatGrid) {
final int beatNumber = newDeviceUpdate.getBeatNumber();
final boolean noLongerPlaying = !newDeviceUpdate.isPlaying();
// If we h... | [
"private",
"long",
"interpolateTimeFromUpdate",
"(",
"TrackPositionUpdate",
"lastTrackUpdate",
",",
"CdjStatus",
"newDeviceUpdate",
",",
"BeatGrid",
"beatGrid",
")",
"{",
"final",
"int",
"beatNumber",
"=",
"newDeviceUpdate",
".",
"getBeatNumber",
"(",
")",
";",
"final... | Sanity-check a new non-beat update, make sure we are still interpolating a sensible position, and correct
as needed.
@param lastTrackUpdate the most recent digested update received from a player
@param newDeviceUpdate a new status update from the player
@param beatGrid the beat grid for the track that is playing, in c... | [
"Sanity",
"-",
"check",
"a",
"new",
"non",
"-",
"beat",
"update",
"make",
"sure",
"we",
"are",
"still",
"interpolating",
"a",
"sensible",
"position",
"and",
"correct",
"as",
"needed",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L199-L241 |
163,952 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.getTimeFor | public long getTimeFor(int player) {
TrackPositionUpdate update = positions.get(player);
if (update != null) {
return interpolateTimeSinceUpdate(update, System.nanoTime());
}
return -1; // We don't know.
} | java | public long getTimeFor(int player) {
TrackPositionUpdate update = positions.get(player);
if (update != null) {
return interpolateTimeSinceUpdate(update, System.nanoTime());
}
return -1; // We don't know.
} | [
"public",
"long",
"getTimeFor",
"(",
"int",
"player",
")",
"{",
"TrackPositionUpdate",
"update",
"=",
"positions",
".",
"get",
"(",
"player",
")",
";",
"if",
"(",
"update",
"!=",
"null",
")",
"{",
"return",
"interpolateTimeSinceUpdate",
"(",
"update",
",",
... | Get the best guess we have for the current track position on the specified player.
@param player the player number whose position is desired
@return the milliseconds into the track that we believe playback has reached, or -1 if we don't know
@throws IllegalStateException if the TimeFinder is not running | [
"Get",
"the",
"best",
"guess",
"we",
"have",
"for",
"the",
"current",
"track",
"position",
"on",
"the",
"specified",
"player",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L252-L258 |
163,953 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.interpolationsDisagree | private boolean interpolationsDisagree(TrackPositionUpdate lastUpdate, TrackPositionUpdate currentUpdate) {
long now = System.nanoTime();
return Math.abs(interpolateTimeSinceUpdate(lastUpdate, now) - interpolateTimeSinceUpdate(currentUpdate, now)) >
slack.get();
} | java | private boolean interpolationsDisagree(TrackPositionUpdate lastUpdate, TrackPositionUpdate currentUpdate) {
long now = System.nanoTime();
return Math.abs(interpolateTimeSinceUpdate(lastUpdate, now) - interpolateTimeSinceUpdate(currentUpdate, now)) >
slack.get();
} | [
"private",
"boolean",
"interpolationsDisagree",
"(",
"TrackPositionUpdate",
"lastUpdate",
",",
"TrackPositionUpdate",
"currentUpdate",
")",
"{",
"long",
"now",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"return",
"Math",
".",
"abs",
"(",
"interpolateTimeSinceUpd... | Check whether we have diverged from what we would predict from the last update that was sent to a particular
track position listener.
@param lastUpdate the last update that was sent to the listener
@param currentUpdate the latest update available for the same player
@return {@code true }if the listener will have dive... | [
"Check",
"whether",
"we",
"have",
"diverged",
"from",
"what",
"we",
"would",
"predict",
"from",
"the",
"last",
"update",
"that",
"was",
"sent",
"to",
"a",
"particular",
"track",
"position",
"listener",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L363-L367 |
163,954 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.stop | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
BeatFinder.getInstance().removeBeatListener(beatListener);
VirtualCdj.getInstance().removeUpdateListener(updateListener);
running.set(false);
positions.clear();
... | java | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
BeatFinder.getInstance().removeBeatListener(beatListener);
VirtualCdj.getInstance().removeUpdateListener(updateListener);
running.set(false);
positions.clear();
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"BeatFinder",
".",
"getInstance",
"(",
")",
".",
"removeBeatListener",
"(",
"beatListener",
")",
";",
... | Stop interpolating playback position for all active players. | [
"Stop",
"interpolating",
"playback",
"position",
"for",
"all",
"active",
"players",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L598-L608 |
163,955 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/DeckReference.java | DeckReference.getDeckReference | public static synchronized DeckReference getDeckReference(int player, int hotCue) {
Map<Integer, DeckReference> playerMap = instances.get(player);
if (playerMap == null) {
playerMap = new HashMap<Integer, DeckReference>();
instances.put(player, playerMap);
}
DeckR... | java | public static synchronized DeckReference getDeckReference(int player, int hotCue) {
Map<Integer, DeckReference> playerMap = instances.get(player);
if (playerMap == null) {
playerMap = new HashMap<Integer, DeckReference>();
instances.put(player, playerMap);
}
DeckR... | [
"public",
"static",
"synchronized",
"DeckReference",
"getDeckReference",
"(",
"int",
"player",
",",
"int",
"hotCue",
")",
"{",
"Map",
"<",
"Integer",
",",
"DeckReference",
">",
"playerMap",
"=",
"instances",
".",
"get",
"(",
"player",
")",
";",
"if",
"(",
... | Get a unique reference to a place where a track is currently loaded in a player.
@param player the player in which the track is loaded
@param hotCue hot cue number in which the track is loaded, or 0 if it is actively loaded on the playback deck
@return the instance that will always represent a reference to the specif... | [
"Get",
"a",
"unique",
"reference",
"to",
"a",
"place",
"where",
"a",
"track",
"is",
"currently",
"loaded",
"in",
"a",
"player",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/DeckReference.java#L50-L62 |
163,956 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.setDeviceName | public synchronized void setDeviceName(String name) {
if (name.getBytes().length > DEVICE_NAME_LENGTH) {
throw new IllegalArgumentException("name cannot be more than " + DEVICE_NAME_LENGTH + " bytes long");
}
Arrays.fill(announcementBytes, DEVICE_NAME_OFFSET, DEVICE_NAME_LENGTH, (byt... | java | public synchronized void setDeviceName(String name) {
if (name.getBytes().length > DEVICE_NAME_LENGTH) {
throw new IllegalArgumentException("name cannot be more than " + DEVICE_NAME_LENGTH + " bytes long");
}
Arrays.fill(announcementBytes, DEVICE_NAME_OFFSET, DEVICE_NAME_LENGTH, (byt... | [
"public",
"synchronized",
"void",
"setDeviceName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"getBytes",
"(",
")",
".",
"length",
">",
"DEVICE_NAME_LENGTH",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name cannot be more than \"",
... | Set the name to be used in announcing our presence on the network. The name can be no longer than twenty
bytes, and should be normal ASCII, no Unicode.
@param name the device name to report in our presence announcement packets. | [
"Set",
"the",
"name",
"to",
"be",
"used",
"in",
"announcing",
"our",
"presence",
"on",
"the",
"network",
".",
"The",
"name",
"can",
"be",
"no",
"longer",
"than",
"twenty",
"bytes",
"and",
"should",
"be",
"normal",
"ASCII",
"no",
"Unicode",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L233-L239 |
163,957 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.setTempoMaster | private void setTempoMaster(DeviceUpdate newMaster) {
DeviceUpdate oldMaster = tempoMaster.getAndSet(newMaster);
if ((newMaster == null && oldMaster != null) ||
(newMaster != null && ((oldMaster == null) || !newMaster.getAddress().equals(oldMaster.getAddress())))) {
// This i... | java | private void setTempoMaster(DeviceUpdate newMaster) {
DeviceUpdate oldMaster = tempoMaster.getAndSet(newMaster);
if ((newMaster == null && oldMaster != null) ||
(newMaster != null && ((oldMaster == null) || !newMaster.getAddress().equals(oldMaster.getAddress())))) {
// This i... | [
"private",
"void",
"setTempoMaster",
"(",
"DeviceUpdate",
"newMaster",
")",
"{",
"DeviceUpdate",
"oldMaster",
"=",
"tempoMaster",
".",
"getAndSet",
"(",
"newMaster",
")",
";",
"if",
"(",
"(",
"newMaster",
"==",
"null",
"&&",
"oldMaster",
"!=",
"null",
")",
"... | Establish a new tempo master, and if it is a change from the existing one, report it to the listeners.
@param newMaster the packet which caused the change of masters, or {@code null} if there is now no master. | [
"Establish",
"a",
"new",
"tempo",
"master",
"and",
"if",
"it",
"is",
"a",
"change",
"from",
"the",
"existing",
"one",
"report",
"it",
"to",
"the",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L266-L273 |
163,958 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.setMasterTempo | private void setMasterTempo(double newTempo) {
double oldTempo = Double.longBitsToDouble(masterTempo.getAndSet(Double.doubleToLongBits(newTempo)));
if ((getTempoMaster() != null) && (Math.abs(newTempo - oldTempo) > getTempoEpsilon())) {
// This is a change in tempo, so report it to any regis... | java | private void setMasterTempo(double newTempo) {
double oldTempo = Double.longBitsToDouble(masterTempo.getAndSet(Double.doubleToLongBits(newTempo)));
if ((getTempoMaster() != null) && (Math.abs(newTempo - oldTempo) > getTempoEpsilon())) {
// This is a change in tempo, so report it to any regis... | [
"private",
"void",
"setMasterTempo",
"(",
"double",
"newTempo",
")",
"{",
"double",
"oldTempo",
"=",
"Double",
".",
"longBitsToDouble",
"(",
"masterTempo",
".",
"getAndSet",
"(",
"Double",
".",
"doubleToLongBits",
"(",
"newTempo",
")",
")",
")",
";",
"if",
"... | Establish a new master tempo, and if it is a change from the existing one, report it to the listeners.
@param newTempo the newly reported master tempo. | [
"Establish",
"a",
"new",
"master",
"tempo",
"and",
"if",
"it",
"is",
"a",
"change",
"from",
"the",
"existing",
"one",
"report",
"it",
"to",
"the",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L319-L329 |
163,959 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.processUpdate | private void processUpdate(DeviceUpdate update) {
updates.put(update.getAddress(), update);
// Keep track of the largest sync number we see.
if (update instanceof CdjStatus) {
int syncNumber = ((CdjStatus)update).getSyncNumber();
if (syncNumber > this.largestSyncCounter.... | java | private void processUpdate(DeviceUpdate update) {
updates.put(update.getAddress(), update);
// Keep track of the largest sync number we see.
if (update instanceof CdjStatus) {
int syncNumber = ((CdjStatus)update).getSyncNumber();
if (syncNumber > this.largestSyncCounter.... | [
"private",
"void",
"processUpdate",
"(",
"DeviceUpdate",
"update",
")",
"{",
"updates",
".",
"put",
"(",
"update",
".",
"getAddress",
"(",
")",
",",
"update",
")",
";",
"// Keep track of the largest sync number we see.",
"if",
"(",
"update",
"instanceof",
"CdjStat... | Process a device update once it has been received. Track it as the most recent update from its address,
and notify any registered listeners, including master listeners if it results in changes to tracked state,
such as the current master player and tempo. Also handles the Baroque dance of handing off the tempo master
r... | [
"Process",
"a",
"device",
"update",
"once",
"it",
"has",
"been",
"received",
".",
"Track",
"it",
"as",
"the",
"most",
"recent",
"update",
"from",
"its",
"address",
"and",
"notify",
"any",
"registered",
"listeners",
"including",
"master",
"listeners",
"if",
"... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L394-L456 |
163,960 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.processBeat | void processBeat(Beat beat) {
if (isRunning() && beat.isTempoMaster()) {
setMasterTempo(beat.getEffectiveTempo());
deliverBeatAnnouncement(beat);
}
} | java | void processBeat(Beat beat) {
if (isRunning() && beat.isTempoMaster()) {
setMasterTempo(beat.getEffectiveTempo());
deliverBeatAnnouncement(beat);
}
} | [
"void",
"processBeat",
"(",
"Beat",
"beat",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
"&&",
"beat",
".",
"isTempoMaster",
"(",
")",
")",
"{",
"setMasterTempo",
"(",
"beat",
".",
"getEffectiveTempo",
"(",
")",
")",
";",
"deliverBeatAnnouncement",
"(",
"... | Process a beat packet, potentially updating the master tempo and sending our listeners a master
beat notification. Does nothing if we are not active. | [
"Process",
"a",
"beat",
"packet",
"potentially",
"updating",
"the",
"master",
"tempo",
"and",
"sending",
"our",
"listeners",
"a",
"master",
"beat",
"notification",
".",
"Does",
"nothing",
"if",
"we",
"are",
"not",
"active",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L462-L467 |
163,961 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.findMatchingAddress | private InterfaceAddress findMatchingAddress(DeviceAnnouncement aDevice, NetworkInterface networkInterface) {
for (InterfaceAddress address : networkInterface.getInterfaceAddresses()) {
if ((address.getBroadcast() != null) &&
Util.sameNetwork(address.getNetworkPrefixLength(), aDe... | java | private InterfaceAddress findMatchingAddress(DeviceAnnouncement aDevice, NetworkInterface networkInterface) {
for (InterfaceAddress address : networkInterface.getInterfaceAddresses()) {
if ((address.getBroadcast() != null) &&
Util.sameNetwork(address.getNetworkPrefixLength(), aDe... | [
"private",
"InterfaceAddress",
"findMatchingAddress",
"(",
"DeviceAnnouncement",
"aDevice",
",",
"NetworkInterface",
"networkInterface",
")",
"{",
"for",
"(",
"InterfaceAddress",
"address",
":",
"networkInterface",
".",
"getInterfaceAddresses",
"(",
")",
")",
"{",
"if",... | Scan a network interface to find if it has an address space which matches the device we are trying to reach.
If so, return the address specification.
@param aDevice the DJ Link device we are trying to communicate with
@param networkInterface the network interface we are testing
@return the address which can be used to... | [
"Scan",
"a",
"network",
"interface",
"to",
"find",
"if",
"it",
"has",
"an",
"address",
"space",
"which",
"matches",
"the",
"device",
"we",
"are",
"trying",
"to",
"reach",
".",
"If",
"so",
"return",
"the",
"address",
"specification",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L477-L485 |
163,962 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.findUnreachablePlayers | public Set<DeviceAnnouncement> findUnreachablePlayers() {
ensureRunning();
Set<DeviceAnnouncement> result = new HashSet<DeviceAnnouncement>();
for (DeviceAnnouncement candidate: DeviceFinder.getInstance().getCurrentDevices()) {
if (!Util.sameNetwork(matchedAddress.getNetworkPrefixLen... | java | public Set<DeviceAnnouncement> findUnreachablePlayers() {
ensureRunning();
Set<DeviceAnnouncement> result = new HashSet<DeviceAnnouncement>();
for (DeviceAnnouncement candidate: DeviceFinder.getInstance().getCurrentDevices()) {
if (!Util.sameNetwork(matchedAddress.getNetworkPrefixLen... | [
"public",
"Set",
"<",
"DeviceAnnouncement",
">",
"findUnreachablePlayers",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"Set",
"<",
"DeviceAnnouncement",
">",
"result",
"=",
"new",
"HashSet",
"<",
"DeviceAnnouncement",
">",
"(",
")",
";",
"for",
"(",
"Devi... | Checks if we can see any players that are on a different network than the one we chose for the Virtual CDJ.
If so, we are not going to be able to communicate with them, and they should all be moved onto a single
network.
@return the device announcements of any players which are on unreachable networks, or hopefully an... | [
"Checks",
"if",
"we",
"can",
"see",
"any",
"players",
"that",
"are",
"on",
"a",
"different",
"network",
"than",
"the",
"one",
"we",
"chose",
"for",
"the",
"Virtual",
"CDJ",
".",
"If",
"so",
"we",
"are",
"not",
"going",
"to",
"be",
"able",
"to",
"comm... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L672-L681 |
163,963 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.stop | public synchronized void stop() {
if (isRunning()) {
try {
setSendingStatus(false);
} catch (Throwable t) {
logger.error("Problem stopping sending status during shutdown", t);
}
DeviceFinder.getInstance().removeIgnoredAddress(socket... | java | public synchronized void stop() {
if (isRunning()) {
try {
setSendingStatus(false);
} catch (Throwable t) {
logger.error("Problem stopping sending status during shutdown", t);
}
DeviceFinder.getInstance().removeIgnoredAddress(socket... | [
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"try",
"{",
"setSendingStatus",
"(",
"false",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"logger",
".",
"error",
"(",
"\"Problem stopping... | Stop announcing ourselves and listening for status updates. | [
"Stop",
"announcing",
"ourselves",
"and",
"listening",
"for",
"status",
"updates",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L739-L755 |
163,964 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.sendAnnouncement | private void sendAnnouncement(InetAddress broadcastAddress) {
try {
DatagramPacket announcement = new DatagramPacket(announcementBytes, announcementBytes.length,
broadcastAddress, DeviceFinder.ANNOUNCEMENT_PORT);
socket.get().send(announcement);
Thread.sle... | java | private void sendAnnouncement(InetAddress broadcastAddress) {
try {
DatagramPacket announcement = new DatagramPacket(announcementBytes, announcementBytes.length,
broadcastAddress, DeviceFinder.ANNOUNCEMENT_PORT);
socket.get().send(announcement);
Thread.sle... | [
"private",
"void",
"sendAnnouncement",
"(",
"InetAddress",
"broadcastAddress",
")",
"{",
"try",
"{",
"DatagramPacket",
"announcement",
"=",
"new",
"DatagramPacket",
"(",
"announcementBytes",
",",
"announcementBytes",
".",
"length",
",",
"broadcastAddress",
",",
"Devic... | Send an announcement packet so the other devices see us as being part of the DJ Link network and send us
updates. | [
"Send",
"an",
"announcement",
"packet",
"so",
"the",
"other",
"devices",
"see",
"us",
"as",
"being",
"part",
"of",
"the",
"DJ",
"Link",
"network",
"and",
"send",
"us",
"updates",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L761-L771 |
163,965 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.deliverMasterChangedAnnouncement | private void deliverMasterChangedAnnouncement(final DeviceUpdate update) {
for (final MasterListener listener : getMasterListeners()) {
try {
listener.masterChanged(update);
} catch (Throwable t) {
logger.warn("Problem delivering master changed announcemen... | java | private void deliverMasterChangedAnnouncement(final DeviceUpdate update) {
for (final MasterListener listener : getMasterListeners()) {
try {
listener.masterChanged(update);
} catch (Throwable t) {
logger.warn("Problem delivering master changed announcemen... | [
"private",
"void",
"deliverMasterChangedAnnouncement",
"(",
"final",
"DeviceUpdate",
"update",
")",
"{",
"for",
"(",
"final",
"MasterListener",
"listener",
":",
"getMasterListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"masterChanged",
"(",
"update",
... | Send a master changed announcement to all registered master listeners.
@param update the message announcing the new tempo master | [
"Send",
"a",
"master",
"changed",
"announcement",
"to",
"all",
"registered",
"master",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L909-L917 |
163,966 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.deliverTempoChangedAnnouncement | private void deliverTempoChangedAnnouncement(final double tempo) {
for (final MasterListener listener : getMasterListeners()) {
try {
listener.tempoChanged(tempo);
} catch (Throwable t) {
logger.warn("Problem delivering tempo changed announcement to listen... | java | private void deliverTempoChangedAnnouncement(final double tempo) {
for (final MasterListener listener : getMasterListeners()) {
try {
listener.tempoChanged(tempo);
} catch (Throwable t) {
logger.warn("Problem delivering tempo changed announcement to listen... | [
"private",
"void",
"deliverTempoChangedAnnouncement",
"(",
"final",
"double",
"tempo",
")",
"{",
"for",
"(",
"final",
"MasterListener",
"listener",
":",
"getMasterListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"tempoChanged",
"(",
"tempo",
")",
"... | Send a tempo changed announcement to all registered master listeners.
@param tempo the new master tempo | [
"Send",
"a",
"tempo",
"changed",
"announcement",
"to",
"all",
"registered",
"master",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L924-L932 |
163,967 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.deliverBeatAnnouncement | private void deliverBeatAnnouncement(final Beat beat) {
for (final MasterListener listener : getMasterListeners()) {
try {
listener.newBeat(beat);
} catch (Throwable t) {
logger.warn("Problem delivering master beat announcement to listener", t);
... | java | private void deliverBeatAnnouncement(final Beat beat) {
for (final MasterListener listener : getMasterListeners()) {
try {
listener.newBeat(beat);
} catch (Throwable t) {
logger.warn("Problem delivering master beat announcement to listener", t);
... | [
"private",
"void",
"deliverBeatAnnouncement",
"(",
"final",
"Beat",
"beat",
")",
"{",
"for",
"(",
"final",
"MasterListener",
"listener",
":",
"getMasterListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"newBeat",
"(",
"beat",
")",
";",
"}",
"cat... | Send a beat announcement to all registered master listeners.
@param beat the beat sent by the tempo master | [
"Send",
"a",
"beat",
"announcement",
"to",
"all",
"registered",
"master",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L939-L947 |
163,968 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.deliverDeviceUpdate | private void deliverDeviceUpdate(final DeviceUpdate update) {
for (DeviceUpdateListener listener : getUpdateListeners()) {
try {
listener.received(update);
} catch (Throwable t) {
logger.warn("Problem delivering device update to listener", t);
... | java | private void deliverDeviceUpdate(final DeviceUpdate update) {
for (DeviceUpdateListener listener : getUpdateListeners()) {
try {
listener.received(update);
} catch (Throwable t) {
logger.warn("Problem delivering device update to listener", t);
... | [
"private",
"void",
"deliverDeviceUpdate",
"(",
"final",
"DeviceUpdate",
"update",
")",
"{",
"for",
"(",
"DeviceUpdateListener",
"listener",
":",
"getUpdateListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"received",
"(",
"update",
")",
";",
"}",
... | Send a device update to all registered update listeners.
@param update the device update that has just arrived | [
"Send",
"a",
"device",
"update",
"to",
"all",
"registered",
"update",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1006-L1014 |
163,969 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.deliverMediaDetailsUpdate | private void deliverMediaDetailsUpdate(final MediaDetails details) {
for (MediaDetailsListener listener : getMediaDetailsListeners()) {
try {
listener.detailsAvailable(details);
} catch (Throwable t) {
logger.warn("Problem delivering media details response... | java | private void deliverMediaDetailsUpdate(final MediaDetails details) {
for (MediaDetailsListener listener : getMediaDetailsListeners()) {
try {
listener.detailsAvailable(details);
} catch (Throwable t) {
logger.warn("Problem delivering media details response... | [
"private",
"void",
"deliverMediaDetailsUpdate",
"(",
"final",
"MediaDetails",
"details",
")",
"{",
"for",
"(",
"MediaDetailsListener",
"listener",
":",
"getMediaDetailsListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"detailsAvailable",
"(",
"details",
... | Send a media details response to all registered listeners.
@param details the response that has just arrived | [
"Send",
"a",
"media",
"details",
"response",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1072-L1080 |
163,970 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.assembleAndSendPacket | @SuppressWarnings("SameParameterValue")
private void assembleAndSendPacket(Util.PacketType kind, byte[] payload, InetAddress destination, int port) throws IOException {
DatagramPacket packet = Util.buildPacket(kind,
ByteBuffer.wrap(announcementBytes, DEVICE_NAME_OFFSET, DEVICE_NAME_LENGTH).a... | java | @SuppressWarnings("SameParameterValue")
private void assembleAndSendPacket(Util.PacketType kind, byte[] payload, InetAddress destination, int port) throws IOException {
DatagramPacket packet = Util.buildPacket(kind,
ByteBuffer.wrap(announcementBytes, DEVICE_NAME_OFFSET, DEVICE_NAME_LENGTH).a... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"void",
"assembleAndSendPacket",
"(",
"Util",
".",
"PacketType",
"kind",
",",
"byte",
"[",
"]",
"payload",
",",
"InetAddress",
"destination",
",",
"int",
"port",
")",
"throws",
"IOException",
... | Finish the work of building and sending a protocol packet.
@param kind the type of packet to create and send
@param payload the content which will follow our device name in the packet
@param destination where the packet should be sent
@param port the port to which the packet should be sent
@throws IOException if ther... | [
"Finish",
"the",
"work",
"of",
"building",
"and",
"sending",
"a",
"protocol",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1092-L1100 |
163,971 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.sendSyncControlCommand | private void sendSyncControlCommand(DeviceUpdate target, byte command) throws IOException {
ensureRunning();
byte[] payload = new byte[SYNC_CONTROL_PAYLOAD.length];
System.arraycopy(SYNC_CONTROL_PAYLOAD, 0, payload, 0, SYNC_CONTROL_PAYLOAD.length);
payload[2] = getDeviceNumber();
... | java | private void sendSyncControlCommand(DeviceUpdate target, byte command) throws IOException {
ensureRunning();
byte[] payload = new byte[SYNC_CONTROL_PAYLOAD.length];
System.arraycopy(SYNC_CONTROL_PAYLOAD, 0, payload, 0, SYNC_CONTROL_PAYLOAD.length);
payload[2] = getDeviceNumber();
... | [
"private",
"void",
"sendSyncControlCommand",
"(",
"DeviceUpdate",
"target",
",",
"byte",
"command",
")",
"throws",
"IOException",
"{",
"ensureRunning",
"(",
")",
";",
"byte",
"[",
"]",
"payload",
"=",
"new",
"byte",
"[",
"SYNC_CONTROL_PAYLOAD",
".",
"length",
... | Assemble and send a packet that performs sync control, turning a device's sync mode on or off, or telling it
to become the tempo master.
@param target an update from the device whose sync state is to be set
@param command the byte identifying the specific sync command to be sent
@throws IOException if there is a prob... | [
"Assemble",
"and",
"send",
"a",
"packet",
"that",
"performs",
"sync",
"control",
"turning",
"a",
"device",
"s",
"sync",
"mode",
"on",
"or",
"off",
"or",
"telling",
"it",
"to",
"become",
"the",
"tempo",
"master",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1146-L1154 |
163,972 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.sendSyncModeCommand | public void sendSyncModeCommand(int deviceNumber, boolean synced) throws IOException {
final DeviceUpdate update = getLatestStatusFor(deviceNumber);
if (update == null) {
throw new IllegalArgumentException("Device " + deviceNumber + " not found on network.");
}
sendSyncModeCo... | java | public void sendSyncModeCommand(int deviceNumber, boolean synced) throws IOException {
final DeviceUpdate update = getLatestStatusFor(deviceNumber);
if (update == null) {
throw new IllegalArgumentException("Device " + deviceNumber + " not found on network.");
}
sendSyncModeCo... | [
"public",
"void",
"sendSyncModeCommand",
"(",
"int",
"deviceNumber",
",",
"boolean",
"synced",
")",
"throws",
"IOException",
"{",
"final",
"DeviceUpdate",
"update",
"=",
"getLatestStatusFor",
"(",
"deviceNumber",
")",
";",
"if",
"(",
"update",
"==",
"null",
")",... | Tell a device to turn sync on or off.
@param deviceNumber the device whose sync state is to be set
@param synced {@code} true if sync should be turned on, else it will be turned off
@throws IOException if there is a problem sending the command to the device
@throws IllegalStateException if the {@code VirtualCdj} is n... | [
"Tell",
"a",
"device",
"to",
"turn",
"sync",
"on",
"or",
"off",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1166-L1172 |
163,973 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.appointTempoMaster | public void appointTempoMaster(int deviceNumber) throws IOException {
final DeviceUpdate update = getLatestStatusFor(deviceNumber);
if (update == null) {
throw new IllegalArgumentException("Device " + deviceNumber + " not found on network.");
}
appointTempoMaster(update);
... | java | public void appointTempoMaster(int deviceNumber) throws IOException {
final DeviceUpdate update = getLatestStatusFor(deviceNumber);
if (update == null) {
throw new IllegalArgumentException("Device " + deviceNumber + " not found on network.");
}
appointTempoMaster(update);
... | [
"public",
"void",
"appointTempoMaster",
"(",
"int",
"deviceNumber",
")",
"throws",
"IOException",
"{",
"final",
"DeviceUpdate",
"update",
"=",
"getLatestStatusFor",
"(",
"deviceNumber",
")",
";",
"if",
"(",
"update",
"==",
"null",
")",
"{",
"throw",
"new",
"Il... | Tell a device to become tempo master.
@param deviceNumber the device we want to take over the role of tempo master
@throws IOException if there is a problem sending the command to the device
@throws IllegalStateException if the {@code VirtualCdj} is not active
@throws IllegalArgumentException if {@code deviceNumber} ... | [
"Tell",
"a",
"device",
"to",
"become",
"tempo",
"master",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1197-L1203 |
163,974 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.sendFaderStartCommand | public void sendFaderStartCommand(Set<Integer> deviceNumbersToStart, Set<Integer> deviceNumbersToStop) throws IOException {
ensureRunning();
byte[] payload = new byte[FADER_START_PAYLOAD.length];
System.arraycopy(FADER_START_PAYLOAD, 0, payload, 0, FADER_START_PAYLOAD.length);
payload[2]... | java | public void sendFaderStartCommand(Set<Integer> deviceNumbersToStart, Set<Integer> deviceNumbersToStop) throws IOException {
ensureRunning();
byte[] payload = new byte[FADER_START_PAYLOAD.length];
System.arraycopy(FADER_START_PAYLOAD, 0, payload, 0, FADER_START_PAYLOAD.length);
payload[2]... | [
"public",
"void",
"sendFaderStartCommand",
"(",
"Set",
"<",
"Integer",
">",
"deviceNumbersToStart",
",",
"Set",
"<",
"Integer",
">",
"deviceNumbersToStop",
")",
"throws",
"IOException",
"{",
"ensureRunning",
"(",
")",
";",
"byte",
"[",
"]",
"payload",
"=",
"ne... | Broadcast a packet that tells some players to start playing and others to stop. If a player number is in
both sets, it will be told to stop. Numbers outside the range 1 to 4 are ignored.
@param deviceNumbersToStart the players that should start playing if they aren't already
@param deviceNumbersToStop the players that... | [
"Broadcast",
"a",
"packet",
"that",
"tells",
"some",
"players",
"to",
"start",
"playing",
"and",
"others",
"to",
"stop",
".",
"If",
"a",
"player",
"number",
"is",
"in",
"both",
"sets",
"it",
"will",
"be",
"told",
"to",
"stop",
".",
"Numbers",
"outside",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1234-L1250 |
163,975 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.sendLoadTrackCommand | public void sendLoadTrackCommand(int targetPlayer, int rekordboxId,
int sourcePlayer, CdjStatus.TrackSourceSlot sourceSlot, CdjStatus.TrackType sourceType)
throws IOException {
final DeviceUpdate update = getLatestStatusFor(targetPlayer);
if (update == nu... | java | public void sendLoadTrackCommand(int targetPlayer, int rekordboxId,
int sourcePlayer, CdjStatus.TrackSourceSlot sourceSlot, CdjStatus.TrackType sourceType)
throws IOException {
final DeviceUpdate update = getLatestStatusFor(targetPlayer);
if (update == nu... | [
"public",
"void",
"sendLoadTrackCommand",
"(",
"int",
"targetPlayer",
",",
"int",
"rekordboxId",
",",
"int",
"sourcePlayer",
",",
"CdjStatus",
".",
"TrackSourceSlot",
"sourceSlot",
",",
"CdjStatus",
".",
"TrackType",
"sourceType",
")",
"throws",
"IOException",
"{",
... | Send a packet to the target player telling it to load the specified track from the specified source player.
@param targetPlayer the device number of the player that you want to have load a track
@param rekordboxId the identifier of a track within the source player's rekordbox database
@param sourcePlayer the device nu... | [
"Send",
"a",
"packet",
"to",
"the",
"target",
"player",
"telling",
"it",
"to",
"load",
"the",
"specified",
"track",
"from",
"the",
"specified",
"source",
"player",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1306-L1314 |
163,976 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.sendLoadTrackCommand | public void sendLoadTrackCommand(DeviceUpdate target, int rekordboxId,
int sourcePlayer, CdjStatus.TrackSourceSlot sourceSlot, CdjStatus.TrackType sourceType)
throws IOException {
ensureRunning();
byte[] payload = new byte[LOAD_TRACK_PAYLOAD.length];
... | java | public void sendLoadTrackCommand(DeviceUpdate target, int rekordboxId,
int sourcePlayer, CdjStatus.TrackSourceSlot sourceSlot, CdjStatus.TrackType sourceType)
throws IOException {
ensureRunning();
byte[] payload = new byte[LOAD_TRACK_PAYLOAD.length];
... | [
"public",
"void",
"sendLoadTrackCommand",
"(",
"DeviceUpdate",
"target",
",",
"int",
"rekordboxId",
",",
"int",
"sourcePlayer",
",",
"CdjStatus",
".",
"TrackSourceSlot",
"sourceSlot",
",",
"CdjStatus",
".",
"TrackType",
"sourceType",
")",
"throws",
"IOException",
"{... | Send a packet to the target device telling it to load the specified track from the specified source player.
@param target an update from the player that you want to have load a track
@param rekordboxId the identifier of a track within the source player's rekordbox database
@param sourcePlayer the device number of the ... | [
"Send",
"a",
"packet",
"to",
"the",
"target",
"device",
"telling",
"it",
"to",
"load",
"the",
"specified",
"track",
"from",
"the",
"specified",
"source",
"player",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1328-L1341 |
163,977 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.setSendingStatus | public synchronized void setSendingStatus(boolean send) throws IOException {
if (isSendingStatus() == send) {
return;
}
if (send) { // Start sending status packets.
ensureRunning();
if ((getDeviceNumber() < 1) || (getDeviceNumber() > 4)) {
th... | java | public synchronized void setSendingStatus(boolean send) throws IOException {
if (isSendingStatus() == send) {
return;
}
if (send) { // Start sending status packets.
ensureRunning();
if ((getDeviceNumber() < 1) || (getDeviceNumber() > 4)) {
th... | [
"public",
"synchronized",
"void",
"setSendingStatus",
"(",
"boolean",
"send",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isSendingStatus",
"(",
")",
"==",
"send",
")",
"{",
"return",
";",
"}",
"if",
"(",
"send",
")",
"{",
"// Start sending status packets."... | Control whether the Virtual CDJ sends status packets to the other players. Most uses of Beat Link will not
require this level of activity. However, if you want to be able to take over the tempo master role, and control
the tempo and beat alignment of other players, you will need to turn on this feature, which also requ... | [
"Control",
"whether",
"the",
"Virtual",
"CDJ",
"sends",
"status",
"packets",
"to",
"the",
"other",
"players",
".",
"Most",
"uses",
"of",
"Beat",
"Link",
"will",
"not",
"require",
"this",
"level",
"of",
"activity",
".",
"However",
"if",
"you",
"want",
"to",... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1494-L1546 |
163,978 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.setPlaying | public void setPlaying(boolean playing) {
if (this.playing.get() == playing) {
return;
}
this.playing.set(playing);
if (playing) {
metronome.jumpToBeat(whereStopped.get().getBeat());
if (isSendingStatus()) { // Need to also start the beat sender.
... | java | public void setPlaying(boolean playing) {
if (this.playing.get() == playing) {
return;
}
this.playing.set(playing);
if (playing) {
metronome.jumpToBeat(whereStopped.get().getBeat());
if (isSendingStatus()) { // Need to also start the beat sender.
... | [
"public",
"void",
"setPlaying",
"(",
"boolean",
"playing",
")",
"{",
"if",
"(",
"this",
".",
"playing",
".",
"get",
"(",
")",
"==",
"playing",
")",
"{",
"return",
";",
"}",
"this",
".",
"playing",
".",
"set",
"(",
"playing",
")",
";",
"if",
"(",
... | Controls whether we report that we are playing. This will only have an impact when we are sending status and
beat packets.
@param playing {@code true} if we should seem to be playing | [
"Controls",
"whether",
"we",
"report",
"that",
"we",
"are",
"playing",
".",
"This",
"will",
"only",
"have",
"an",
"impact",
"when",
"we",
"are",
"sending",
"status",
"and",
"beat",
"packets",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1582-L1603 |
163,979 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.becomeTempoMaster | public synchronized void becomeTempoMaster() throws IOException {
logger.debug("Trying to become master.");
if (!isSendingStatus()) {
throw new IllegalStateException("Must be sending status updates to become the tempo master.");
}
// Is there someone we need to ask to yield ... | java | public synchronized void becomeTempoMaster() throws IOException {
logger.debug("Trying to become master.");
if (!isSendingStatus()) {
throw new IllegalStateException("Must be sending status updates to become the tempo master.");
}
// Is there someone we need to ask to yield ... | [
"public",
"synchronized",
"void",
"becomeTempoMaster",
"(",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Trying to become master.\"",
")",
";",
"if",
"(",
"!",
"isSendingStatus",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
... | Arrange to become the tempo master. Starts a sequence of interactions with the other players that should end
up with us in charge of the group tempo and beat alignment.
@throws IllegalStateException if we are not sending status updates
@throws IOException if there is a problem sending the master yield request | [
"Arrange",
"to",
"become",
"the",
"tempo",
"master",
".",
"Starts",
"a",
"sequence",
"of",
"interactions",
"with",
"the",
"other",
"players",
"that",
"should",
"end",
"up",
"with",
"us",
"in",
"charge",
"of",
"the",
"group",
"tempo",
"and",
"beat",
"alignm... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1670-L1695 |
163,980 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.setSynced | public synchronized void setSynced(boolean sync) {
if (synced.get() != sync) {
// We are changing sync state, so add or remove our master listener as appropriate.
if (sync && isSendingStatus()) {
addMasterListener(ourSyncMasterListener);
} else {
... | java | public synchronized void setSynced(boolean sync) {
if (synced.get() != sync) {
// We are changing sync state, so add or remove our master listener as appropriate.
if (sync && isSendingStatus()) {
addMasterListener(ourSyncMasterListener);
} else {
... | [
"public",
"synchronized",
"void",
"setSynced",
"(",
"boolean",
"sync",
")",
"{",
"if",
"(",
"synced",
".",
"get",
"(",
")",
"!=",
"sync",
")",
"{",
"// We are changing sync state, so add or remove our master listener as appropriate.",
"if",
"(",
"sync",
"&&",
"isSen... | Controls whether we are currently staying in sync with the tempo master. Will only be meaningful if we are
sending status packets.
@param sync if {@code true}, our status packets will be tempo and beat aligned with the tempo master | [
"Controls",
"whether",
"we",
"are",
"currently",
"staying",
"in",
"sync",
"with",
"the",
"tempo",
"master",
".",
"Will",
"only",
"be",
"meaningful",
"if",
"we",
"are",
"sending",
"status",
"packets",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1742-L1757 |
163,981 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.jumpToBeat | public synchronized void jumpToBeat(int beat) {
if (beat < 1) {
beat = 1;
} else {
beat = wrapBeat(beat);
}
if (playing.get()) {
metronome.jumpToBeat(beat);
} else {
whereStopped.set(metronome.getSnapshot(metronome.getTimeOfBeat(b... | java | public synchronized void jumpToBeat(int beat) {
if (beat < 1) {
beat = 1;
} else {
beat = wrapBeat(beat);
}
if (playing.get()) {
metronome.jumpToBeat(beat);
} else {
whereStopped.set(metronome.getSnapshot(metronome.getTimeOfBeat(b... | [
"public",
"synchronized",
"void",
"jumpToBeat",
"(",
"int",
"beat",
")",
"{",
"if",
"(",
"beat",
"<",
"1",
")",
"{",
"beat",
"=",
"1",
";",
"}",
"else",
"{",
"beat",
"=",
"wrapBeat",
"(",
"beat",
")",
";",
"}",
"if",
"(",
"playing",
".",
"get",
... | Moves our current playback position to the specified beat; this will be reflected in any status and beat packets
that we are sending. An incoming value less than one will jump us to the first beat.
@param beat the beat that we should pretend to be playing | [
"Moves",
"our",
"current",
"playback",
"position",
"to",
"the",
"specified",
"beat",
";",
"this",
"will",
"be",
"reflected",
"in",
"any",
"status",
"and",
"beat",
"packets",
"that",
"we",
"are",
"sending",
".",
"An",
"incoming",
"value",
"less",
"than",
"o... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L1852-L1865 |
163,982 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.getPlaybackState | public Set<PlaybackState> getPlaybackState() {
Set<PlaybackState> result = new HashSet<PlaybackState>(playbackStateMap.values());
return Collections.unmodifiableSet(result);
} | java | public Set<PlaybackState> getPlaybackState() {
Set<PlaybackState> result = new HashSet<PlaybackState>(playbackStateMap.values());
return Collections.unmodifiableSet(result);
} | [
"public",
"Set",
"<",
"PlaybackState",
">",
"getPlaybackState",
"(",
")",
"{",
"Set",
"<",
"PlaybackState",
">",
"result",
"=",
"new",
"HashSet",
"<",
"PlaybackState",
">",
"(",
"playbackStateMap",
".",
"values",
"(",
")",
")",
";",
"return",
"Collections",
... | Look up all recorded playback state information.
@return the playback state recorded for any player
@since 0.5.0 | [
"Look",
"up",
"all",
"recorded",
"playback",
"state",
"information",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L260-L263 |
163,983 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.setPlaybackPosition | private void setPlaybackPosition(long milliseconds) {
PlaybackState oldState = currentSimpleState();
if (oldState != null && oldState.position != milliseconds) {
setPlaybackState(oldState.player, milliseconds, oldState.playing);
}
} | java | private void setPlaybackPosition(long milliseconds) {
PlaybackState oldState = currentSimpleState();
if (oldState != null && oldState.position != milliseconds) {
setPlaybackState(oldState.player, milliseconds, oldState.playing);
}
} | [
"private",
"void",
"setPlaybackPosition",
"(",
"long",
"milliseconds",
")",
"{",
"PlaybackState",
"oldState",
"=",
"currentSimpleState",
"(",
")",
";",
"if",
"(",
"oldState",
"!=",
"null",
"&&",
"oldState",
".",
"position",
"!=",
"milliseconds",
")",
"{",
"set... | Set the current playback position. This method can only be used in situations where the component is
tied to a single player, and therefore always has a single playback position.
Will cause part of the component to be redrawn if the position has
changed. This will be quickly overruled if a player is being monitored, b... | [
"Set",
"the",
"current",
"playback",
"position",
".",
"This",
"method",
"can",
"only",
"be",
"used",
"in",
"situations",
"where",
"the",
"component",
"is",
"tied",
"to",
"a",
"single",
"player",
"and",
"therefore",
"always",
"has",
"a",
"single",
"playback",... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L289-L294 |
163,984 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.setPlaying | private void setPlaying(boolean playing) {
PlaybackState oldState = currentSimpleState();
if (oldState != null && oldState.playing != playing) {
setPlaybackState(oldState.player, oldState.position, playing);
}
} | java | private void setPlaying(boolean playing) {
PlaybackState oldState = currentSimpleState();
if (oldState != null && oldState.playing != playing) {
setPlaybackState(oldState.player, oldState.position, playing);
}
} | [
"private",
"void",
"setPlaying",
"(",
"boolean",
"playing",
")",
"{",
"PlaybackState",
"oldState",
"=",
"currentSimpleState",
"(",
")",
";",
"if",
"(",
"oldState",
"!=",
"null",
"&&",
"oldState",
".",
"playing",
"!=",
"playing",
")",
"{",
"setPlaybackState",
... | Set whether the player holding the waveform is playing, which changes the indicator color to white from red.
This method can only be used in situations where the component is tied to a single player, and therefore has
a single playback position.
@param playing if {@code true}, draw the position marker in white, otherw... | [
"Set",
"whether",
"the",
"player",
"holding",
"the",
"waveform",
"is",
"playing",
"which",
"changes",
"the",
"indicator",
"color",
"to",
"white",
"from",
"red",
".",
"This",
"method",
"can",
"only",
"be",
"used",
"in",
"situations",
"where",
"the",
"componen... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L326-L331 |
163,985 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.setMonitoredPlayer | public synchronized void setMonitoredPlayer(final int player) {
if (player < 0) {
throw new IllegalArgumentException("player cannot be negative");
}
clearPlaybackState();
monitoredPlayer.set(player);
if (player > 0) { // Start monitoring the specified player
... | java | public synchronized void setMonitoredPlayer(final int player) {
if (player < 0) {
throw new IllegalArgumentException("player cannot be negative");
}
clearPlaybackState();
monitoredPlayer.set(player);
if (player > 0) { // Start monitoring the specified player
... | [
"public",
"synchronized",
"void",
"setMonitoredPlayer",
"(",
"final",
"int",
"player",
")",
"{",
"if",
"(",
"player",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"player cannot be negative\"",
")",
";",
"}",
"clearPlaybackState",
"(",
... | Configures the player whose current track waveforms and status will automatically be reflected. Whenever a new
track is loaded on that player, the waveform and metadata will be updated, and the current playback position and
state of the player will be reflected by the component.
@param player the player number to moni... | [
"Configures",
"the",
"player",
"whose",
"current",
"track",
"waveforms",
"and",
"status",
"will",
"automatically",
"be",
"reflected",
".",
"Whenever",
"a",
"new",
"track",
"is",
"loaded",
"on",
"that",
"player",
"the",
"waveform",
"and",
"metadata",
"will",
"b... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L387-L452 |
163,986 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.getFurthestPlaybackState | public PlaybackState getFurthestPlaybackState() {
PlaybackState result = null;
for (PlaybackState state : playbackStateMap.values()) {
if (result == null || (!result.playing && state.playing) ||
(result.position < state.position) && (state.playing || !result.playing)) {
... | java | public PlaybackState getFurthestPlaybackState() {
PlaybackState result = null;
for (PlaybackState state : playbackStateMap.values()) {
if (result == null || (!result.playing && state.playing) ||
(result.position < state.position) && (state.playing || !result.playing)) {
... | [
"public",
"PlaybackState",
"getFurthestPlaybackState",
"(",
")",
"{",
"PlaybackState",
"result",
"=",
"null",
";",
"for",
"(",
"PlaybackState",
"state",
":",
"playbackStateMap",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"result",
"==",
"null",
"||",
"(",... | Look up the playback state that has reached furthest in the track, but give playing players priority over stopped players.
This is used to choose the scroll center when auto-scrolling is active.
@return the playback state, if any, with the highest playing {@link PlaybackState#position} value | [
"Look",
"up",
"the",
"playback",
"state",
"that",
"has",
"reached",
"furthest",
"in",
"the",
"track",
"but",
"give",
"playing",
"players",
"priority",
"over",
"stopped",
"players",
".",
"This",
"is",
"used",
"to",
"choose",
"the",
"scroll",
"center",
"when",... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L587-L596 |
163,987 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.getSegmentForX | private int getSegmentForX(int x) {
if (autoScroll.get()) {
int playHead = (x - (getWidth() / 2));
int offset = Util.timeToHalfFrame(getFurthestPlaybackPosition()) / scale.get();
return (playHead + offset) * scale.get();
}
return x * scale.get();
} | java | private int getSegmentForX(int x) {
if (autoScroll.get()) {
int playHead = (x - (getWidth() / 2));
int offset = Util.timeToHalfFrame(getFurthestPlaybackPosition()) / scale.get();
return (playHead + offset) * scale.get();
}
return x * scale.get();
} | [
"private",
"int",
"getSegmentForX",
"(",
"int",
"x",
")",
"{",
"if",
"(",
"autoScroll",
".",
"get",
"(",
")",
")",
"{",
"int",
"playHead",
"=",
"(",
"x",
"-",
"(",
"getWidth",
"(",
")",
"/",
"2",
")",
")",
";",
"int",
"offset",
"=",
"Util",
"."... | Figure out the starting waveform segment that corresponds to the specified coordinate in the window.
@param x the column being drawn
@return the offset into the waveform at the current scale and playback time that should be drawn there | [
"Figure",
"out",
"the",
"starting",
"waveform",
"segment",
"that",
"corresponds",
"to",
"the",
"specified",
"coordinate",
"in",
"the",
"window",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L619-L626 |
163,988 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.getXForBeat | public int getXForBeat(int beat) {
BeatGrid grid = beatGrid.get();
if (grid != null) {
return millisecondsToX(grid.getTimeWithinTrack(beat));
}
return 0;
} | java | public int getXForBeat(int beat) {
BeatGrid grid = beatGrid.get();
if (grid != null) {
return millisecondsToX(grid.getTimeWithinTrack(beat));
}
return 0;
} | [
"public",
"int",
"getXForBeat",
"(",
"int",
"beat",
")",
"{",
"BeatGrid",
"grid",
"=",
"beatGrid",
".",
"get",
"(",
")",
";",
"if",
"(",
"grid",
"!=",
"null",
")",
"{",
"return",
"millisecondsToX",
"(",
"grid",
".",
"getTimeWithinTrack",
"(",
"beat",
"... | Determine the X coordinate within the component at which the specified beat begins.
@param beat the beat number whose position is desired
@return the horizontal position within the component coordinate space where that beat begins
@throws IllegalArgumentException if the beat number exceeds the number of beats in the t... | [
"Determine",
"the",
"X",
"coordinate",
"within",
"the",
"component",
"at",
"which",
"the",
"specified",
"beat",
"begins",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L661-L667 |
163,989 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.millisecondsToX | public int millisecondsToX(long milliseconds) {
if (autoScroll.get()) {
int playHead = (getWidth() / 2) + 2;
long offset = milliseconds - getFurthestPlaybackPosition();
return playHead + (Util.timeToHalfFrame(offset) / scale.get());
}
return Util.timeToHalfFra... | java | public int millisecondsToX(long milliseconds) {
if (autoScroll.get()) {
int playHead = (getWidth() / 2) + 2;
long offset = milliseconds - getFurthestPlaybackPosition();
return playHead + (Util.timeToHalfFrame(offset) / scale.get());
}
return Util.timeToHalfFra... | [
"public",
"int",
"millisecondsToX",
"(",
"long",
"milliseconds",
")",
"{",
"if",
"(",
"autoScroll",
".",
"get",
"(",
")",
")",
"{",
"int",
"playHead",
"=",
"(",
"getWidth",
"(",
")",
"/",
"2",
")",
"+",
"2",
";",
"long",
"offset",
"=",
"milliseconds"... | Converts a time in milliseconds to the appropriate x coordinate for drawing something at that time.
@param milliseconds the time at which something should be drawn
@return the component x coordinate at which it should be drawn | [
"Converts",
"a",
"time",
"in",
"milliseconds",
"to",
"the",
"appropriate",
"x",
"coordinate",
"for",
"drawing",
"something",
"at",
"that",
"time",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L676-L683 |
163,990 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.cueColor | public static Color cueColor(CueList.Entry entry) {
if (entry.hotCueNumber > 0) {
return Color.GREEN;
}
if (entry.isLoop) {
return Color.ORANGE;
}
return Color.RED;
} | java | public static Color cueColor(CueList.Entry entry) {
if (entry.hotCueNumber > 0) {
return Color.GREEN;
}
if (entry.isLoop) {
return Color.ORANGE;
}
return Color.RED;
} | [
"public",
"static",
"Color",
"cueColor",
"(",
"CueList",
".",
"Entry",
"entry",
")",
"{",
"if",
"(",
"entry",
".",
"hotCueNumber",
">",
"0",
")",
"{",
"return",
"Color",
".",
"GREEN",
";",
"}",
"if",
"(",
"entry",
".",
"isLoop",
")",
"{",
"return",
... | Determine the color to use to draw a cue list entry. Hot cues are green, ordinary memory points are red,
and loops are orange.
@param entry the entry being drawn
@return the color with which it should be represented. | [
"Determine",
"the",
"color",
"to",
"use",
"to",
"draw",
"a",
"cue",
"list",
"entry",
".",
"Hot",
"cues",
"are",
"green",
"ordinary",
"memory",
"points",
"are",
"red",
"and",
"loops",
"are",
"orange",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L698-L706 |
163,991 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceUpdate.java | DeviceUpdate.getPacketBytes | public byte[] getPacketBytes() {
byte[] result = new byte[packetBytes.length];
System.arraycopy(packetBytes, 0, result, 0, packetBytes.length);
return result;
} | java | public byte[] getPacketBytes() {
byte[] result = new byte[packetBytes.length];
System.arraycopy(packetBytes, 0, result, 0, packetBytes.length);
return result;
} | [
"public",
"byte",
"[",
"]",
"getPacketBytes",
"(",
")",
"{",
"byte",
"[",
"]",
"result",
"=",
"new",
"byte",
"[",
"packetBytes",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"packetBytes",
",",
"0",
",",
"result",
",",
"0",
",",
"packetB... | Get the raw data bytes of the device update packet.
@return the data sent by the device to update its status | [
"Get",
"the",
"raw",
"data",
"bytes",
"of",
"the",
"device",
"update",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceUpdate.java#L100-L104 |
163,992 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.buildPacket | public static DatagramPacket buildPacket(PacketType type, ByteBuffer deviceName, ByteBuffer payload) {
ByteBuffer content = ByteBuffer.allocate(0x1f + payload.remaining());
content.put(getMagicHeader());
content.put(type.protocolValue);
content.put(deviceName);
content.put(payloa... | java | public static DatagramPacket buildPacket(PacketType type, ByteBuffer deviceName, ByteBuffer payload) {
ByteBuffer content = ByteBuffer.allocate(0x1f + payload.remaining());
content.put(getMagicHeader());
content.put(type.protocolValue);
content.put(deviceName);
content.put(payloa... | [
"public",
"static",
"DatagramPacket",
"buildPacket",
"(",
"PacketType",
"type",
",",
"ByteBuffer",
"deviceName",
",",
"ByteBuffer",
"payload",
")",
"{",
"ByteBuffer",
"content",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"0x1f",
"+",
"payload",
".",
"remaining",
"... | Build a standard-format UDP packet for sending to port 50001 or 50002 in the protocol.
@param type the type of packet to create.
@param deviceName the 0x14 (twenty) bytes of the device name to send in the packet.
@param payload the remaining bytes which come after the device name.
@return the packet to send. | [
"Build",
"a",
"standard",
"-",
"format",
"UDP",
"packet",
"for",
"sending",
"to",
"port",
"50001",
"or",
"50002",
"in",
"the",
"protocol",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L176-L183 |
163,993 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.validateHeader | public static PacketType validateHeader(DatagramPacket packet, int port) {
byte[] data = packet.getData();
if (data.length < PACKET_TYPE_OFFSET) {
logger.warn("Packet is too short to be a Pro DJ Link packet; must be at least " + PACKET_TYPE_OFFSET +
" bytes long, was onl... | java | public static PacketType validateHeader(DatagramPacket packet, int port) {
byte[] data = packet.getData();
if (data.length < PACKET_TYPE_OFFSET) {
logger.warn("Packet is too short to be a Pro DJ Link packet; must be at least " + PACKET_TYPE_OFFSET +
" bytes long, was onl... | [
"public",
"static",
"PacketType",
"validateHeader",
"(",
"DatagramPacket",
"packet",
",",
"int",
"port",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"packet",
".",
"getData",
"(",
")",
";",
"if",
"(",
"data",
".",
"length",
"<",
"PACKET_TYPE_OFFSET",
")",
"... | Check to see whether a packet starts with the standard header bytes, followed by a known byte identifying it.
If so, return the kind of packet that has been recognized.
@param packet a packet that has just been received
@param port the port on which the packet has been received
@return the type of packet that was rec... | [
"Check",
"to",
"see",
"whether",
"a",
"packet",
"starts",
"with",
"the",
"standard",
"header",
"bytes",
"followed",
"by",
"a",
"known",
"byte",
"identifying",
"it",
".",
"If",
"so",
"return",
"the",
"kind",
"of",
"packet",
"that",
"has",
"been",
"recognize... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L194-L221 |
163,994 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.bytesToNumber | public static long bytesToNumber(byte[] buffer, int start, int length) {
long result = 0;
for (int index = start; index < start + length; index++) {
result = (result << 8) + unsign(buffer[index]);
}
return result;
} | java | public static long bytesToNumber(byte[] buffer, int start, int length) {
long result = 0;
for (int index = start; index < start + length; index++) {
result = (result << 8) + unsign(buffer[index]);
}
return result;
} | [
"public",
"static",
"long",
"bytesToNumber",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"index",
"=",
"start",
";",
"index",
"<",
"start",
"+",
"length",
... | Reconstructs a number that is represented by more than one byte in a network packet in big-endian order.
@param buffer the byte array containing the packet data
@param start the index of the first byte containing a numeric value
@param length the number of bytes making up the value
@return the reconstructed number | [
"Reconstructs",
"a",
"number",
"that",
"is",
"represented",
"by",
"more",
"than",
"one",
"byte",
"in",
"a",
"network",
"packet",
"in",
"big",
"-",
"endian",
"order",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L242-L248 |
163,995 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.bytesToNumberLittleEndian | @SuppressWarnings("SameParameterValue")
public static long bytesToNumberLittleEndian(byte[] buffer, int start, int length) {
long result = 0;
for (int index = start + length - 1; index >= start; index--) {
result = (result << 8) + unsign(buffer[index]);
}
return result;
... | java | @SuppressWarnings("SameParameterValue")
public static long bytesToNumberLittleEndian(byte[] buffer, int start, int length) {
long result = 0;
for (int index = start + length - 1; index >= start; index--) {
result = (result << 8) + unsign(buffer[index]);
}
return result;
... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"public",
"static",
"long",
"bytesToNumberLittleEndian",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"int",
... | Reconstructs a number that is represented by more than one byte in a network packet in little-endian order, for
the very few protocol values that are sent in this quirky way.
@param buffer the byte array containing the packet data
@param start the index of the first byte containing a numeric value
@param length the nu... | [
"Reconstructs",
"a",
"number",
"that",
"is",
"represented",
"by",
"more",
"than",
"one",
"byte",
"in",
"a",
"network",
"packet",
"in",
"little",
"-",
"endian",
"order",
"for",
"the",
"very",
"few",
"protocol",
"values",
"that",
"are",
"sent",
"in",
"this",... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L259-L266 |
163,996 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.numberToBytes | public static void numberToBytes(int number, byte[] buffer, int start, int length) {
for (int index = start + length - 1; index >= start; index--) {
buffer[index] = (byte)(number & 0xff);
number = number >> 8;
}
} | java | public static void numberToBytes(int number, byte[] buffer, int start, int length) {
for (int index = start + length - 1; index >= start; index--) {
buffer[index] = (byte)(number & 0xff);
number = number >> 8;
}
} | [
"public",
"static",
"void",
"numberToBytes",
"(",
"int",
"number",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"start",
"+",
"length",
"-",
"1",
";",
"index",
">=",
"start",
... | Writes a number to the specified byte array field, breaking it into its component bytes in big-endian order.
If the number is too large to fit in the specified number of bytes, only the low-order bytes are written.
@param number the number to be written to the array
@param buffer the buffer to which the number should ... | [
"Writes",
"a",
"number",
"to",
"the",
"specified",
"byte",
"array",
"field",
"breaking",
"it",
"into",
"its",
"component",
"bytes",
"in",
"big",
"-",
"endian",
"order",
".",
"If",
"the",
"number",
"is",
"too",
"large",
"to",
"fit",
"in",
"the",
"specifie... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L277-L282 |
163,997 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.addressToLong | public static long addressToLong(InetAddress address) {
long result = 0;
for (byte element : address.getAddress()) {
result = (result << 8) + unsign(element);
}
return result;
} | java | public static long addressToLong(InetAddress address) {
long result = 0;
for (byte element : address.getAddress()) {
result = (result << 8) + unsign(element);
}
return result;
} | [
"public",
"static",
"long",
"addressToLong",
"(",
"InetAddress",
"address",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"byte",
"element",
":",
"address",
".",
"getAddress",
"(",
")",
")",
"{",
"result",
"=",
"(",
"result",
"<<",
"8",
")",
... | Converts the bytes that make up an internet address into the corresponding integer value to make
it easier to perform bit-masking operations on them.
@param address an address whose integer equivalent is desired
@return the integer corresponding to that address | [
"Converts",
"the",
"bytes",
"that",
"make",
"up",
"an",
"internet",
"address",
"into",
"the",
"corresponding",
"integer",
"value",
"to",
"make",
"it",
"easier",
"to",
"perform",
"bit",
"-",
"masking",
"operations",
"on",
"them",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L292-L298 |
163,998 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.sameNetwork | public static boolean sameNetwork(int prefixLength, InetAddress address1, InetAddress address2) {
if (logger.isDebugEnabled()) {
logger.debug("Comparing address " + address1.getHostAddress() + " with " + address2.getHostAddress() + ", prefixLength=" + prefixLength);
}
long prefixMask... | java | public static boolean sameNetwork(int prefixLength, InetAddress address1, InetAddress address2) {
if (logger.isDebugEnabled()) {
logger.debug("Comparing address " + address1.getHostAddress() + " with " + address2.getHostAddress() + ", prefixLength=" + prefixLength);
}
long prefixMask... | [
"public",
"static",
"boolean",
"sameNetwork",
"(",
"int",
"prefixLength",
",",
"InetAddress",
"address1",
",",
"InetAddress",
"address2",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Comparing addres... | Checks whether two internet addresses are on the same subnet.
@param prefixLength the number of bits within an address that identify the network
@param address1 the first address to be compared
@param address2 the second address to be compared
@return true if both addresses share the same network bits | [
"Checks",
"whether",
"two",
"internet",
"addresses",
"are",
"on",
"the",
"same",
"subnet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L309-L315 |
163,999 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.writeFully | public static void writeFully(ByteBuffer buffer, WritableByteChannel channel) throws IOException {
while (buffer.hasRemaining()) {
channel.write(buffer);
}
} | java | public static void writeFully(ByteBuffer buffer, WritableByteChannel channel) throws IOException {
while (buffer.hasRemaining()) {
channel.write(buffer);
}
} | [
"public",
"static",
"void",
"writeFully",
"(",
"ByteBuffer",
"buffer",
",",
"WritableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"while",
"(",
"buffer",
".",
"hasRemaining",
"(",
")",
")",
"{",
"channel",
".",
"write",
"(",
"buffer",
")",
";"... | Writes the entire remaining contents of the buffer to the channel. May complete in one operation, but the
documentation is vague, so this keeps going until we are sure.
@param buffer the data to be written
@param channel the channel to which we want to write data
@throws IOException if there is a problem writing to t... | [
"Writes",
"the",
"entire",
"remaining",
"contents",
"of",
"the",
"buffer",
"to",
"the",
"channel",
".",
"May",
"complete",
"in",
"one",
"operation",
"but",
"the",
"documentation",
"is",
"vague",
"so",
"this",
"keeps",
"going",
"until",
"we",
"are",
"sure",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L348-L352 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.