Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Add timeline cursor snapping on clip resize

parent cef6fc54
Pipeline #1540 failed with stage
in 10 minutes and 8 seconds
......@@ -659,6 +659,42 @@ Mlt::Profile *Core::thumbProfile()
return m_thumbProfile.get();
}
void Core::clearSelection()
{
if (m_mainWindow && m_guiConstructed) {
m_mainWindow->getCurrentTimeline()->controller()->clearSelection();
}
}
void Core::selectItem(int itemId)
{
if (m_mainWindow && m_guiConstructed) {
m_mainWindow->getCurrentTimeline()->controller()->addSelection(itemId, true);
}
}
int Core::getTimelinePosition() const
{
if (m_mainWindow && m_guiConstructed) {
return m_mainWindow->getCurrentTimeline()->controller()->timelinePosition();
}
return 0;
}
bool Core::isSelected(int itemId) const
{
if (m_mainWindow && m_guiConstructed) {
return m_mainWindow->getCurrentTimeline()->controller()->selection().contains(itemId);
}
return false;
}
void Core::removeFromSelection(int itemId)
{
if (m_mainWindow && m_guiConstructed) {
m_mainWindow->getCurrentTimeline()->controller()->removeSelection(itemId);
}
}
void Core::triggerAction(const QString &name)
{
......
......@@ -178,6 +178,8 @@ public:
int projectDuration() const;
/** @brief Returns true if current project has some rendered timeline preview */
bool hasTimelinePreview() const;
/** @brief Returns current timeline cursor position */
int getTimelinePosition() const;
/** @brief Handles audio and video capture **/
void startMediaCapture(bool, bool, QUrl, QString);
void stopMediaCapture(bool, bool);
......
......@@ -1509,7 +1509,10 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
size = out - getTrackById_const(trackId)->getBlankStart(in - 1);
}
}
int timelinePos = pCore->getTimelinePosition();
m_snaps->addPoint(timelinePos);
int proposed_size = m_snaps->proposeSize(in, out, size, right, snapDistance);
m_snaps->removePoint(timelinePos);
if (proposed_size > 0) {
// only test move if proposed_size is valid
bool success = false;
......
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