From 876c509a9d171d71803857df3b263900b3d140da Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 27 Apr 2019 15:28:20 -0300 Subject: Removed function to compute time, should not be that useful in practice. --- scene/audio/audio_stream_player.cpp | 10 +--------- scene/audio/audio_stream_player.h | 4 ---- 2 files changed, 1 insertion(+), 13 deletions(-) (limited to 'scene/audio') diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index b326049458..144e58d8b9 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -94,7 +94,6 @@ void AudioStreamPlayer::_mix_internal(bool p_fadeout) { //set volume for next mix mix_volume_db = target_volume; - time_mixed += double(buffer_size) / AudioServer::get_singleton()->get_mix_rate(); _mix_to_bus(buffer,buffer_size); } @@ -130,9 +129,8 @@ void AudioStreamPlayer::_mix_audio() { //fade out to avoid pops _mix_internal(true); - } else { - time_mixed=0; } + stream_playback->start(setseek); setseek = -1.0; //reset seek mix_volume_db = volume_db; //reset ramp @@ -293,10 +291,6 @@ float AudioStreamPlayer::get_playback_position() { return 0; } -float AudioStreamPlayer::get_mix_time() const { - return time_mixed; -} - void AudioStreamPlayer::set_bus(const StringName &p_bus) { //if audio is active, must lock this @@ -400,7 +394,6 @@ void AudioStreamPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("is_playing"), &AudioStreamPlayer::is_playing); ClassDB::bind_method(D_METHOD("get_playback_position"), &AudioStreamPlayer::get_playback_position); - ClassDB::bind_method(D_METHOD("get_mix_time"), &AudioStreamPlayer::get_mix_time); ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioStreamPlayer::set_bus); ClassDB::bind_method(D_METHOD("get_bus"), &AudioStreamPlayer::get_bus); @@ -451,7 +444,6 @@ AudioStreamPlayer::AudioStreamPlayer() { fadeout_buffer.resize(512); setstop=false; use_fadeout=false; - time_mixed = 0; AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed"); } diff --git a/scene/audio/audio_stream_player.h b/scene/audio/audio_stream_player.h index 5ff2fdf06c..0b782b67e7 100644 --- a/scene/audio/audio_stream_player.h +++ b/scene/audio/audio_stream_player.h @@ -52,9 +52,6 @@ private: Vector fadeout_buffer; bool use_fadeout; - double time_mixed; - - volatile float setseek; volatile bool active; volatile bool setstop; @@ -100,7 +97,6 @@ public: void stop(); bool is_playing() const; float get_playback_position(); - float get_mix_time() const; void set_bus(const StringName &p_bus); StringName get_bus() const; -- cgit v1.2.3