18#ifndef METADATAMODEL_H
19#define METADATAMODEL_H
21#include <QAbstractListModel>
26class MetadataModel :
public QAbstractListModel
29 Q_ENUMS(MetadataFilter)
30 Q_PROPERTY(MetadataFilter filter READ filter WRITE setFilter NOTIFY filterChanged)
31 Q_PROPERTY(QString search READ search WRITE setSearch NOTIFY searchChanged)
36 NameRole = Qt::UserRole + 1,
57 HiddenMaskBit = 1 << 0,
58 clipOnlyMaskBit = 1 << 1,
59 gpuIncompatibleMaskBit = 1 << 2,
60 gpuAlternativeMaskBit = 1 << 3,
61 needsGPUMaskBit = 1 << 4,
63 trackOnlyMaskBit = 1 << 6,
64 outputOnlyMaskBit = 1 << 7,
67 explicit MetadataModel(QObject *parent = 0);
70 Q_INVOKABLE
int rowCount(
const QModelIndex &parent = QModelIndex())
const;
71 QVariant data(
const QModelIndex &index,
int role)
const;
72 bool setData(
const QModelIndex &index,
const QVariant &value,
int role);
73 QHash<int, QByteArray> roleNames()
const;
74 Qt::ItemFlags flags(
const QModelIndex &index)
const;
77 void add(QmlMetadata *data);
78 Q_INVOKABLE QmlMetadata *get(
int index)
const;
79 MetadataFilter filter()
const
83 void setFilter(MetadataFilter);
84 QString search()
const
88 void setSearch(
const QString &search);
89 Q_INVOKABLE
bool isVisible(
int row)
const;
90 void updateFilterMask(
bool isClipProducer,
bool isChainProducer,
bool isTrackProducer,
91 bool isOutputProducer);
92 Q_INVOKABLE
void saveFilterSet(
const QString &name);
93 Q_INVOKABLE
void deleteFilterSet(
const QString &name);
100 typedef QList<QmlMetadata *> MetadataList;
102 MetadataFilter m_filter;
103 bool m_isClipProducer;
104 bool m_isChainProducer;
105 bool m_isTrackProducer;
106 bool m_isOutputProducer;
108 unsigned m_filterMask;
110 unsigned computeFilterMask(
const QmlMetadata *meta);