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,
66 explicit MetadataModel(QObject *parent = 0);
69 Q_INVOKABLE
int rowCount(
const QModelIndex &parent = QModelIndex())
const;
70 QVariant data(
const QModelIndex &index,
int role)
const;
71 bool setData(
const QModelIndex &index,
const QVariant &value,
int role);
72 QHash<int, QByteArray> roleNames()
const;
73 Qt::ItemFlags flags(
const QModelIndex &index)
const;
76 void add(QmlMetadata *data);
77 Q_INVOKABLE QmlMetadata *get(
int index)
const;
78 MetadataFilter filter()
const
82 void setFilter(MetadataFilter);
83 QString search()
const
87 void setSearch(
const QString &search);
88 Q_INVOKABLE
bool isVisible(
int row)
const;
89 void updateFilterMask(
bool isClipProducer,
bool isChainProducer,
bool isTrackProducer);
90 Q_INVOKABLE
void saveFilterSet(
const QString &name);
91 Q_INVOKABLE
void deleteFilterSet(
const QString &name);
98 typedef QList<QmlMetadata *> MetadataList;
100 MetadataFilter m_filter;
101 bool m_isClipProducer;
102 bool m_isChainProducer;
103 bool m_isTrackProducer;
105 unsigned m_filterMask;
107 unsigned computeFilterMask(
const QmlMetadata *meta);