Skip to content

Commit

Permalink
Improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed May 9, 2024
1 parent d7694e3 commit 631a90f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public JavaxSoundSystem(final float playbackSpeed) {
}

@Override
public void playNote(final Instrument instrument, final float volume, final float pitch, float panning) {
public void playNote(final Instrument instrument, final float volume, final float pitch, final float panning) {
final String key = instrument.ordinal() + "\0" + volume + "\0" + pitch + "\0" + panning;
final int[] samples = this.mutationCache.computeIfAbsent(key, k -> SoundSampleUtil.mutate(FORMAT, this.sounds.get(instrument), volume * this.masterVolume, pitch, panning));
if (this.buffer.length < samples.length) this.buffer = Arrays.copyOf(this.buffer, samples.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void close() {
private final ListFrame.LoadedSong song;
private final SongPlayer songPlayer;
private final Timer updateTimer;
private final JComboBox<String> soundSystemComboBox = new JComboBox<>(new String[]{"OpenAL (better sound quality)", "Javax (better system compatibility)"});
private final JComboBox<String> soundSystemComboBox = new JComboBox<>(new String[]{"OpenAL (better sound quality)", "Javax (better system compatibility, laggier)"});
private final JSpinner maxSoundsSpinner = new JSpinner(new SpinnerNumberModel(256, 64, 8192, 64));
private final JSlider volumeSlider = new JSlider(0, 100, 50);
private final JButton playStopButton = new JButton("Play");
Expand Down

0 comments on commit 631a90f

Please sign in to comment.