From e03f2b65c2dd0ea8a801027b564eadeae554bed4 Mon Sep 17 00:00:00 2001 From: Micky Date: Sun, 7 Jan 2024 11:59:19 +0100 Subject: [PATCH] Fill the documentation of a few overlooked classes --- doc/classes/AudioEffect.xml | 19 +++++++++++++++++-- doc/classes/AudioEffectInstance.xml | 7 +++++++ doc/classes/MissingNode.xml | 6 ++++-- doc/classes/MissingResource.xml | 6 ++++-- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/doc/classes/AudioEffect.xml b/doc/classes/AudioEffect.xml index f0e8b4f19eff..4fe47ac011ca 100644 --- a/doc/classes/AudioEffect.xml +++ b/doc/classes/AudioEffect.xml @@ -1,18 +1,33 @@ - Audio effect for audio. + Base class for audio effect resources. - Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. + The base [Resource] for every audio effect. In the editor, an audio effect can be added to the current bus layout through the Audio panel. At run-time, it is also possible to manipulate audio effects through [method AudioServer.add_bus_effect], [method AudioServer.remove_bus_effect], and [method AudioServer.get_bus_effect]. + When applied on a bus, an audio effect creates a corresponding [AudioEffectInstance]. The instance is directly responsible for manipulating the sound, based on the original audio effect's properties. + $DOCS_URL/tutorials/audio/audio_buses.html https://godotengine.org/asset-library/asset/527 + Override this method to customize the [AudioEffectInstance] created when this effect is applied on a bus in the editor's Audio panel, or through [method AudioServer.add_bus_effect]. + [codeblock] + extends AudioEffect + + @export var strength = 4.0 + + func _instantiate(): + var effect = CustomAudioEffectInstance.new() + effect.base = self + + return effect + [/codeblock] + [b]Note:[/b] It is recommended to keep a reference to the original [AudioEffect] in the new instance. Depending on the implementation this allows the effect instance to listen for changes at run-time and be modified accordingly. diff --git a/doc/classes/AudioEffectInstance.xml b/doc/classes/AudioEffectInstance.xml index 3e868ae9da7f..0f3ae11793cc 100644 --- a/doc/classes/AudioEffectInstance.xml +++ b/doc/classes/AudioEffectInstance.xml @@ -1,10 +1,13 @@ + Manipulates the audio it receives for a given effect. + An audio effect instance manipulates the audio it receives for a given effect. This instance is automatically created by an [AudioEffect] when it is added to a bus, and should usually not be created directly. If necessary, it can be fetched at run-time with [method AudioServer.get_bus_effect_instance]. + $DOCS_URL/tutorials/audio/audio_buses.html @@ -13,11 +16,15 @@ + Called by the [AudioServer] to process this effect. When [method _process_silence] is not overridden or it returns [code]false[/code], this method is called only when the bus is active. + [b]Note:[/b] It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it. + Override this method to customize the processing behavior of this effect instance. + Should return [code]true[/code] to force the [AudioServer] to always call [method _process], even if the bus has been muted or cannot otherwise be heard. diff --git a/doc/classes/MissingNode.xml b/doc/classes/MissingNode.xml index 6e5f839778a0..4e528206cc68 100644 --- a/doc/classes/MissingNode.xml +++ b/doc/classes/MissingNode.xml @@ -4,15 +4,17 @@ An internal editor class intended for keeping the data of unrecognized nodes. - This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in a scene. + [b]Warning:[/b] Ignore missing nodes unless you know what you are doing. Existing properties on a missing node can be freely modified in code, regardless of the type they are intended to be. - Returns the name of the type this node was originally. + The name of the class this node was supposed to be (see [method Object.get_class]). + If set to [code]true[/code], allows new properties to be added on top of the existing ones with [method Object.set]. diff --git a/doc/classes/MissingResource.xml b/doc/classes/MissingResource.xml index 84a12290b3bc..442b0abd5eae 100644 --- a/doc/classes/MissingResource.xml +++ b/doc/classes/MissingResource.xml @@ -4,15 +4,17 @@ An internal editor class intended for keeping the data of unrecognized resources. - This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in a scene. + [b]Warning:[/b] Ignore missing resources unless you know what you are doing. Existing properties on a missing resource can be freely modified in code, regardless of the type they are intended to be. - Returns the name of the class this resource was originally. + The name of the class this resource was supposed to be (see [method Object.get_class]). + If set to [code]true[/code], allows new properties to be added on top of the existing ones with [method Object.set].