19class ChordSuggestionProvider :
public QObject
26 setCurrentChord NOTIFY currentChordChanged)
29 setCurrentScale NOTIFY currentScaleChanged)
31 bool includeSevenths READ includeSevenths WRITE setIncludeSevenths NOTIFY
34 bool includeSecondaryDominants READ includeSecondaryDominants WRITE
35 setIncludeSecondaryDominants NOTIFY categoriesChanged)
37 bool includeBorrowedChords READ includeBorrowedChords WRITE
38 setIncludeBorrowedChords NOTIFY categoriesChanged)
40 QVariantList topSuggestions READ topSuggestions NOTIFY suggestionsChanged)
42 int maxSuggestions READ maxSuggestions WRITE setMaxSuggestions NOTIFY
43 maxSuggestionsChanged)
46 explicit ChordSuggestionProvider (QObject * parent =
nullptr);
48 zrythm::dsp::ChordDescriptor * currentChord ()
const
50 return current_chord_.data ();
62 return current_scale_.data ();
66 bool includeSevenths ()
const {
return include_sevenths_; }
67 void setIncludeSevenths (
bool v);
69 bool includeSecondaryDominants ()
const
71 return include_secondary_dominants_;
73 void setIncludeSecondaryDominants (
bool v);
75 bool includeBorrowedChords ()
const {
return include_borrowed_chords_; }
76 void setIncludeBorrowedChords (
bool v);
78 QVariantList topSuggestions ()
const {
return top_suggestions_; }
80 int maxSuggestions ()
const {
return max_suggestions_; }
81 void setMaxSuggestions (
int v);
83 Q_INVOKABLE
float scoreForChord (zrythm::dsp::ChordDescriptor * chord)
const;
85 Q_SIGNAL
void currentChordChanged ();
86 Q_SIGNAL
void currentScaleChanged ();
87 Q_SIGNAL
void categoriesChanged ();
88 Q_SIGNAL
void suggestionsChanged ();
89 Q_SIGNAL
void maxSuggestionsChanged ();
94 QPointer<zrythm::dsp::ChordDescriptor> current_chord_;
95 QPointer<zrythm::dsp::MusicalScale> current_scale_;
96 bool include_sevenths_ =
false;
97 bool include_secondary_dominants_ =
false;
98 bool include_borrowed_chords_ =
false;
100 std::vector<zrythm::dsp::chords::ChordSuggestion> cached_suggestions_;
101 QVariantList top_suggestions_;
102 int max_suggestions_ = 5;
103 QTimer auto_clear_timer_;