summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-03-28 15:39:24 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-03-28 21:13:01 +0200
commit45ec0e31c31b625ee8a56f6d2315af455172acc3 (patch)
tree0d891bed1c78674da054c07deebaf832b32a60fb /servers
parent1ae8b2de38edd3f013226a88490cd3d4f83d2a61 (diff)
Remove last editor code dependencies in template build
SConstruct change also makes it possible to outright delete the `editor` folder in a `tools=no` build, which we use in CI to ensure no invalid cross-dependencies are added.
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/effects/audio_effect_record.cpp9
-rw-r--r--servers/audio/effects/audio_effect_record.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp
index a5866bb380..0069f6ad85 100644
--- a/servers/audio/effects/audio_effect_record.cpp
+++ b/servers/audio/effects/audio_effect_record.cpp
@@ -30,6 +30,11 @@
#include "audio_effect_record.h"
+#ifdef TOOLS_ENABLED
+// FIXME: This file shouldn't depend on editor stuff.
+#include "editor/import/resource_importer_wav.h"
+#endif
+
void AudioEffectRecordInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
if (!is_recording) {
for (int i = 0; i < p_frame_count; i++) {
@@ -250,8 +255,12 @@ Ref<AudioStreamSample> AudioEffectRecord::get_recording() const {
Vector<uint8_t> bleft;
Vector<uint8_t> bright;
+#ifdef TOOLS_ENABLED
ResourceImporterWAV::_compress_ima_adpcm(left, bleft);
ResourceImporterWAV::_compress_ima_adpcm(right, bright);
+#else
+ ERR_PRINT("AudioEffectRecord cannot do IMA ADPCM compression at runtime.");
+#endif
int dl = bleft.size();
dst_data.resize(dl * 2);
diff --git a/servers/audio/effects/audio_effect_record.h b/servers/audio/effects/audio_effect_record.h
index 18b5d4d83c..305484d1cb 100644
--- a/servers/audio/effects/audio_effect_record.h
+++ b/servers/audio/effects/audio_effect_record.h
@@ -35,7 +35,6 @@
#include "core/io/marshalls.h"
#include "core/os/os.h"
#include "core/os/thread.h"
-#include "editor/import/resource_importer_wav.h"
#include "scene/resources/audio_stream_sample.h"
#include "servers/audio/audio_effect.h"
#include "servers/audio_server.h"