Renamed 'ljud' to 'miniaudio' to better represent what engine it is.
This commit is contained in:
@@ -4,17 +4,17 @@ import "core:container/queue"
|
||||
import "core:log"
|
||||
import "core:math/linalg"
|
||||
|
||||
AUDIO_ENGINE_LJUD :: #config(AUDIO_ENGINE_LJUD, false)
|
||||
AUDIO_ENGINE_FMOD :: #config(AUDIO_ENGINE_FMOD, false)
|
||||
AUDIO_ENGINE_WWISE :: #config(AUDIO_ENGINE_WWISE, false)
|
||||
AUDIO_ENGINE_MINIAUDIO :: #config(AUDIO_ENGINE_MINIAUDIO, false)
|
||||
AUDIO_ENGINE_FMOD :: #config(AUDIO_ENGINE_FMOD, false)
|
||||
AUDIO_ENGINE_WWISE :: #config(AUDIO_ENGINE_WWISE, false)
|
||||
|
||||
import "ljud"
|
||||
import "miniaudio"
|
||||
|
||||
when AUDIO_ENGINE_LJUD {
|
||||
Engine_Backend :: ljud.Engine
|
||||
Sound_Backend :: ljud.Sound
|
||||
Sound_Instance_Backend :: ljud.Sound_Instance
|
||||
Bus_Backend :: ljud.Bus
|
||||
when AUDIO_ENGINE_MINIAUDIO {
|
||||
Engine_Backend :: miniaudio.Engine
|
||||
Sound_Backend :: miniaudio.Sound
|
||||
Sound_Instance_Backend :: miniaudio.Sound_Instance
|
||||
Bus_Backend :: miniaudio.Bus
|
||||
}
|
||||
else when AUDIO_ENGINE_FMOD {
|
||||
|
||||
@@ -34,29 +34,29 @@ init :: proc(engine: ^Engine, max_sound_instances: u32) -> bool {
|
||||
assert(engine != nil)
|
||||
assert(max_sound_instances > 0)
|
||||
|
||||
when AUDIO_ENGINE_LJUD {
|
||||
// engine.§ new(ljud.Engine)
|
||||
when AUDIO_ENGINE_MINIAUDIO {
|
||||
// engine.§ new(miniaudio.Engine)
|
||||
// if engine.data != nil {
|
||||
// v := transmute(^ljud.Engine)(engine.data)
|
||||
// if !ljud.init(v) {
|
||||
// v := transmute(^miniaudio.Engine)(engine.data)
|
||||
// if !miniaudio.init(v) {
|
||||
// free(engine.data)
|
||||
// engine.data = nil
|
||||
|
||||
// log.errorf("Failed to initialize audio-engine LJUD.")
|
||||
// log.errorf("Failed to initialize audio-engine MINIAUDIO.")
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
if !ljud.init(&engine.backend) {
|
||||
if !miniaudio.init(&engine.backend) {
|
||||
// free(engine.data)
|
||||
// engine.data = nil
|
||||
|
||||
log.errorf("Failed to initialize audio-engine LJUD.")
|
||||
log.errorf("Failed to initialize audio-engine MINIAUDIO.")
|
||||
return false
|
||||
}
|
||||
}
|
||||
else {
|
||||
#assert("No audio-engine defined. '-define:AUDIO_ENGINE_X=true' where X is the audio-engine; 'LJUD', 'FMOD', 'WWISE'.")
|
||||
#assert("No audio-engine defined. '-define:AUDIO_ENGINE_X=true' where X is the audio-engine; 'MINIAUDIO', 'FMOD', 'WWISE'.")
|
||||
}
|
||||
|
||||
{ // Initialize sound-instances.
|
||||
@@ -86,8 +86,8 @@ init :: proc(engine: ^Engine, max_sound_instances: u32) -> bool {
|
||||
}
|
||||
|
||||
tick :: proc(engine: ^Engine) {
|
||||
when AUDIO_ENGINE_LJUD {
|
||||
ljud.tick(&engine.backend)
|
||||
when AUDIO_ENGINE_MINIAUDIO {
|
||||
miniaudio.tick(&engine.backend)
|
||||
}
|
||||
else {
|
||||
#assert("TODO: SS - Implement for Audio Engine backend")
|
||||
@@ -100,8 +100,8 @@ tick :: proc(engine: ^Engine) {
|
||||
}
|
||||
|
||||
|
||||
when AUDIO_ENGINE_LJUD {
|
||||
ljud.tick_listener(
|
||||
when AUDIO_ENGINE_MINIAUDIO {
|
||||
miniaudio.tick_listener(
|
||||
&engine.backend,
|
||||
u8(listener.id),
|
||||
listener.enabled,
|
||||
@@ -117,8 +117,8 @@ tick :: proc(engine: ^Engine) {
|
||||
shutdown :: proc(engine: ^Engine) {
|
||||
assert(engine != nil)
|
||||
|
||||
when AUDIO_ENGINE_LJUD {
|
||||
ljud.shutdown(&engine.backend)
|
||||
when AUDIO_ENGINE_MINIAUDIO {
|
||||
miniaudio.shutdown(&engine.backend)
|
||||
}
|
||||
else {
|
||||
#assert("TODO: SS - Implement for Audio Engine backend")
|
||||
|
||||
Reference in New Issue
Block a user