aboutsummaryrefslogtreecommitdiff
path: root/scene/audio/audio_player.cpp
diff options
context:
space:
mode:
authorShyRed2018-03-08 19:11:46 +0100
committerShyRed2018-03-16 15:26:23 +0100
commitbc1522e26865c9b84159ff4b4bcde7896fd73496 (patch)
tree04dd02043a0354801f451606c7a4d6550c04bf53 /scene/audio/audio_player.cpp
parent8ded15b035e9db959b7669ec72b38d1a94a8df30 (diff)
downloadgodot-bc1522e26865c9b84159ff4b4bcde7896fd73496.tar.gz
godot-bc1522e26865c9b84159ff4b4bcde7896fd73496.tar.zst
godot-bc1522e26865c9b84159ff4b4bcde7896fd73496.zip
Diffstat (limited to 'scene/audio/audio_player.cpp')
-rw-r--r--scene/audio/audio_player.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp
index 408c00334..e7ace82fc 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -127,6 +127,7 @@ void AudioStreamPlayer::_notification(int p_what) {
if (!active || (setseek < 0 && !stream_playback->is_playing())) {
active = false;
set_process_internal(false);
+ //_change_notify("playing"); //update property in editor
emit_signal("finished");
}
}
@@ -211,8 +212,13 @@ void AudioStreamPlayer::stop() {
bool AudioStreamPlayer::is_playing() const {
+#ifdef TOOLS_ENABLED
+ if (Engine::get_singleton()->is_editor_hint())
+ return fake_active;
+#endif
+
if (stream_playback.is_valid()) {
- return active; //&& stream_playback->is_playing();
+ return active; // && stream_playback->is_playing();
}
return false;
@@ -265,11 +271,16 @@ AudioStreamPlayer::MixTarget AudioStreamPlayer::get_mix_target() const {
void AudioStreamPlayer::_set_playing(bool p_enable) {
+#ifdef TOOLS_ENABLED
+ fake_active = p_enable;
+#endif
+
if (p_enable)
play();
else
stop();
}
+
bool AudioStreamPlayer::_is_active() const {
return active;