21#include <MltProducer.h>
22#include <QAbstractItemModel>
39class MarkersModel :
public QAbstractItemModel
42 Q_PROPERTY(QStringList recentColors READ recentColors NOTIFY recentColorsChanged)
46 TextRole = Qt::UserRole + 1,
52 explicit MarkersModel(QObject *parent = 0);
53 virtual ~MarkersModel();
55 void load(Mlt::Producer *producer);
56 Markers::Marker getMarker(
int markerIndex);
57 int uniqueKey()
const;
58 int markerIndexForPosition(
int position);
59 int markerIndexForRange(
int start,
int end);
60 int rangeMarkerIndexForPosition(
int position);
61 Q_INVOKABLE
int nextMarkerPosition(
int position);
62 Q_INVOKABLE
int prevMarkerPosition(
int position);
63 QModelIndex modelIndexForRow(
int row);
64 QMap<int, QString> ranges();
65 QStringList recentColors();
66 QList<Markers::Marker> getMarkers()
const;
67 QList<QColor> allColors()
const;
70 void doRemove(
int markerIndex);
71 void doInsert(
int markerIndex,
const Markers::Marker &marker);
72 void doAppend(
const Markers::Marker &marker);
73 void doUpdate(
int markerIndex,
const Markers::Marker &marker);
75 void doReplace(QList<Markers::Marker> &markers);
76 void doShift(
int shiftPosition,
int shiftAmount);
81 void recentColorsChanged();
84 void remove(
int markerIndex);
85 void append(
const Markers::Marker &marker);
86 void update(
int markerIndex,
const Markers::Marker &marker);
87 void move(
int markerIndex,
int start,
int end);
88 void setColor(
int markerIndex,
const QColor &color);
93 int rowCount(
const QModelIndex &parent)
const;
94 int columnCount(
const QModelIndex &parent)
const;
95 QVariant data(
const QModelIndex &index,
int role)
const;
96 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
97 QModelIndex index(
int row,
int column = 0,
const QModelIndex &parent = QModelIndex())
const;
98 QModelIndex parent(
const QModelIndex &index)
const;
99 QHash<int, QByteArray> roleNames()
const;
102 int markerCount()
const;
103 int keyIndex(
int key)
const;
104 Mlt::Properties *getMarkerProperties(
int markerIndex);
105 void updateRecentColors(
const QColor &color);
107 Mlt::Producer *m_producer;
109 QMap<QRgb, QString> m_recentColors;