Skip to content

Commit

Permalink
Fix visibility quirks
Browse files Browse the repository at this point in the history
  • Loading branch information
Hangman committed Apr 24, 2024
1 parent 4931dad commit 51dac4d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

package de.pottgames.tuningfork;

enum ALExtension {
public enum ALExtension {
ALC_ENUMERATE_ALL_EXT("ALC_ENUMERATE_ALL_EXT", true),
ALC_ENUMERATION_EXT("ALC_ENUMERATION_EXT", true),
ALC_EXT_CAPTURE("ALC_EXT_CAPTURE", true),
Expand Down
24 changes: 11 additions & 13 deletions core/src/main/java/de/pottgames/tuningfork/SoundBufferLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@

/**
* This class can be used to load {@link SoundBuffer}s asynchronously. Don't forget to tell your
* {@link com.badlogic.gdx.assets.AssetManager AssetManager} about
* this loader.
* {@link com.badlogic.gdx.assets.AssetManager AssetManager} about this loader.
*
* @author Matthias
*
*/
public class SoundBufferLoader extends AsynchronousAssetLoader<SoundBuffer, SoundBufferLoaderParameter> {
@SuppressWarnings("rawtypes")
private final Array<AssetDescriptor> dependencies = new Array<>();
private volatile SoundBuffer asset;
private final Array<AssetDescriptor> dependencies = new Array<>();
private volatile SoundBuffer asset;


public SoundBufferLoader(FileHandleResolver resolver) {
Expand Down Expand Up @@ -70,6 +68,10 @@ public void loadAsync(
// ignore
}
}
if (type == null) {
throw new TuningForkRuntimeException("Unsupported file '" + fileExtension +
"'. Only ogg, flac, mp3, aiff, wav and qoa files are supported.");
}
switch (type) {
case FLAC:
this.asset = reverse ? FlacLoader.loadReverse(file) : FlacLoader.load(file);
Expand All @@ -89,9 +91,6 @@ public void loadAsync(
case QOA:
this.asset = reverse ? QoaLoader.loadReverse(file) : QoaLoader.load(file);
break;
default:
throw new TuningForkRuntimeException("Unsupported file '" + fileExtension +
"'. Only ogg, flac, mp3, aiff, wav and qoa files are supported.");
}
}

Expand All @@ -112,12 +111,11 @@ public static class SoundBufferLoaderParameter extends AssetLoaderParameters<Sou
public boolean reverse = false;

/**
* A custom FileHandle object that can be set to specify an alternative file path for the asset.<br>
* If this is set, this path takes priority over the file name String given to the load function of the asset
* manager.<br>
* A custom FileHandle object that can be set to specify an alternative file path for the asset.<br> If this is
* set, this path takes priority over the file name String given to the load function of the asset manager.<br>
* You can give the asset manager load method an arbitrary String that is just used to identify the asset, it
* must not point to the real file.<br>
* This is useful when multiple instances of the same asset need to be loaded with different configurations.
* must not point to the real file.<br> This is useful when multiple instances of the same asset need to be
* loaded with different configurations.
*/
public FileHandle file;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected void dispose() {
}


enum TaskAction {
public enum TaskAction {
PLAY, STOP, PAUSE, UPDATE, SET_PLAYBACK_POSITION, STOP_ALL, PAUSE_ALL, RESUME_ALL, DISPOSE_CALLBACK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void setPlaybackPositionAsync(final float seconds) {
// RESTORE SOURCE STATE
if (filledBufferCount > 0 && playing) {
AL10.alSourcePlay(this.sourceId);
} else if (filledBufferCount > 0 && !playing && !stopped) {
} else if (filledBufferCount > 0 && !stopped) {
AL10.alSourcePlay(this.sourceId);
AL10.alSourcePause(this.sourceId);
} else if (playing) {
Expand Down

0 comments on commit 51dac4d

Please sign in to comment.