QtFM::FmPatch Class
The FmPatch singleton makes patches: generated, parsed or mutated. 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 Types
| enum | Category |
Public Functions
| FmPatch(QObject *parent = nullptr) | |
| QtFM::FmPatchValue * | generate(int category, int seed, int chip = 0) const |
| QtFM::FmPatchValue * | fromJson(const QString &json) const |
| QtFM::FmPatchValue * | mutated(QtFM::FmPatchValue *patch, double amount, int seed) const |
| bool | fitsChip(QtFM::FmPatchValue *patch, int chip) const |
Detailed Description
FmSound { patch: FmPatch.generate(FmPatch.Laser, 7) }
Differences from Qt
The patches it returns are FmPatchValue objects, owned by the script engine.
Member Type Documentation
enum QtFM::FmPatch::Category
The categories of generate(), as QtFM::Category.
| Constant | Description |
|---|---|
QtFM::FmPatch::Pickup | A coin or pick-up. |
QtFM::FmPatch::Laser | A laser. |
QtFM::FmPatch::Explosion | An explosion. |
QtFM::FmPatch::PowerUp | A power-up. |
QtFM::FmPatch::Hit | A hit. |
QtFM::FmPatch::Jump | A jump. |
QtFM::FmPatch::Blip | A user-interface blip. |
QtFM::FmPatch::Alarm | An alarm. |
QtFM::FmPatch::Engine | A looping engine hum. |
Member Function Documentation
QtFM::FmPatch::FmPatch(QObject *parent = nullptr)
Constructs the factory with parent.
bool QtFM::FmPatch::fitsChip(QtFM::FmPatchValue *patch, int chip) const
Returns true if patch fits the limits of chip.
QtFM::FmPatchValue * QtFM::FmPatch::fromJson(const QString &json) const
Returns the patch in the JSON text json; it is not FmPatchValue::valid if the text is not a patch.
QtFM::FmPatchValue * QtFM::FmPatch::generate(int category, int seed, int chip = 0) const
Returns a patch of category generated from seed, within the limits of chip (an FmChip value; FmChip.None for the native engine).
See also QtFM::Patch::generate().
QtFM::FmPatchValue * QtFM::FmPatch::mutated(QtFM::FmPatchValue *patch, double amount, int seed) const
Returns a variation of patch by up to amount, drawn from seed.
See also QtFM::Patch::mutated().