QtCraft API C++ classes QML types Handbook

QcSoundDefinition Struct

A sound effect, ambience loop or jingle described by synthesis parameters (content sounds/). More...

Header: #include <common/content/registry/QcSoundDefinition.h>

Public Functions

QString problem() const
double seconds() const

Public Variables

QcSoundBus bus
double drive
QList<QcSoundLayer> layers
bool loop
QString name
double pitchVariation
double range
int variants
double volume
double volumeVariation

Static Public Members

const double defaultRange
const double maxDrive
const double maxFrequency
const double maxLayerSeconds
const double maxLayerStart
const int maxLayers
const double maxRange
const double maxResonance
const int maxVariants
const double minFrequency
const double minResonance

Detailed Description

Member Function Documentation

QString QcSoundDefinition::problem() const

Returns an empty string when every value lies within the ranges content may use; otherwise the first problem. Wire data is untrusted, so the content sync checks it as well as the parser.

double QcSoundDefinition::seconds() const

Returns the length in seconds: the end of the latest layer.

Member Variable Documentation

QcSoundBus QcSoundDefinition::bus

The mixer group it plays on (JSON "bus").

const double QcSoundDefinition::defaultRange

The range of a sound that does not give one, in metres.

double QcSoundDefinition::drive

Soft saturation of the rendering (0 off, up to maxDrive): the quieter parts come up towards the peak, so a blast sounds dense and loud while its peak stays where it was (decision E-879).

QList<QcSoundLayer> QcSoundDefinition::layers

The voices mixed into the sound, 1 to maxLayers.

bool QcSoundDefinition::loop

Loops play until stopped (ambience) and are rendered seamless.

const double QcSoundDefinition::maxDrive

The strongest drive.

const double QcSoundDefinition::maxFrequency

The highest frequency, in Hz, of a tone, a sweep end and a filter.

const double QcSoundDefinition::maxLayerSeconds

The longest duration of a layer, in seconds.

const double QcSoundDefinition::maxLayerStart

The latest start of a layer, in seconds.

const int QcSoundDefinition::maxLayers

The most layers a sound may have.

const double QcSoundDefinition::maxRange

The largest range, in metres.

const double QcSoundDefinition::maxResonance

The highest band-pass resonance.

const int QcSoundDefinition::maxVariants

The most variants a sound may have.

const double QcSoundDefinition::minFrequency

The lowest frequency, in Hz, of a tone, a sweep end and a filter that is switched on.

const double QcSoundDefinition::minResonance

The lowest band-pass resonance.

QString QcSoundDefinition::name

The qualified name (JSON "name").

double QcSoundDefinition::pitchVariation

Random pitch change per play, as a share (0.1 = up to +-10 %).

double QcSoundDefinition::range

Distance in metres at which a positioned sound of volume 1 fades out completely.

int QcSoundDefinition::variants

Differently seeded renderings; one is picked per play.

double QcSoundDefinition::volume

Loudness in 0..1, multiplied with the event's volume.

double QcSoundDefinition::volumeVariation

Random loudness change per play, as a share (0.2 = up to 20 % quieter; decision E-879).