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.

Hierarchy

Overview

Methods

Protected procedure DoStop; override;
Public constructor Create(AOwner: TComponent); override;
Public function InternalFinalVolume: Single; override;
Public function InternalFinalPitch: 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.

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public function InternalFinalVolume: Single; override;

This item has no description.

Public function InternalFinalPitch: Single; override;

This item has no description.

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).

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.


Generated by PasDoc 0.16.0-snapshot.