mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 12:25:12 -04:00
rename log level: AUDIO_LOADING
-> AUDIO
* breaks config files
This commit is contained in:
parent
e3ce5a6c68
commit
e7b1d36171
@ -66,15 +66,15 @@ class AudioPlayer(
|
|||||||
|
|
||||||
|
|
||||||
fun init(latch: CountUpAndDownLatch) {
|
fun init(latch: CountUpAndDownLatch) {
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "Loading OpenAL..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.INFO) { "Loading OpenAL..." }
|
||||||
|
|
||||||
soundManager.load()
|
soundManager.load()
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Preloading sounds..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Preloading sounds..." }
|
||||||
soundManager.preload()
|
soundManager.preload()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Initializing OpenAL..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Initializing OpenAL..." }
|
||||||
device = alcOpenDevice(null as ByteBuffer?)
|
device = alcOpenDevice(null as ByteBuffer?)
|
||||||
check(device != MemoryUtil.NULL) { "Failed to open the default device." }
|
check(device != MemoryUtil.NULL) { "Failed to open the default device." }
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ class AudioPlayer(
|
|||||||
|
|
||||||
DefaultAudioBehavior.register(connection)
|
DefaultAudioBehavior.register(connection)
|
||||||
|
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "OpenAL loaded!" }
|
Log.log(LogMessageType.AUDIO, LogLevels.INFO) { "OpenAL loaded!" }
|
||||||
|
|
||||||
profile::enabled.profileWatch(this, false, profile) {
|
profile::enabled.profileWatch(this, false, profile) {
|
||||||
if (it) {
|
if (it) {
|
||||||
@ -188,7 +188,7 @@ class AudioPlayer(
|
|||||||
sound.load(connection.assetsManager)
|
sound.load(connection.assetsManager)
|
||||||
val source = getAvailableSource()
|
val source = getAvailableSource()
|
||||||
if (source == null) {
|
if (source == null) {
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.WARN) { "Can not play sound: No source available: $sound" }
|
Log.log(LogMessageType.AUDIO, LogLevels.WARN) { "No source available: $sound" }
|
||||||
return@add
|
return@add
|
||||||
}
|
}
|
||||||
position?.let {
|
position?.let {
|
||||||
@ -230,22 +230,22 @@ class AudioPlayer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun exit() {
|
fun exit() {
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "Unloading OpenAL..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.INFO) { "Unloading OpenAL..." }
|
||||||
|
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Unloading sounds..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Unloading sounds..." }
|
||||||
soundManager.unload()
|
soundManager.unload()
|
||||||
|
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Unloading sources..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Unloading sources..." }
|
||||||
for (source in sources.toSynchronizedList()) {
|
for (source in sources.toSynchronizedList()) {
|
||||||
source.unload()
|
source.unload()
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Destroying OpenAL context..." }
|
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Destroying OpenAL context..." }
|
||||||
|
|
||||||
alcSetThreadContext(MemoryUtil.NULL)
|
alcSetThreadContext(MemoryUtil.NULL)
|
||||||
alcDestroyContext(context)
|
alcDestroyContext(context)
|
||||||
alcCloseDevice(device)
|
alcCloseDevice(device)
|
||||||
|
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "Unloaded OpenAL!" }
|
Log.log(LogMessageType.AUDIO, LogLevels.INFO) { "Unloaded OpenAL!" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2021 Moritz Zwerger
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -45,13 +45,13 @@ data class Sound(
|
|||||||
if (data != null) {
|
if (data != null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Loading audio file: $path" }
|
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Loading audio file: $path" }
|
||||||
try {
|
try {
|
||||||
val data = SoundData(assetsManager, this)
|
val data = SoundData(assetsManager, this)
|
||||||
this.data = data
|
this.data = data
|
||||||
this.buffer = OpenALBuffer(data)
|
this.buffer = OpenALBuffer(data)
|
||||||
} catch (exception: FileNotFoundException) {
|
} catch (exception: FileNotFoundException) {
|
||||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.WARN) { "Can not load sound: $path: $exception" }
|
Log.log(LogMessageType.AUDIO, LogLevels.WARN) { "Can not load sound: $path: $exception" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ enum class LogMessageType(
|
|||||||
|
|
||||||
RENDERING_GENERAL(ChatColors.GREEN),
|
RENDERING_GENERAL(ChatColors.GREEN),
|
||||||
RENDERING_LOADING(ChatColors.GREEN),
|
RENDERING_LOADING(ChatColors.GREEN),
|
||||||
AUDIO_LOADING(ChatColors.DARK_PURPLE),
|
AUDIO(ChatColors.DARK_PURPLE),
|
||||||
|
|
||||||
CHAT_IN(ChatColors.LIGHT_PURPLE),
|
CHAT_IN(ChatColors.LIGHT_PURPLE),
|
||||||
CHAT_OUT(ChatColors.LIGHT_PURPLE),
|
CHAT_OUT(ChatColors.LIGHT_PURPLE),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user