summaryrefslogtreecommitdiff
path: root/scene/audio
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:41:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 21:57:34 +0200
commit0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch)
tree198d4ff7665d89307f6ca2469fa38620a9eb1672 /scene/audio
parent07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff)
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
Diffstat (limited to 'scene/audio')
-rw-r--r--scene/audio/audio_stream_player.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index 660d148516..48f70e88cb 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -56,8 +56,9 @@ void AudioStreamPlayer::_mix_to_bus(const AudioFrame *p_frames, int p_amount) {
}
for (int c = 0; c < 4; c++) {
- if (!targets[c])
+ if (!targets[c]) {
break;
+ }
for (int i = 0; i < p_amount; i++) {
targets[c][i] += p_frames[i];
}
@@ -305,10 +306,11 @@ AudioStreamPlayer::MixTarget AudioStreamPlayer::get_mix_target() const {
}
void AudioStreamPlayer::_set_playing(bool p_enable) {
- if (p_enable)
+ if (p_enable) {
play();
- else
+ } else {
stop();
+ }
}
bool AudioStreamPlayer::_is_active() const {
@@ -330,8 +332,9 @@ void AudioStreamPlayer::_validate_property(PropertyInfo &property) const {
if (property.name == "bus") {
String options;
for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
- if (i > 0)
+ if (i > 0) {
options += ",";
+ }
String name = AudioServer::get_singleton()->get_bus_name(i);
options += name;
}