1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Implement BPM support

Based on #62896, only implements the BPM support part.

* Implements BPM support in the AudioStreamOGG/MP3 importers.
* Can select BPM/Bar Size and total beats in a song file, as well as edit looping points.
* Looping is now BPM aware
* Added a special importer UI for configuring this.
* Added a special preview showing the audio waveform as well as the playback position in the resource picker.
* Renamed `AudioStream::instance` to `instantiate` for correctness.
This commit is contained in:
reduz
2022-07-21 01:00:58 +02:00
committed by Juan Linietsky
parent 976cb7ea9f
commit d1ddee2258
41 changed files with 1548 additions and 438 deletions

View File

@@ -153,6 +153,8 @@ void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
singleton->call_deferred(SNAME("_update_emit"), preview->id);
}
preview->preview->version++;
preview->playback->stop();
preview->generating.clear();
@@ -171,7 +173,7 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
Preview *preview = &previews[p_stream->get_instance_id()];
preview->base_stream = p_stream;
preview->playback = preview->base_stream->instance_playback();
preview->playback = preview->base_stream->instantiate_playback();
preview->generating.set();
preview->id = p_stream->get_instance_id();