// 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;
+}
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);
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));