#include "audio_server.h"
#include "core/config/project_settings.h"
#include "core/debugger/engine_debugger.h"
#include "core/error/error_macros.h"
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/math/audio_frame.h"
#include "core/os/os.h"
#include "core/string/string_name.h"
#include "core/templates/pair.h"
#include "scene/resources/audio_stream_wav.h"
#include "scene/scene_string_names.h"
#include "servers/audio/audio_driver_dummy.h"
#include "servers/audio/effects/audio_effect_compressor.h"
#include <cstring>
#ifdef TOOLS_ENABLED
#define MARK_EDITED …
#else
#define MARK_EDITED
#endif
AudioDriver *AudioDriver::singleton = …;
AudioDriver *AudioDriver::get_singleton() { … }
void AudioDriver::set_singleton() { … }
void AudioDriver::audio_server_process(int p_frames, int32_t *p_buffer, bool p_update_mix_time) { … }
void AudioDriver::update_mix_time(int p_frames) { … }
double AudioDriver::get_time_since_last_mix() { … }
double AudioDriver::get_time_to_next_mix() { … }
void AudioDriver::input_buffer_init(int driver_buffer_frames) { … }
void AudioDriver::input_buffer_write(int32_t sample) { … }
int AudioDriver::_get_configured_mix_rate() { … }
AudioDriver::SpeakerMode AudioDriver::get_speaker_mode_by_total_channels(int p_channels) const { … }
int AudioDriver::get_total_channels_by_speaker_mode(AudioDriver::SpeakerMode p_mode) const { … }
PackedStringArray AudioDriver::get_output_device_list() { … }
String AudioDriver::get_output_device() { … }
PackedStringArray AudioDriver::get_input_device_list() { … }
void AudioDriver::start_sample_playback(const Ref<AudioSamplePlayback> &p_playback) { … }
AudioDriverDummy AudioDriverManager::dummy_driver;
AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS] = …;
int AudioDriverManager::driver_count = …;
void AudioDriverManager::add_driver(AudioDriver *p_driver) { … }
int AudioDriverManager::get_driver_count() { … }
void AudioDriverManager::initialize(int p_driver) { … }
AudioDriver *AudioDriverManager::get_driver(int p_driver) { … }
void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) { … }
void AudioServer::_mix_step() { … }
void AudioServer::_mix_step_for_channel(AudioFrame *p_out_buf, AudioFrame *p_source_buf, AudioFrame p_vol_start, AudioFrame p_vol_final, float p_attenuation_filter_cutoff_hz, float p_highshelf_gain, AudioFilterSW::Processor *p_processor_l, AudioFilterSW::Processor *p_processor_r) { … }
AudioServer::AudioStreamPlaybackListNode *AudioServer::_find_playback_list_node(Ref<AudioStreamPlayback> p_playback) { … }
void AudioServer::_delete_stream_playback(Ref<AudioStreamPlayback> p_playback) { … }
void AudioServer::_delete_stream_playback_list_node(AudioStreamPlaybackListNode *p_playback_node) { … }
bool AudioServer::thread_has_channel_mix_buffer(int p_bus, int p_buffer) const { … }
AudioFrame *AudioServer::thread_get_channel_mix_buffer(int p_bus, int p_buffer) { … }
int AudioServer::thread_get_mix_buffer_size() const { … }
int AudioServer::thread_find_bus_index(const StringName &p_name) { … }
void AudioServer::set_bus_count(int p_count) { … }
void AudioServer::remove_bus(int p_index) { … }
void AudioServer::add_bus(int p_at_pos) { … }
void AudioServer::move_bus(int p_bus, int p_to_pos) { … }
int AudioServer::get_bus_count() const { … }
void AudioServer::set_bus_name(int p_bus, const String &p_name) { … }
String AudioServer::get_bus_name(int p_bus) const { … }
int AudioServer::get_bus_index(const StringName &p_bus_name) const { … }
void AudioServer::set_bus_volume_db(int p_bus, float p_volume_db) { … }
float AudioServer::get_bus_volume_db(int p_bus) const { … }
int AudioServer::get_bus_channels(int p_bus) const { … }
void AudioServer::set_bus_send(int p_bus, const StringName &p_send) { … }
StringName AudioServer::get_bus_send(int p_bus) const { … }
void AudioServer::set_bus_solo(int p_bus, bool p_enable) { … }
bool AudioServer::is_bus_solo(int p_bus) const { … }
void AudioServer::set_bus_mute(int p_bus, bool p_enable) { … }
bool AudioServer::is_bus_mute(int p_bus) const { … }
void AudioServer::set_bus_bypass_effects(int p_bus, bool p_enable) { … }
bool AudioServer::is_bus_bypassing_effects(int p_bus) const { … }
void AudioServer::_update_bus_effects(int p_bus) { … }
void AudioServer::add_bus_effect(int p_bus, const Ref<AudioEffect> &p_effect, int p_at_pos) { … }
void AudioServer::remove_bus_effect(int p_bus, int p_effect) { … }
int AudioServer::get_bus_effect_count(int p_bus) { … }
Ref<AudioEffectInstance> AudioServer::get_bus_effect_instance(int p_bus, int p_effect, int p_channel) { … }
Ref<AudioEffect> AudioServer::get_bus_effect(int p_bus, int p_effect) { … }
void AudioServer::swap_bus_effects(int p_bus, int p_effect, int p_by_effect) { … }
void AudioServer::set_bus_effect_enabled(int p_bus, int p_effect, bool p_enabled) { … }
bool AudioServer::is_bus_effect_enabled(int p_bus, int p_effect) const { … }
float AudioServer::get_bus_peak_volume_left_db(int p_bus, int p_channel) const { … }
float AudioServer::get_bus_peak_volume_right_db(int p_bus, int p_channel) const { … }
bool AudioServer::is_bus_channel_active(int p_bus, int p_channel) const { … }
void AudioServer::set_playback_speed_scale(float p_scale) { … }
float AudioServer::get_playback_speed_scale() const { … }
void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, const StringName &p_bus, Vector<AudioFrame> p_volume_db_vector, float p_start_time, float p_pitch_scale) { … }
void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, const HashMap<StringName, Vector<AudioFrame>> &p_bus_volumes, float p_start_time, float p_pitch_scale, float p_highshelf_gain, float p_attenuation_cutoff_hz) { … }
void AudioServer::stop_playback_stream(Ref<AudioStreamPlayback> p_playback) { … }
void AudioServer::set_playback_bus_exclusive(Ref<AudioStreamPlayback> p_playback, const StringName &p_bus, Vector<AudioFrame> p_volumes) { … }
void AudioServer::set_playback_bus_volumes_linear(Ref<AudioStreamPlayback> p_playback, const HashMap<StringName, Vector<AudioFrame>> &p_bus_volumes) { … }
void AudioServer::set_playback_all_bus_volumes_linear(Ref<AudioStreamPlayback> p_playback, Vector<AudioFrame> p_volumes) { … }
void AudioServer::set_playback_pitch_scale(Ref<AudioStreamPlayback> p_playback, float p_pitch_scale) { … }
void AudioServer::set_playback_paused(Ref<AudioStreamPlayback> p_playback, bool p_paused) { … }
void AudioServer::set_playback_highshelf_params(Ref<AudioStreamPlayback> p_playback, float p_gain, float p_attenuation_cutoff_hz) { … }
bool AudioServer::is_playback_active(Ref<AudioStreamPlayback> p_playback) { … }
float AudioServer::get_playback_position(Ref<AudioStreamPlayback> p_playback) { … }
bool AudioServer::is_playback_paused(Ref<AudioStreamPlayback> p_playback) { … }
uint64_t AudioServer::get_mix_count() const { … }
uint64_t AudioServer::get_mixed_frames() const { … }
String AudioServer::get_driver_name() const { … }
void AudioServer::notify_listener_changed() { … }
void AudioServer::init_channels_and_buffers() { … }
void AudioServer::init() { … }
void AudioServer::update() { … }
void AudioServer::load_default_bus_layout() { … }
void AudioServer::finish() { … }
void AudioServer::lock() { … }
void AudioServer::unlock() { … }
AudioServer::SpeakerMode AudioServer::get_speaker_mode() const { … }
float AudioServer::get_mix_rate() const { … }
float AudioServer::get_input_mix_rate() const { … }
float AudioServer::read_output_peak_db() const { … }
AudioServer *AudioServer::get_singleton() { … }
double AudioServer::get_output_latency() const { … }
double AudioServer::get_time_to_next_mix() const { … }
double AudioServer::get_time_since_last_mix() const { … }
AudioServer *AudioServer::singleton = …;
void AudioServer::add_update_callback(AudioCallback p_callback, void *p_userdata) { … }
void AudioServer::remove_update_callback(AudioCallback p_callback, void *p_userdata) { … }
void AudioServer::add_mix_callback(AudioCallback p_callback, void *p_userdata) { … }
void AudioServer::remove_mix_callback(AudioCallback p_callback, void *p_userdata) { … }
void AudioServer::add_listener_changed_callback(AudioCallback p_callback, void *p_userdata) { … }
void AudioServer::remove_listener_changed_callback(AudioCallback p_callback, void *p_userdata) { … }
void AudioServer::set_bus_layout(const Ref<AudioBusLayout> &p_bus_layout) { … }
Ref<AudioBusLayout> AudioServer::generate_bus_layout() const { … }
PackedStringArray AudioServer::get_output_device_list() { … }
String AudioServer::get_output_device() { … }
void AudioServer::set_output_device(const String &p_name) { … }
PackedStringArray AudioServer::get_input_device_list() { … }
String AudioServer::get_input_device() { … }
void AudioServer::set_input_device(const String &p_name) { … }
void AudioServer::set_enable_tagging_used_audio_streams(bool p_enable) { … }
#ifdef TOOLS_ENABLED
void AudioServer::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { … }
#endif
AudioServer::PlaybackType AudioServer::get_default_playback_type() const { … }
bool AudioServer::is_stream_registered_as_sample(const Ref<AudioStream> &p_stream) { … }
void AudioServer::register_stream_as_sample(const Ref<AudioStream> &p_stream) { … }
void AudioServer::unregister_stream_as_sample(const Ref<AudioStream> &p_stream) { … }
void AudioServer::register_sample(const Ref<AudioSample> &p_sample) { … }
void AudioServer::unregister_sample(const Ref<AudioSample> &p_sample) { … }
void AudioServer::start_sample_playback(const Ref<AudioSamplePlayback> &p_playback) { … }
void AudioServer::stop_sample_playback(const Ref<AudioSamplePlayback> &p_playback) { … }
void AudioServer::set_sample_playback_pause(const Ref<AudioSamplePlayback> &p_playback, bool p_paused) { … }
bool AudioServer::is_sample_playback_active(const Ref<AudioSamplePlayback> &p_playback) { … }
double AudioServer::get_sample_playback_position(const Ref<AudioSamplePlayback> &p_playback) { … }
void AudioServer::update_sample_playback_pitch_scale(const Ref<AudioSamplePlayback> &p_playback, float p_pitch_scale) { … }
void AudioServer::_bind_methods() { … }
AudioServer::AudioServer() { … }
AudioServer::~AudioServer() { … }
bool AudioBusLayout::_set(const StringName &p_name, const Variant &p_value) { … }
bool AudioBusLayout::_get(const StringName &p_name, Variant &r_ret) const { … }
void AudioBusLayout::_get_property_list(List<PropertyInfo> *p_list) const { … }
AudioBusLayout::AudioBusLayout() { … }