15class PluginDescriptorList :
public QAbstractListModel
23 class KnownPluginListChangeListener final :
public juce::ChangeListener
26 using CallbackFunc = std::function<void (juce::ChangeBroadcaster *)>;
28 KnownPluginListChangeListener (CallbackFunc callback);
31 void changeListenerCallback (juce::ChangeBroadcaster * source)
override
37 CallbackFunc callback_;
41 explicit PluginDescriptorList (
42 std::shared_ptr<juce::KnownPluginList> known_plugin_list,
43 QObject * parent =
nullptr);
45 enum PluginDescriptorRole
47 DescriptorRole = Qt::UserRole + 1,
51 QHash<int, QByteArray> roleNames ()
const override;
54 index (
int row,
int column,
const QModelIndex &parent = QModelIndex ())
57 QModelIndex parent (
const QModelIndex &child)
const override;
59 int rowCount (
const QModelIndex &parent = QModelIndex ())
const override;
61 int columnCount (
const QModelIndex &parent = QModelIndex ())
const override;
64 data (
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
74 void schedule_update_cache ();
77 KnownPluginListChangeListener known_plugin_list_change_listener_;
78 std::shared_ptr<juce::KnownPluginList> known_plugin_list_;
79 std::vector<utils::QObjectUniquePtr<PluginDescriptor>> cached_descriptors_;