Skip to content

Commit a918596

Browse files
committed
Optimized flags for performance
1 parent a71dd4f commit a918596

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/main/java/net/raphimc/noteblocktool/audio/soundsystem/XAudio2Library.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public interface XAudio2Library extends Library {
3939
int WAVE_FORMAT_PCM = 1;
4040
int XAUDIO2_END_OF_STREAM = 0x40;
4141
int XAUDIO2_COMMIT_NOW = 0;
42+
int XAUDIO2_VOICE_NOSAMPLESPLAYED = 0x100;
4243

4344
int SPEAKER_FRONT_LEFT = 0x00000001;
4445
int SPEAKER_FRONT_RIGHT = 0x00000002;

src/main/java/net/raphimc/noteblocktool/audio/soundsystem/impl/XAudio2SoundSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public synchronized void playSound(final String sound, final float pitch, final
107107
public synchronized void preTick() {
108108
final XAudio2Library.XAUDIO2_VOICE_STATE.ByReference voiceState = new XAudio2Library.XAUDIO2_VOICE_STATE.ByReference();
109109
this.playingVoices.removeIf(voice -> {
110-
voice.GetState(voiceState, 0);
110+
voice.GetState(voiceState, XAudio2Library.XAUDIO2_VOICE_NOSAMPLESPLAYED);
111111
if (voiceState.BuffersQueued == 0) {
112112
voice.DestroyVoice();
113113
return true;

src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private boolean initSoundSystem() {
280280
this.soundSystem = new JavaxSoundSystem(soundData, maxSounds, this.songPlayer.getSongView().getSpeed());
281281
} else if (this.soundSystemComboBox.getSelectedIndex() == 3) {
282282
this.soundSystem = new MultithreadedJavaxSoundSystem(soundData, maxSounds, this.songPlayer.getSongView().getSpeed());
283-
} else if (this.soundSystemComboBox.getSelectedIndex() == 4) {
283+
} else if (this.soundSystemComboBox.getSelectedIndex() == 4) {
284284
this.soundSystem = new XAudio2SoundSystem(soundData, maxSounds);
285285
} else {
286286
throw new UnsupportedOperationException(UNAVAILABLE_MESSAGE);

0 commit comments

Comments
 (0)