QtFM::FmSoundBank Class
The FmSoundBank type loads a bank of patches, by name. More…
| Header | #include <QtFMQml/qfmqml.h> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::FMQml) |
| Module | Nt FM QML Types |
| Inherits | QObject |
List of all members, including inherited members
Public Functions
| FmSoundBank(QObject *parent = nullptr) | |
| QUrl | source() const |
| void | setSource(const QUrl &source) |
| QStringList | names() const |
| int | count() const |
| QString | error() const |
| PatchBank | bank() const |
| QtFM::FmPatchValue * | sound(const QString &name) const |
Signals
| void | sourceChanged() |
| void | namesChanged() |
| void | errorChanged() |
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
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.
void QtFM::FmSoundBank::errorChanged()
This signal is emitted when error() changes.
QStringList QtFM::FmSoundBank::names() const
Returns the names of the patches.
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.
void QtFM::FmSoundBank::sourceChanged()
This signal is emitted when source() changes.