godot/scene/3d/audio_stream_player_3d.cpp

/**************************************************************************/
/*  audio_stream_player_3d.cpp                                            */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "audio_stream_player_3d.h"
#include "audio_stream_player_3d.compat.inc"

#include "core/config/project_settings.h"
#include "scene/3d/audio_listener_3d.h"
#include "scene/3d/camera_3d.h"
#include "scene/3d/physics/area_3d.h"
#include "scene/3d/velocity_tracker_3d.h"
#include "scene/audio/audio_stream_player_internal.h"
#include "scene/main/viewport.h"
#include "servers/audio/audio_stream.h"

// Based on "A Novel Multichannel Panning Method for Standard and Arbitrary Loudspeaker Configurations" by Ramy Sadek and Chris Kyriakakis (2004)
// Speaker-Placement Correction Amplitude Panning (SPCAP)
class Spcap {};

//TODO: hardcoded main speaker directions for 2, 3.1, 5.1 and 7.1 setups - these are simplified and could also be made configurable
static const Vector3 speaker_directions[7] =;

void AudioStreamPlayer3D::_calc_output_vol(const Vector3 &source_dir, real_t tightness, Vector<AudioFrame> &output) {}

void AudioStreamPlayer3D::_calc_reverb_vol(Area3D *area, Vector3 listener_area_pos, Vector<AudioFrame> direct_path_vol, Vector<AudioFrame> &reverb_vol) {}

float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const {}

void AudioStreamPlayer3D::_notification(int p_what) {}

// Interacts with PhysicsServer3D, so can only be called during _physics_process
Area3D *AudioStreamPlayer3D::_get_overriding_area() {}

// Interacts with PhysicsServer3D, so can only be called during _physics_process.
StringName AudioStreamPlayer3D::_get_actual_bus() {}

// Interacts with PhysicsServer3D, so can only be called during _physics_process.
Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() {}

void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) {}

Ref<AudioStream> AudioStreamPlayer3D::get_stream() const {}

void AudioStreamPlayer3D::set_volume_db(float p_volume) {}

float AudioStreamPlayer3D::get_volume_db() const {}

void AudioStreamPlayer3D::set_unit_size(float p_volume) {}

float AudioStreamPlayer3D::get_unit_size() const {}

void AudioStreamPlayer3D::set_max_db(float p_boost) {}

float AudioStreamPlayer3D::get_max_db() const {}

void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) {}

float AudioStreamPlayer3D::get_pitch_scale() const {}

void AudioStreamPlayer3D::play(float p_from_pos) {}

void AudioStreamPlayer3D::seek(float p_seconds) {}

void AudioStreamPlayer3D::stop() {}

bool AudioStreamPlayer3D::is_playing() const {}

float AudioStreamPlayer3D::get_playback_position() {}

void AudioStreamPlayer3D::set_bus(const StringName &p_bus) {}

StringName AudioStreamPlayer3D::get_bus() const {}

void AudioStreamPlayer3D::set_autoplay(bool p_enable) {}

bool AudioStreamPlayer3D::is_autoplay_enabled() const {}

void AudioStreamPlayer3D::_set_playing(bool p_enable) {}

void AudioStreamPlayer3D::_validate_property(PropertyInfo &p_property) const {}

void AudioStreamPlayer3D::set_max_distance(float p_metres) {}

float AudioStreamPlayer3D::get_max_distance() const {}

void AudioStreamPlayer3D::set_area_mask(uint32_t p_mask) {}

uint32_t AudioStreamPlayer3D::get_area_mask() const {}

void AudioStreamPlayer3D::set_emission_angle_enabled(bool p_enable) {}

bool AudioStreamPlayer3D::is_emission_angle_enabled() const {}

void AudioStreamPlayer3D::set_emission_angle(float p_angle) {}

float AudioStreamPlayer3D::get_emission_angle() const {}

void AudioStreamPlayer3D::set_emission_angle_filter_attenuation_db(float p_angle_attenuation_db) {}

float AudioStreamPlayer3D::get_emission_angle_filter_attenuation_db() const {}

void AudioStreamPlayer3D::set_attenuation_filter_cutoff_hz(float p_hz) {}

float AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz() const {}

void AudioStreamPlayer3D::set_attenuation_filter_db(float p_db) {}

float AudioStreamPlayer3D::get_attenuation_filter_db() const {}

void AudioStreamPlayer3D::set_attenuation_model(AttenuationModel p_model) {}

AudioStreamPlayer3D::AttenuationModel AudioStreamPlayer3D::get_attenuation_model() const {}

void AudioStreamPlayer3D::set_doppler_tracking(DopplerTracking p_tracking) {}

AudioStreamPlayer3D::DopplerTracking AudioStreamPlayer3D::get_doppler_tracking() const {}

void AudioStreamPlayer3D::set_stream_paused(bool p_pause) {}

bool AudioStreamPlayer3D::get_stream_paused() const {}

bool AudioStreamPlayer3D::has_stream_playback() {}

Ref<AudioStreamPlayback> AudioStreamPlayer3D::get_stream_playback() {}

void AudioStreamPlayer3D::set_max_polyphony(int p_max_polyphony) {}

int AudioStreamPlayer3D::get_max_polyphony() const {}

void AudioStreamPlayer3D::set_panning_strength(float p_panning_strength) {}

float AudioStreamPlayer3D::get_panning_strength() const {}

AudioServer::PlaybackType AudioStreamPlayer3D::get_playback_type() const {}

void AudioStreamPlayer3D::set_playback_type(AudioServer::PlaybackType p_playback_type) {}

bool AudioStreamPlayer3D::_set(const StringName &p_name, const Variant &p_value) {}

bool AudioStreamPlayer3D::_get(const StringName &p_name, Variant &r_ret) const {}

void AudioStreamPlayer3D::_get_property_list(List<PropertyInfo> *p_list) const {}

void AudioStreamPlayer3D::_bind_methods() {}

AudioStreamPlayer3D::AudioStreamPlayer3D() {}

AudioStreamPlayer3D::~AudioStreamPlayer3D() {}