summaryrefslogtreecommitdiffstats
path: root/servers/audio_server.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix crash in AudioServer when switching audio devices with different audio ↵Bartłomiej T. Listwon2022-04-011-0/+1
| | | | channels count (connecting PS5 controller, bluetooth 5.1 headphones etc.)
* Expose `AudioServer.capture_device` as a propertyHugo Locurcio2022-02-171-0/+4
| | | | | This is more consistent with `AudioServer.device` (for output), which is already exposed as a property.
* simplify formatting scripts, add a clang-tidy script, and run clang-tidyNathan Franke2022-01-291-2/+4
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Add a shader warning when the uniform buffer limit is exceededYuri Roubinsky2022-01-031-1/+1
|
* Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-3/+3
|
* Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio2021-11-031-8/+8
| | | | | This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
* fix potential memory leak of AudioStreamPlaybackBusDetails in ↵Mark Riedesel2021-10-181-2/+4
| | | | AudioServer::start_playback_stream()
* Allow AudioStreamPlayer(2D) to provide `pitch_scale` on playbackDouglas Leão2021-10-101-3/+3
|
* [HTML5] Use browser mix rate by default on the Web.Fabio Alessandrelli2021-09-151-0/+1
| | | | | | Browsers doesn't really like forcing the mix rate, e.g. Firefox does not allow input (microphone) if the mix rate is not the default one, Chrom* will exhibit worse performances, etc.
* Add polyphony to Audio Stream Player nodesEllen Poe2021-09-071-44/+44
|
* Do all audio mixing in the AudioServerEllen Poe2021-08-271-34/+458
|
* Invert how `global_rate_scale` value works, and rename it to ↵Michael Alexsander2021-08-071-8/+8
| | | | `playback_speed_scale`
* Optimize StringName usagereduz2021-07-181-5/+5
| | | | | | | | | | | * 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.
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-3/+3
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* Fix some warnings raised by GCC-11.1jfons2021-05-251-0/+3
|
* Fix AudioServer Crash when bus count equals 0Maganty Rushyendra2021-04-241-0/+1
|
* Reorganize Project Settingsreduz2021-02-181-9/+9
| | | | | | | -Advanced Settings toggle also hides advanced properties when disabled -Simplified Advanced Bar (errors were just plain redundant) -Reorganized rendering quality settings. -Reorganized miscelaneous settings for clean up.
* Make audio bus channels' peak volume consistentPedro J. Estébanez2021-02-021-1/+2
| | | | Channels that are inactive -or when playback has not started yet- will report -200 dB as their peak value (which is also the lowest value possible during playback).
* Fixes #45025 - Protects _last_mix_time and _last_frame_time with the ↵Sean LaPlante2021-01-161-5/+12
| | | | AudioDriver lock() and unlock() methods
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Merge pull request #43333 from YeldhamDev/global_rate_scale_minRémi Verschelde2020-11-101-0/+2
|\ | | | | Disallow setting the AudioServer's 'global_rate_scale' to a value equal or inferior to 0
| * Disallow setting the AudioServer's 'global_rate_scale' to a value equal or ↵Michael Alexsander2020-11-051-0/+2
| | | | | | | | inferior to 0
* | Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
|/ | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Add default 50ms output_latency web override.Fabio Alessandrelli2020-07-011-0/+1
| | | | | Hopefully a good tradeoff between latency and performance on most browsers.
* Move mix_rate, ouput_latency to AudioDriverManagerFabio Alessandrelli2020-05-181-0/+3
| | | | | | | Each driver used to define the (same) project settings values `audio/mix_rate` and `audio/output_latency`, but the setting names are not driver specific. Overriding is still possible via platform tags.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-24/+46
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-106/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-7/+14
| | | | Part of #33027.
* Replace NULL with nullptrlupoDharkael2020-04-021-8/+8
|
* Remove the audio memory allocator, use regular one instead.Juan Linietsky2020-03-271-43/+0
|
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling.
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-10/+9
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-4/+4
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Workaround WebM playback bug after AudioServer latency fixesRémi Verschelde2020-02-071-6/+2
| | | | | | | | | | | | | | | | | | | | | af9bb0ea15dfd3dfe8950fcfcce364485dadd92a fixed AudioServer's `get_output_delay()` (which used to always return 0) while renaming it to `get_output_latency()`. It now returns the latency from the AudioDriver, which can be non-0. While this was a clear bugfix, it broke playback for WebM files without audio track. It seems like the playback code, even though it queried the output delay to calculate a time compensation, was designed to work even though the delay value was actually bogus. Now that it's correct, it's not working. As a workaround we comment out uses of the output latency, restoring the behavior of Godot 3.1. This code should still be reviewed by someone more versed in video playback and fixed to properly account for the non-0 driver latency. Fixes #35760.
* Remove duplicate WARN_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* Revert "Exposes capture methods to AudioServer + documentation" #30468Rémi Verschelde2020-01-201-50/+15
| | | | | | | | | | | | | | | | | Reverts the following commits: - c81ec6f26d40b70283958a4ef3e216fb32cbaf14: "Exposes capture methods to AudioServer, variable renames for consistency, added documentation." - 47c558b98abf842910c780294314326662410cdf: "Expose audio callbacks as signals." - dabaa11b3c451e9b8f2cca7e563bd9ec51edb169: "Fix to make sure the capture buffers are deallocated at shutdown. Silences warnings." Some documentation improvements were kept for pre-existing methods. See rationale for reverting these changes in #30468.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Fix to make sure the capture buffers are deallocated at shutdown. Silences ↵Saracen2019-10-111-0/+1
| | | | warnings.
* Expose audio callbacks as signals.Saracen2019-07-161-0/+6
|
* Exposes capture methods to AudioServer, variable renames for consistency,Saracen2019-07-151-15/+43
| | | | added documentation.
* Add 'global_rate_scale' to the AudioServerMichael Alexsander Silva Dias2019-06-191-0/+17
| | | | Closes #28953.
* Added functions to further improve music timingJuan Linietsky2019-04-271-0/+11
|
* Clean up latency related functionsJuan Linietsky2019-04-271-16/+15
|
* Added generator audio stream, and spectrum analyzer audio effectJuan Linietsky2019-04-101-0/+10
| | | | | | Made AudioFrame and Vector2 equivalent for casting. Added ability to obtain the playback object from stream players. Added ability to obtain effect instance from audio server.
* Allow default audio bus layout modificationlupoDharkael2019-04-051-2/+4
|
* Fix #25639 by not shifting a negative value.marxin2019-03-051-2/+4
|
* Fix possible crash on AudioDriver::input_buffer_writeMarcelo Fernandez2019-03-021-6/+12
|