+void CustomTrackView::slotDeleteClipMarker() {
+ QList<QGraphicsItem *> itemList = scene()->selectedItems();
+ if (itemList.count() != 1) {
+ kDebug() << "// CANNOT DELETE MARKER IF MORE TAN ONE CLIP IS SELECTED....";
+ return;
+ }
+ AbstractClipItem *item = (AbstractClipItem *)itemList.at(0);
+ if (item->type() != AVWIDGET) return;
+ GenTime pos = GenTime(m_cursorPos, m_document->fps());
+ if (item->startPos() > pos || item->endPos() < pos) return;
+ ClipItem *clip = (ClipItem *) item;
+ int id = clip->baseClip()->getId();
+ GenTime position = pos - item->startPos() + item->cropStart();
+ QString comment = clip->baseClip()->markerComment(position);
+ if (comment.isEmpty()) return;
+ AddMarkerCommand *command = new AddMarkerCommand(this, comment, QString(), id, position, true);
+ m_commandStack->push(command);
+}
+
+void CustomTrackView::slotEditClipMarker() {
+ QList<QGraphicsItem *> itemList = scene()->selectedItems();
+ if (itemList.count() != 1) {
+ kDebug() << "// CANNOT DELETE MARKER IF MORE TAN ONE CLIP IS SELECTED....";
+ return;
+ }
+ AbstractClipItem *item = (AbstractClipItem *)itemList.at(0);
+ if (item->type() != AVWIDGET) return;
+ GenTime pos = GenTime(m_cursorPos, m_document->fps());
+ if (item->startPos() > pos || item->endPos() < pos) return;
+ ClipItem *clip = (ClipItem *) item;
+ int id = clip->baseClip()->getId();
+ GenTime position = pos - item->startPos() + item->cropStart();
+ QString oldcomment = clip->baseClip()->markerComment(position);
+ if (oldcomment.isEmpty()) return;
+ QString comment = QInputDialog::getText(this, i18n("Add Marker"), i18n("Enter text for marker on clip <b>%1</b>", clip->clipName()), QLineEdit::Normal, oldcomment);
+ if (comment.isEmpty()) return;
+ AddMarkerCommand *command = new AddMarkerCommand(this, oldcomment, comment, id, position, true);
+ m_commandStack->push(command);
+}
+