Commit 570e524b authored by Sashmita Raghav's avatar Sashmita Raghav Committed by Jean-Baptiste Mardelle

Add proxy icon to clips in timeline

parent c2325f34
......@@ -190,6 +190,7 @@ QHash<int, QByteArray> TimelineItemModel::roleNames() const
QHash<int, QByteArray> roles;
roles[NameRole] = "name";
roles[ResourceRole] = "resource";
roles[IsProxyRole] = "isProxy";
roles[ServiceRole] = "mlt_service";
roles[BinIdRole] = "binId";
roles[TrackIdRole] = "trackId";
......@@ -269,6 +270,10 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
}
return result;
}
case IsProxyRole: {
QString proxy = clip->getProperty("kdenlive:proxy");
return proxy.size() > 2;
}
case FakeTrackIdRole:
return clip->getFakeTrackId();
case FakePositionRole:
......
......@@ -114,6 +114,7 @@ public:
enum {
NameRole = Qt::UserRole + 1,
ResourceRole, /// clip only
IsProxyRole, /// clip only
ServiceRole, /// clip only
StartRole, /// clip only
BinIdRole, /// clip only
......
......@@ -31,6 +31,7 @@ Rectangle {
property string clipResource: ''
property string mltService: ''
property string effectNames
property bool isProxy: false
property int modelStart
property real scrollX: 0
property int inPoint: 0
......@@ -663,6 +664,33 @@ Rectangle {
styleColor: 'black'
}
}
Rectangle{
//proxy
id:proxyRect
color: 'yellow'
width: labelRect.height
height: labelRect.height
x: labelRect.x
anchors.top: labelRect.top
anchors.left: labelRect.right
visible: clipRoot.isProxy && !clipRoot.isAudio
Text {
// Proxy P
id: proxyLabel
text: "P"
font.pointSize: root.fontUnit +1
visible: proxyRect.visible
anchors {
top: proxyRect.top
left: proxyRect.left
leftMargin: (labelRect.height-proxyLabel.width)/2
topMargin: (labelRect.height-proxyLabel.height)/2
}
color: 'black'
styleColor: 'black'
}
}
}
KeyframeView {
......
......@@ -188,6 +188,12 @@ Item{
value: model.resource
when: loader.status == Loader.Ready && isClip(model.clipType)
}
Binding {
target: loader.item
property: "isProxy"
value: model.isProxy
when: loader.status == Loader.Ready && isClip(model.clipType)
}
Binding {
target: loader.item
property: "maxDuration"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment