mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -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) {
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "Loading OpenAL..." }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.INFO) { "Loading OpenAL..." }
|
||||
|
||||
soundManager.load()
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Preloading sounds..." }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Preloading sounds..." }
|
||||
soundManager.preload()
|
||||
|
||||
|
||||
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Initializing OpenAL..." }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Initializing OpenAL..." }
|
||||
device = alcOpenDevice(null as ByteBuffer?)
|
||||
check(device != MemoryUtil.NULL) { "Failed to open the default device." }
|
||||
|
||||
@ -102,7 +102,7 @@ class AudioPlayer(
|
||||
|
||||
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) {
|
||||
if (it) {
|
||||
@ -188,7 +188,7 @@ class AudioPlayer(
|
||||
sound.load(connection.assetsManager)
|
||||
val source = getAvailableSource()
|
||||
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
|
||||
}
|
||||
position?.let {
|
||||
@ -230,22 +230,22 @@ class AudioPlayer(
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Unloading sources..." }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Unloading sources..." }
|
||||
for (source in sources.toSynchronizedList()) {
|
||||
source.unload()
|
||||
}
|
||||
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Destroying OpenAL context..." }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Destroying OpenAL context..." }
|
||||
|
||||
alcSetThreadContext(MemoryUtil.NULL)
|
||||
alcDestroyContext(context)
|
||||
alcCloseDevice(device)
|
||||
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.INFO) { "Unloaded OpenAL!" }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.INFO) { "Unloaded OpenAL!" }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
@ -45,13 +45,13 @@ data class Sound(
|
||||
if (data != null) {
|
||||
return
|
||||
}
|
||||
Log.log(LogMessageType.AUDIO_LOADING, LogLevels.VERBOSE) { "Loading audio file: $path" }
|
||||
Log.log(LogMessageType.AUDIO, LogLevels.VERBOSE) { "Loading audio file: $path" }
|
||||
try {
|
||||
val data = SoundData(assetsManager, this)
|
||||
this.data = data
|
||||
this.buffer = OpenALBuffer(data)
|
||||
} 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_LOADING(ChatColors.GREEN),
|
||||
AUDIO_LOADING(ChatColors.DARK_PURPLE),
|
||||
AUDIO(ChatColors.DARK_PURPLE),
|
||||
|
||||
CHAT_IN(ChatColors.LIGHT_PURPLE),
|
||||
CHAT_OUT(ChatColors.LIGHT_PURPLE),
|
||||
|
Loading…
x
Reference in New Issue
Block a user