diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt index c90a3512a..131180206 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt @@ -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!" } } } diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/sounds/Sound.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/sounds/Sound.kt index 7b198c4cf..c7e8fb688 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/sounds/Sound.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/sounds/Sound.kt @@ -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" } } } diff --git a/src/main/java/de/bixilon/minosoft/util/logging/LogMessageType.kt b/src/main/java/de/bixilon/minosoft/util/logging/LogMessageType.kt index 038dd2609..d59d40d50 100644 --- a/src/main/java/de/bixilon/minosoft/util/logging/LogMessageType.kt +++ b/src/main/java/de/bixilon/minosoft/util/logging/LogMessageType.kt @@ -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),