Zrythm v2.0.0-alpha.1+31.4967fd053471
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ChordPresetManager Class Reference

Flat list model of all chord presets (built-in + user). More...

#include <src/gui/backend/chord_preset_manager.h>

Inheritance diagram for ChordPresetManager:
Collaboration diagram for ChordPresetManager:

Public Types

enum  Roles { PresetRole = Qt::UserRole + 1 , NameRole , CategoryRole , IsBuiltinRole }

Public Member Functions

 ChordPresetManager (QObject *parent=nullptr)
QHash< int, QByteArray > roleNames () const override
int rowCount (const QModelIndex &parent={}) const override
QVariant data (const QModelIndex &index, int role) const override
Q_INVOKABLE QStringList categories () const
Q_INVOKABLE QVariantList presetsInCategory (const QString &category) const
void load_user_presets ()

Detailed Description

Flat list model of all chord presets (built-in + user).

Replaces the old ChordPresetPack + ChordPresetPackManager hierarchy. Each preset has a category_ string for grouping (e.g., "Pop", "J-Rock"). Built-in presets are created at startup; user presets are loaded from JSON.

QML usage:

Repeater {
model: presetManager.categories()
delegate: Menu {
title: modelData
Repeater {
model: presetManager.presetsInCategory(modelData)
delegate: MenuItem {
text: modelData.name
onTriggered: padOp.applyPreset(modelData)
}
}
}
}

Definition at line 37 of file chord_preset_manager.h.

Member Enumeration Documentation

◆ Roles

enum ChordPresetManager::Roles

Definition at line 44 of file chord_preset_manager.h.


The documentation for this class was generated from the following file: