Commit 35a5c83d authored by Till Theato's avatar Till Theato
Browse files

Also show duration of group or selection the clip under the mouse is in in status bar:

http://www.kdenlive.org/mantis/view.php?id=1576

svn path=/trunk/kdenlive/; revision=4596
parent 6d5fa46d
......@@ -420,3 +420,24 @@ void AbstractGroupItem::clearResizeInfos()
// m_resizeInfos.clear() will crash in some cases for unknown reasons - ttill
m_resizeInfos = QList <ItemInfo>();
}
GenTime AbstractGroupItem::duration()
{
QList <QGraphicsItem *> children = childItems();
GenTime start = GenTime(-1.0);
GenTime end = GenTime();
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() != GROUPWIDGET) {
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
if (item) {
if (start < GenTime() || item->startPos() < start)
start = item->startPos();
if (item->endPos() > end)
end = item->endPos();
}
} else {
children << children.at(i)->childItems();
}
}
return end - start;
}
......@@ -52,6 +52,8 @@ public:
QList <ItemInfo> resizeInfos();
/** @brief Clears m_resizeInfos */
void clearResizeInfos();
/** @brief Gets the duration (length) of the group. */
GenTime duration();
protected:
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
......
......@@ -575,6 +575,18 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
QString message = ci->clipName() + i18n(":");
message.append(i18n(" Position:") + m_document->timecode().getDisplayTimecode(ci->info().startPos, KdenliveSettings::frametimecode()));
message.append(i18n(" Duration:") + m_document->timecode().getDisplayTimecode(ci->cropDuration(), KdenliveSettings::frametimecode()));
if (clip->parentItem() && clip->parentItem()->type() == GROUPWIDGET) {
AbstractGroupItem *parent = static_cast <AbstractGroupItem *>(clip->parentItem());
if (clip->parentItem() == m_selectionGroup)
message.append(i18n(" Selection duration:"));
else
message.append(i18n(" Group duration:"));
message.append(m_document->timecode().getDisplayTimecode(parent->duration(), KdenliveSettings::frametimecode()));
if (parent->parentItem() && parent->parentItem()->type() == GROUPWIDGET) {
AbstractGroupItem *parent2 = static_cast <AbstractGroupItem *>(parent->parentItem());
message.append(i18n(" Selection duration:") + m_document->timecode().getDisplayTimecode(parent2->duration(), KdenliveSettings::frametimecode()));
}
}
emit displayMessage(message, InformationMessage);
} else if (opMode == RESIZESTART) {
setCursor(KCursor("left_side", Qt::SizeHorCursor));
......
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