6.0.0-rc4Source

QtFM::FmSoundBank Class

The FmSoundBank type loads a bank of patches, by name. 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

FmSoundBank(QObject *parent = nullptr)
QUrlsource() const
voidsetSource(const QUrl &source)
QStringListnames() const
intcount() const
QStringerror() const
PatchBankbank() const
QtFM::FmPatchValue *sound(const QString &name) const

Signals

Detailed Description

property FmSoundBank bank: FmSoundBank { source: "sfx.json" }
property FmSound blip: FmSound { patch: game.bank.sound("blip") }

Differences from Qt

Banks load from JSON files only: CBOR and IBK banks are read from C++ with QtFM::PatchBank.

Member Function Documentation

[explicit] QtFM::FmSoundBank::FmSoundBank(QObject *parent = nullptr)

Constructs a bank with parent.

PatchBank QtFM::FmSoundBank::bank() const

Returns the bank.

int QtFM::FmSoundBank::count() const

Returns the number of patches.

QString QtFM::FmSoundBank::error() const

Returns why source could not be loaded, or an empty string.

[signal] void QtFM::FmSoundBank::errorChanged()

This signal is emitted when error() changes.

QStringList QtFM::FmSoundBank::names() const

Returns the names of the patches.

[signal] void QtFM::FmSoundBank::namesChanged()

This signal is emitted when names() changes.

void QtFM::FmSoundBank::setSource(const QUrl &source)

Sets the source property to source.

See also source().

QtFM::FmPatchValue * QtFM::FmSoundBank::sound(const QString &name) const

Returns the patch named name, for FmSound::patch.

QUrl QtFM::FmSoundBank::source() const

Returns the url of a bank's JSON file.

[signal] void QtFM::FmSoundBank::sourceChanged()

This signal is emitted when source() changes.