6.0.0-rc4Source

QtFM::FmEngine Class

The FmEngine singleton is the engine that every Nt FM QML type plays through. More…

Header#include <QtFMQml/qfmqml.h>
CMaketarget_link_libraries(app PRIVATE Nt::FMQml)
ModuleNt FM QML Types
InheritsQObject

List of all members, including inherited members

Public Functions

intsampleRate() const
voidsetSampleRate(int rate)
intmaxVoices() const
voidsetMaxVoices(int voices)
doublemasterGain() const
voidsetMasterGain(double dB)
intactiveVoices() const
boolisStarted() const
boolautoStart() const
voidsetAutoStart(bool start)
doublebusGain(int bus) const
voidsetBusGain(int bus, double dB)
boolstart()
voidstop()
voidstopAll()
QtFM::Engine *engine()
voidrequireChip(ChipType chip)

Signals

Static Public Members

FmEngine *instance()
voidreset()

Detailed Description

The engine is made the first time a sound plays, with the chips that the sounds of the loaded documents asked for, and started on the default sound output unless autoStart is false. Its sampleRate and maxVoices only take effect if they are set before that.

Component.onCompleted: FmEngine.setBusGain(1, -12) // quieter music

Differences from Qt

One engine serves the whole process. Its chips are fixed once it has been made.

Member Function Documentation

int QtFM::FmEngine::activeVoices() const

Returns the number of voices playing.

[signal] void QtFM::FmEngine::activeVoicesChanged()

This signal is emitted when activeVoices() changes.

bool QtFM::FmEngine::autoStart() const

Returns true if the engine starts on the default output when it is made; true by default. A test sets it to false and pulls samples from engine() instead.

[signal] void QtFM::FmEngine::autoStartChanged()

This signal is emitted when autoStart() changes.

double QtFM::FmEngine::busGain(int bus) const

Returns the gain of bus in decibels.

QtFM::Engine * QtFM::FmEngine::engine()

Returns the engine, making it, and starting it if autoStart is set, if it does not exist yet.

[static] FmEngine * QtFM::FmEngine::instance()

Returns the engine of the process, making it on first use.

bool QtFM::FmEngine::isStarted() const

Returns true if the engine plays to a sound output.

double QtFM::FmEngine::masterGain() const

Returns the gain of the mix in decibels.

[signal] void QtFM::FmEngine::masterGainChanged()

This signal is emitted when masterGain() changes.

int QtFM::FmEngine::maxVoices() const

Returns the number of native voices, 32 by default.

[signal] void QtFM::FmEngine::maxVoicesChanged()

This signal is emitted when maxVoices() changes.

[signal] void QtFM::FmEngine::musicFinished()

This signal is emitted when music that does not loop ends.

void QtFM::FmEngine::requireChip(ChipType chip)

Asks for chip to be emulated by the engine, if it has not been made yet.

[static] void QtFM::FmEngine::reset()

Stops and destroys the engine of the process, so that the next sound makes a new one; for tests.

int QtFM::FmEngine::sampleRate() const

Returns the sample rate in Hz, 48000 by default.

[signal] void QtFM::FmEngine::sampleRateChanged()

This signal is emitted when sampleRate() changes.

void QtFM::FmEngine::setAutoStart(bool start)

Sets the autoStart property to start.

See also autoStart().

void QtFM::FmEngine::setBusGain(int bus, double dB)

Sets the gain of bus (0 effects, 1 music, 2 interface) to dB.

void QtFM::FmEngine::setMasterGain(double dB)

Sets the masterGain property to dB.

See also masterGain().

void QtFM::FmEngine::setMaxVoices(int voices)

Sets the maxVoices property to voices.

See also maxVoices().

void QtFM::FmEngine::setSampleRate(int rate)

Sets the sampleRate property to rate.

See also sampleRate().

bool QtFM::FmEngine::start()

Starts the engine on the default sound output; returns false if there is none.

[signal] void QtFM::FmEngine::startedChanged()

This signal is emitted when isStarted() changes.

void QtFM::FmEngine::stop()

Stops the sound output.

void QtFM::FmEngine::stopAll()

Fades out every voice.

[signal] void QtFM::FmEngine::voiceFinished(quint32 voiceId)

This signal is emitted when the voice voiceId ends.