summaryrefslogtreecommitdiffstats
path: root/scene/audio
diff options
context:
space:
mode:
Diffstat (limited to 'scene/audio')
-rw-r--r--scene/audio/audio_stream_player.cpp1
-rw-r--r--scene/audio/audio_stream_player_internal.cpp7
2 files changed, 4 insertions, 4 deletions
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index dadcfab69f..0c2bd64e84 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -59,6 +59,7 @@ Ref<AudioStream> AudioStreamPlayer::get_stream() const {
}
void AudioStreamPlayer::set_volume_db(float p_volume) {
+ ERR_FAIL_COND_MSG(Math::is_nan(p_volume), "Volume can't be set to NaN.");
internal->volume_db = p_volume;
Vector<AudioFrame> volume_vector = _get_volume_vector();
diff --git a/scene/audio/audio_stream_player_internal.cpp b/scene/audio/audio_stream_player_internal.cpp
index 19b3ec481b..a7b8faaaae 100644
--- a/scene/audio/audio_stream_player_internal.cpp
+++ b/scene/audio/audio_stream_player_internal.cpp
@@ -31,7 +31,6 @@
#include "audio_stream_player_internal.h"
#include "scene/main/node.h"
-#include "scene/scene_string_names.h"
#include "servers/audio/audio_stream.h"
void AudioStreamPlayerInternal::_set_process(bool p_enabled) {
@@ -78,7 +77,7 @@ void AudioStreamPlayerInternal::process() {
_set_process(false);
}
if (!playbacks_to_remove.is_empty()) {
- node->emit_signal(SNAME("finished"));
+ node->emit_signal(SceneStringName(finished));
}
}
@@ -307,14 +306,14 @@ StringName AudioStreamPlayerInternal::get_bus() const {
return bus;
}
}
- return SceneStringNames::get_singleton()->Master;
+ return SceneStringName(Master);
}
AudioStreamPlayerInternal::AudioStreamPlayerInternal(Node *p_node, const Callable &p_play_callable, bool p_physical) {
node = p_node;
play_callable = p_play_callable;
physical = p_physical;
- bus = SceneStringNames::get_singleton()->Master;
+ bus = SceneStringName(Master);
AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp((Object *)node, &Object::notify_property_list_changed));
AudioServer::get_singleton()->connect("bus_renamed", callable_mp((Object *)node, &Object::notify_property_list_changed).unbind(3));