Create basic Audio API
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package com.bartlomiejpluta.base.api.audio;
|
||||
|
||||
import org.joml.Vector3fc;
|
||||
|
||||
public interface Listener {
|
||||
|
||||
void setPosition(Vector3fc position);
|
||||
|
||||
void setSpeed(Vector3fc speed);
|
||||
|
||||
void setOrientation(Vector3fc at, Vector3fc up);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.bartlomiejpluta.base.api.audio;
|
||||
|
||||
import org.joml.Vector3fc;
|
||||
|
||||
public interface Sound {
|
||||
void play();
|
||||
|
||||
void pause();
|
||||
|
||||
void stop();
|
||||
|
||||
boolean isPlaying();
|
||||
|
||||
void setGain(float gain);
|
||||
|
||||
void setRepeat(boolean repeat);
|
||||
|
||||
void setRelative(boolean relative);
|
||||
|
||||
void setPosition(Vector3fc position);
|
||||
|
||||
void setSpeed(Vector3fc speed);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.bartlomiejpluta.base.api.context;
|
||||
|
||||
import com.bartlomiejpluta.base.api.animation.Animation;
|
||||
import com.bartlomiejpluta.base.api.audio.Sound;
|
||||
import com.bartlomiejpluta.base.api.camera.Camera;
|
||||
import com.bartlomiejpluta.base.api.entity.Entity;
|
||||
import com.bartlomiejpluta.base.api.gui.GUI;
|
||||
@@ -35,6 +36,14 @@ public interface Context extends Updatable, Renderable, Disposable {
|
||||
|
||||
GUI newGUI();
|
||||
|
||||
Sound createSound(String soundUid);
|
||||
|
||||
void disposeSound(Sound sound);
|
||||
|
||||
void playSound(String soundUid);
|
||||
|
||||
void playSound(String soundUid, float gain);
|
||||
|
||||
boolean isRunning();
|
||||
|
||||
void close();
|
||||
|
||||
Reference in New Issue
Block a user