summaryrefslogtreecommitdiff
path: root/scene/3d/audio_stream_player_3d.cpp
AgeCommit message (Collapse)Author
2023-01-28Implement blending audio feature to AnimationTreeSilc Renew
2023-01-23Merge pull request #71801 from akien-mga/codespell-en-GB-to-en-USRémi Verschelde
Convert en_GB spelling to en_US with codespell
2023-01-23Convert en_GB spelling to en_US with codespellRémi Verschelde
2023-01-23Simplify AudioStreamPolyphonicJuan Linietsky
* Make AudioStreamPolyphonic not requre a polling thread (simpler, faster) * Improve error reporting in AudioStreamPlayer*::get_stream_playback() error reporting to improve usability.
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-11-22Fix AudioStreamPlayer2D and 3D's `playing` not updating right awayMicky
2022-10-18Unify usage of GLOBAL/EDITOR_GETkobewi
2022-10-11Merge pull request #66221 from Mickeon/painstakingly-appending-ds-en-you-tea-esRémi Verschelde
Rename remaining "*_enable" to "*_enabled"
2022-09-21Rename remaining "*_enable" to "*_enabled"Micky
Material.`proximity_fade_enable` -> `proximity_fade_enabled` Material.`set_proximity_fade` -> `set_proximity_fade_enabled` (Material.`is_proximity_fade_enabled` is unchanged) Area3D.`reverb_bus_enable` -> `reverb_bus_enabled` (`set_use_reverb_bus` & `is_using_reverb_bus` are unchanged) RDPipelineRasterizationState: `depth_bias_enable` -> `depth_bias_enabled` `set_depth_bias_enable` -> `set_depth_bias_enabled` `get_depth_bias_enable` -> `get_depth_bias_enabled` Bonus: Area3D.`set_reverb_bus` -> `set_reverb_bus_name` Area3D.`get_reverb_bus` -> `set_get_reverb_bus_name`
2022-09-17Rename AudioStreamPlayer3D's `unit_db` to `volume_db`Micky
AudioStreamPlayer3D.`unit_db` -> `volume_db` Now matches the same name AudioStreamPlayer and AudioStreamPlayer2D use.
2022-09-05Fix AudioStreamPlayer not resuming after returning to SceneTreeMicky
2022-08-26Rename `str2var` to `str_to_var` and similarMicky
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
2022-08-22Make `_validate_property` a multilevel methodYuri Sizov
2022-07-23Implement BPM supportreduz
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.
2022-06-17Audio: Expose 2D/3D panning strength parametersEllen Poe
2022-05-26Add a gizmo to visualize AudioStreamPlayer3D's audible radiusHugo Locurcio
The ring's color changes depending on the attenuation model chosen, and whether Max Distance is capping the distance the sound can be heard at. Cold colors are used when the volume cap is a "soft" cap (the sound can still be heard past the distance, but only faintly). Warm colors are used when the volume cap is a "hard" cap (the sound can't be heard past the distance at all). White is used for linear fade performed when the attenuation model is Disabled and Max Distance is greater than 0. No ring is drawn when the attenuation model is Disabled and Max Distance is equal to 0 (since the sound can be heard from anywhere).
2022-05-25Only call _update_panning during _physics_process.Lyuma
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-19Use suffixes for units in nodes and resourcesAaron Franke
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-03Rename Basis get_axis to get_column, remove redundant methodsAaron Franke
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-06Merge pull request #55544 from V-Sekai/audio_camera_null_mitigationRémi Verschelde
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-04Use parameter classes instead of arguments for all physics queriesPouleyKetchoupp
Same as what is already done for shape queries, applied to point and ray queries. Easier to document and more flexible to add more parameters. Also expose intersect_point method to script in 3D. Remove intersect_point_on_canvas in 2D, replaced with a parameter.
2021-10-28Fix crash due to reentrancy in AudioStreamPlayer* finished signal.Lyuma
This crash occurred when an audio stream finished playing in NOTIFICATION_INTERNAL_PROCESS, during which it would iterate through a loop of playbacks, leading to a "finished" signal, which removed the audio player from the tree which led to a NOTIFICATION_EXIT_TREE, which would mutate the array of playbacks while within the above loop. This moves the signal callback outside of the loop which avoids the crash. Note: previously, the signal was called multiple times if the same player finishes multiple times in one frame. Now it is at most once per frame. Affects AudioStreamPlayer, AudioStreamPlayer2D and AudioStreamPlayer3D
2021-10-27Mitigate crash in AudioStreamPlayer3D when a camera has null viewportLyuma
2021-10-25Refactored Node3D rotation modesreduz
* Made the Basis euler orders indexed via enum. * Node3D has a new rotation_order property to choose Euler rotation order. * Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations. The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-18Merge pull request #52773 from Calinou/audiostreamplayer3d-tweak-max-distanceRémi Verschelde
2021-10-10Allow AudioStreamPlayer(2D) to provide `pitch_scale` on playbackDouglas Leão
2021-09-25Tweak AudioStreamPlayer3D property hints for usabilityHugo Locurcio
This also improves the documentation for the `max_distance` property.
2021-09-17Merge pull request #52774 from Calinou/audiostreamplayer3d-remove-out-of-rangeRémi Verschelde
2021-09-17Remove unused `out_of_range_mode` property from AudioStreamPlayer3DHugo Locurcio
The `out_of_range_mode` property is no longer used since audio mixing was moved out of the various AudioStreamPlayer nodes.
2021-09-16Rename Listener2D/Listener3D to AudioListener2D/AudioListener3DWilson E. Alvarez
2021-09-07Add polyphony to Audio Stream Player nodesEllen Poe
2021-08-27Do all audio mixing in the AudioServerEllen Poe
2021-08-23Implement NativeExtension pointer argumentsreduz
* Allows calling into native extensions directly with a pointer * Makes it easier to implement some APIs more efficiently * Appears with a "*" in the documentation for the argument. * Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint. * AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-14Use get_global_* functions instead of using transforms.Anilforextra
2021-08-13Fix some unnecessary includesAaron Franke
2021-08-10Organize methods in Viewport and explicitly name 3D methods with 3DAaron Franke
2021-07-23Node3D gizmo improvementsjfons
* Clean-up of node_3d_editor_plugin.{h,cpp}: removed unused code, fixed some bugs. * Moved node_3d_editor_gizmos.{h,cpp} to editor/plugins. * Added support for multiple gizmos per node. This means custom gizmos will no longer override the built-in ones and that multiple gizmos can be used in more complex nodes. * Added support for handle IDs. When adding handles to a gizmo, an ID can be specified for each one, making it easier to work with gizmos that have a variable number of handles. * Added support for subgizmos, selectable elements that can be transformed without needing a node of their own. By overriding _subgizmo_intersect_frustum() and/or _subgizmo_intersect_ray() gizmos can define which subgizmos should be selected on a region or click selection. Subgizmo transformations are applied using get/set/commit virtual methods, similar to how handles work.
2021-07-18Optimize StringName usagereduz
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
2021-06-30Fix editor suffixes and degrees conversionreduz
* Functions to convert to/from degrees are all gone. Conversion is done by the editor. * Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees. * Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m" * In general, can add suffixes for EditorSpinSlider Not covered by this PR, will have to be addressed by future ones: * Ability to switch radians/degrees in the inspector for angle properties (if actually wanted). * Animations previously made will most likely break, need to add a way to make old ones compatible. * Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes. * Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-16Refactor VisibilityNotifier3Dreduz
* This is the 3D counterpart to #49632 * Implemented a bit different as 3D works using instancing After merged, both 2D and 3D classes will most likely be renamed in a separate PR to DisplayNotifier2D/3D.
2021-06-03Merge pull request #38224 from Calinou/increase-audiostreamplayer3d-unit-sizeRémi Verschelde
Increase the default AudioStreamPlayer3D unit size to 10
2021-05-25Tweak dozens of editor property hints for consistencyHugo Locurcio
- Update Viewport MSAA property hints to match the currently exposed values. - Add some performance hints to property hints.
2021-05-06Increase the default AudioStreamPlayer3D unit size to 10Hugo Locurcio
This makes it easier to hear sound while setting up the node. Since this changes the default value, this may break existing projects slightly. This also tweaks the Unit Size editor property hint for better usability. See discussion in #25468.
2021-02-18Modernize atomicsPedro J. Estébanez
- Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>