21#include <MltProducer.h>
23#include <QAbstractItemModel>
40class MarkersModel :
public QAbstractItemModel
43 Q_PROPERTY(QStringList recentColors READ recentColors NOTIFY recentColorsChanged)
48 TextRole = Qt::UserRole + 1,
54 explicit MarkersModel(QObject *parent = 0);
55 virtual ~MarkersModel();
57 void load(Mlt::Producer *producer);
58 Markers::Marker getMarker(
int markerIndex);
59 int uniqueKey()
const;
60 int markerIndexForPosition(
int position);
61 int markerIndexForRange(
int start,
int end);
62 int rangeMarkerIndexForPosition(
int position);
63 Q_INVOKABLE
int nextMarkerPosition(
int position);
64 Q_INVOKABLE
int prevMarkerPosition(
int position);
65 QModelIndex modelIndexForRow(
int row);
66 QMap<int, QString> ranges();
67 QStringList recentColors();
68 QList<Markers::Marker> getMarkers()
const;
69 QList<QColor> allColors()
const;
72 void doRemove(
int markerIndex);
73 void doInsert(
int markerIndex,
const Markers::Marker &marker);
74 void doAppend(
const Markers::Marker &marker);
75 void doUpdate(
int markerIndex,
const Markers::Marker &marker);
77 void doReplace(QList<Markers::Marker> &markers);
78 void doShift(
int shiftPosition,
int shiftAmount);
83 void recentColorsChanged();
86 void remove(
int markerIndex);
87 void append(
const Markers::Marker &marker);
88 void update(
int markerIndex,
const Markers::Marker &marker);
89 void move(
int markerIndex,
int start,
int end);
90 void setColor(
int markerIndex,
const QColor &color);
95 int rowCount(
const QModelIndex &parent)
const;
96 int columnCount(
const QModelIndex &parent)
const;
97 QVariant data(
const QModelIndex &index,
int role)
const;
98 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
99 QModelIndex index(
int row,
int column = 0,
const QModelIndex &parent = QModelIndex())
const;
100 QModelIndex parent(
const QModelIndex &index)
const;
101 QHash<int, QByteArray> roleNames()
const;
104 int markerCount()
const;
105 int keyIndex(
int key)
const;
106 Mlt::Properties *getMarkerProperties(
int markerIndex);
107 void updateRecentColors(
const QColor &color);
109 Mlt::Producer *m_producer;
111 QMap<QRgb, QString> m_recentColors;