MCPcopy Create free account
hub / github.com/KDE/kdenlive / slotInsertTimecode

Method slotInsertTimecode

src/project/notesplugin.cpp:205–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void NotesPlugin::slotInsertTimecode()
206{
207 if (pCore->monitorManager()->isActive(Kdenlive::ClipMonitor)) {
208 // Add a note on the current bin clip
209 int frames = pCore->monitorManager()->clipMonitor()->position();
210 QString position = pCore->timecode().getTimecodeFromFrames(frames);
211 const QString binId = pCore->monitorManager()->clipMonitor()->activeClipId();
212 if (binId.isEmpty()) {
213 pCore->displayMessage(i18n("Cannot add note, no clip selected in project bin"), ErrorMessage);
214 return;
215 }
216 const QString clipName = pCore->bin()->getBinClipName(binId);
217 const QString uuid = pCore->projectItemModel()->getBinClipUuid(binId);
218 m_widget->insertHtml(QStringLiteral("<a href=\"%1#%2\">%3 %4</a> ").arg(uuid, QString::number(frames), clipName, position));
219 } else {
220 int frames = pCore->monitorManager()->projectMonitor()->position();
221 QString position = pCore->timecode().getTimecodeFromFrames(frames);
222 QPair<int, QString> currentTrackInfo = pCore->currentTrackInfo();
223 const QUuid uuid = pCore->currentTimelineId();
224 if (currentTrackInfo.first != -1) {
225 // Insert timeline position with track reference
226 m_widget->insertHtml(
227 QStringLiteral("<a href=\"%1!%2?%3\">%4 %5</a> ")
228 .arg(uuid.toString(), QString::number(frames), QString::number(currentTrackInfo.first), currentTrackInfo.second, position));
229 } else {
230 m_widget->insertHtml(QStringLiteral("<a href=\"%1!%2\">%3</a> ").arg(uuid.toString(), QString::number(frames), position));
231 }
232 }
233}
234
235void NotesPlugin::slotReAssign(const QStringList &anchors, const QList<QPoint> &points, QString binId, int offset)
236{

Callers

nothing calls this directly

Calls 15

monitorManagerMethod · 0.80
clipMonitorMethod · 0.80
getTimecodeFromFramesMethod · 0.80
activeClipIdMethod · 0.80
getBinClipNameMethod · 0.80
binMethod · 0.80
getBinClipUuidMethod · 0.80
projectItemModelMethod · 0.80
projectMonitorMethod · 0.80
currentTrackInfoMethod · 0.80
currentTimelineIdMethod · 0.80
isActiveMethod · 0.45

Tested by

no test coverage detected