12class ChordPresetPack :
public QObject
15 Q_PROPERTY (QString name READ getName WRITE setName NOTIFY nameChanged)
19 using NameT = QString;
20 ChordPresetPack (QObject * parent =
nullptr);
24 QObject * parent =
nullptr);
30 QString getName ()
const {
return name_; }
31 void setName (
const QString &name);
32 Q_SIGNAL
void nameChanged (
const QString &name);
36 std::string get_document_type ()
const {
return "Zrythm Chord Preset Pack"; }
37 int get_format_major_version ()
const {
return 2; }
38 int get_format_minor_version ()
const {
return 0; }
40 friend void init_from (
42 const ChordPresetPack &other,
45 bool contains_name (
const NameT &name)
const;
47 bool contains_preset (
const ChordPreset &pset)
const;
53 int get_preset_index (
const ChordPreset &pset)
const;
58 static constexpr std::string_view kNameKey =
"name";
59 static constexpr std::string_view kPresetsKey =
"presets";
60 static constexpr std::string_view kIsStandardKey =
"isStandard";
61 friend void to_json (nlohmann::json &j,
const ChordPresetPack &pack);
62 friend void from_json (
const nlohmann::json &j, ChordPresetPack &pack);