summaryrefslogtreecommitdiff
path: root/scene/audio
diff options
context:
space:
mode:
authorRafał Mikrut <mikrutrafal@protonmail.com>2021-02-07 22:29:31 +0100
committerRafał Mikrut <mikrutrafal@protonmail.com>2021-02-07 22:29:31 +0100
commit003bb8e1a8c9bb81e3cb0733b3f0d569b1518881 (patch)
tree3c7f54d3b3e6d355a2ffb14933e0b5461478b224 /scene/audio
parent57e2822a05c29db3980ad243c37a34acf6c4d14b (diff)
Initialize class variables with default values in scene/ [1/2]
Diffstat (limited to 'scene/audio')
-rw-r--r--scene/audio/audio_stream_player.cpp11
-rw-r--r--scene/audio/audio_stream_player.h28
2 files changed, 14 insertions, 25 deletions
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index 4a9e146696..70d00734f4 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -402,18 +402,7 @@ void AudioStreamPlayer::_bind_methods() {
}
AudioStreamPlayer::AudioStreamPlayer() {
- mix_volume_db = 0;
- pitch_scale = 1.0;
- volume_db = 0;
- autoplay = false;
- setseek = -1;
- active = false;
- stream_paused = false;
- stream_paused_fade = false;
- mix_target = MIX_TARGET_STEREO;
fadeout_buffer.resize(512);
- setstop = false;
- use_fadeout = false;
AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer::_bus_layout_changed));
}
diff --git a/scene/audio/audio_stream_player.h b/scene/audio/audio_stream_player.h
index fa45a39682..ab98d41302 100644
--- a/scene/audio/audio_stream_player.h
+++ b/scene/audio/audio_stream_player.h
@@ -49,22 +49,22 @@ private:
Ref<AudioStream> stream;
Vector<AudioFrame> mix_buffer;
Vector<AudioFrame> fadeout_buffer;
- bool use_fadeout;
-
- volatile float setseek;
- volatile bool active;
- volatile bool setstop;
- volatile bool stop_has_priority;
-
- float mix_volume_db;
- float pitch_scale;
- float volume_db;
- bool autoplay;
- bool stream_paused;
- bool stream_paused_fade;
+ bool use_fadeout = false;
+
+ volatile float setseek = -1.0;
+ volatile bool active = false;
+ volatile bool setstop = false;
+ volatile bool stop_has_priority = false;
+
+ float mix_volume_db = 0.0;
+ float pitch_scale = 1.0;
+ float volume_db = 0.0;
+ bool autoplay = false;
+ bool stream_paused = false;
+ bool stream_paused_fade = false;
StringName bus;
- MixTarget mix_target;
+ MixTarget mix_target = MIX_TARGET_STEREO;
void _mix_internal(bool p_fadeout);
void _mix_audio();