Class TCastlePlayingSoundSource

Unit

Declaration

type TCastlePlayingSoundSource = class(TCastlePlayingSound)

Description

Controls a sound playback initiated by TCastleSoundSource.Play. See the ancestor TCastlePlayingSound for most important documentation. This class simply extends the ancestor with some properties useful only together with the TCastleSoundSource.

Source: src/transform/castlebehaviors_soundsource.inc (line 26).

Hierarchy

Overview

Methods

Protected procedure DoStop; override;
Public constructor Create(AOwner: TComponent); override;
Public function InternalFinalVolume: Single; override;
Public function InternalFinalPitch: Single; override;
Public function InternalFinalPriority: Single; override;

Properties

Public property Follow: Boolean read FFollow write FFollow default true;
Public property SoundHeight: Single read FSoundHeight write FSoundHeight default 0.0;

Description

Methods

Protected procedure DoStop; override;

This item has no description. Showing description inherited from TCastlePlayingSound.DoStop.

Do the necessary job after source stopped, due to any reason. In this class it handles OnStop and FreeOnStop.

If you override this: Since FreeOnStop may free the instance, you should add your code before calling inherited.

Source: src/transform/castlebehaviors_soundsource.inc (line 36).

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Source: src/transform/castlebehaviors_soundsource.inc (line 38).

Public function InternalFinalVolume: Single; override;

This item has no description.

Source: src/transform/castlebehaviors_soundsource.inc (line 39).

Public function InternalFinalPitch: Single; override;

This item has no description.

Source: src/transform/castlebehaviors_soundsource.inc (line 40).

Public function InternalFinalPriority: Single; override;

This item has no description.

Source: src/transform/castlebehaviors_soundsource.inc (line 41).

Properties

Public property Follow: Boolean read FFollow write FFollow default true;

If Follow then the sound position will be updated as the parent TCastleTransform moves. Moreover, when TCastleSoundSource will be destroyed, the sound will stop. An example would be a walking sound of a creature – the sound moves together with the creature.

If not Follow, then the sound will start at the parent's position, and then it will continue to be played independent of the parent existence or position changes. An example would be an explosion sound – the sound stays at the position it happened, regardless if the object moved.

This matters only for spatial sounds (TCastleSoundSource.Spatial).

Source: src/transform/castlebehaviors_soundsource.inc (line 57).

Public property SoundHeight: Single read FSoundHeight write FSoundHeight default 0.0;

The exact sound position reflects the transformation of the TCastleSoundSource, either Parent.Translation or Parent.Middle. Use this property to control which one, it makes a linear interpolation between them.

SoundHeight = 0 means to use Parent.Translation, SoundHeight = 1 means Parent.Middle other values imply a linear interpolation between the above two values.

You can conigure Parent.Middle using Parent.MiddleHeight.

Source: src/transform/castlebehaviors_soundsource.inc (line 73).


Generated by PasDoc 0.17.0.snapshot.