Skip to content
This repository has been archived by the owner on Feb 2, 2025. It is now read-only.

Commit

Permalink
Use a lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Feb 2, 2025
1 parent 34dd4bd commit 739639a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/ca/exp/soundboard/soundboard/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ public static void playNewSoundClipThreaded(File file, final SourceDataLine prim
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Utils.ClipPlayer clipPlayer = new Utils.ClipPlayer(file, primarySpeaker, secondarySpeaker);
SwingUtilities.invokeLater(() -> {
ClipPlayer clipPlayer = new ClipPlayer(file, primarySpeaker, secondarySpeaker);

if (!Utils.overlapSameClipWhilePlaying) {
Utils.stopFilePlaying(file);
}

clipPlayer.start();
if (!Utils.overlapSameClipWhilePlaying) {
Utils.stopFilePlaying(file);
}

clipPlayer.start();
});
}

Expand Down

0 comments on commit 739639a

Please sign in to comment.