Loading...
Searching...
No Matches
Library::ProcessesItemModel Class Reference
Inheritance diagram for Library::ProcessesItemModel:
TreeNodeBasedItemModel< ProcessNode > TreeModel

Public Member Functions

 ProcessesItemModel (const score::GUIApplicationContext &ctx, QObject *parent)
 
void rescan ()
 
QModelIndex find (const Process::ProcessModelFactory::ConcreteKey &k)
 
void publish (ProcessEntry &&entry)
 
void publish (ProcessEntry &&entry, uint64_t generation)
 
uint64_t generation () const noexcept
 The scan generation the model is currently accepting. Bumped by rescan().
 
void replaceChildren (const Process::ProcessModelFactory::ConcreteKey &key, std::vector< StagedNode > children)
 
void clearAnchorKey (const Process::ProcessModelFactory::ConcreteKey &key)
 
void flushPending ()
 Immediately publish everything still buffered. Mostly for tests.
 
ProcessNoderootNode () override
 
const ProcessNoderootNode () const override
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QStringList mimeTypes () const override
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
Qt::DropActions supportedDragActions () const override
 
void on_newPlugin (const score::InterfaceBase &fact)
 
- Public Member Functions inherited from TreeNodeBasedItemModel< ProcessNode >
 TreeNodeBasedItemModel (QObject *parent=nullptr)
 
ProcessNode & nodeFromModelIndex (const QModelIndex &index) const
 
QModelIndex parent (const QModelIndex &index) const final override
 
QModelIndex index (int row, int column, const QModelIndex &parent) const final override
 
int rowCount (const QModelIndex &parent) const final override
 
bool hasChildren (const QModelIndex &parent) const final override
 
- Public Member Functions inherited from TreeModel
template<typename F >
void iterate (const QModelIndex &idx, const F &f)
 idx: should be the root index of the view
 
QModelIndex convertPathToIndex (const TreePath &path) const
 

Additional Inherited Members

- Public Types inherited from TreeNodeBasedItemModel< ProcessNode >
using node_type = ProcessNode
 

Member Function Documentation

◆ clearAnchorKey()

void Library::ProcessesItemModel::clearAnchorKey ( const Process::ProcessModelFactory::ConcreteKey &  key)

Marks a process node as a pure container: plugin databases clear the anchor's key so only their per-plugin children are user-creatable.

◆ publish() [1/2]

void Library::ProcessesItemModel::publish ( ProcessEntry &&  entry)

Queue one scanned entry for publication into the tree. The only way the tree changes outside rescan()/replaceChildren(). Entries are buffered and flushed on a 0-timer; consecutive entries sharing the same anchor and category chain are inserted as one subtree / one ranged insert, so a folder scanned in one batch costs one rowsInserted. GUI thread only.

◆ publish() [2/2]

void Library::ProcessesItemModel::publish ( ProcessEntry &&  entry,
uint64_t  generation 
)

Same, from a scan whose generation was captured at rescan() time: entries from a scan that predates the current rescan are dropped.

◆ replaceChildren()

void Library::ProcessesItemModel::replaceChildren ( const Process::ProcessModelFactory::ConcreteKey &  key,
std::vector< StagedNode children 
)

Atomically replace the children of the process node identified by key with a staged forest, given in display order (each staged node's own children are name-sorted on insertion). For the plugin databases (LV2/CLAP/VST/VST3) whose content is recomputed wholesale. Emits exact remove/insert ranges — except during rescan()'s reset, where the whole model is already inside a reset envelope. GUI thread only.

◆ rootNode() [1/2]

const ProcessNode & Library::ProcessesItemModel::rootNode ( ) const
overridevirtual

◆ rootNode() [2/2]

ProcessNode & Library::ProcessesItemModel::rootNode ( )
overridevirtual

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