6.0.0-rc4Source

QtFM::FmPatch Class

The FmPatch singleton makes patches: generated, parsed or mutated. 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 Types

enumCategory

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
boolfitsChip(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.

ConstantDescription
QtFM::FmPatch::PickupA coin or pick-up.
QtFM::FmPatch::LaserA laser.
QtFM::FmPatch::ExplosionAn explosion.
QtFM::FmPatch::PowerUpA power-up.
QtFM::FmPatch::HitA hit.
QtFM::FmPatch::JumpA jump.
QtFM::FmPatch::BlipA user-interface blip.
QtFM::FmPatch::AlarmAn alarm.
QtFM::FmPatch::EngineA looping engine hum.

Member Function Documentation

[explicit] 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().