summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f24c4ea)
when dealing with multitracks and different tools it is handy beeing
able to align the playhead to mouse position by pressing a key.
hopefully now all kde scm/qm rules are satisfied for pushing
+void CustomTrackView::slotOnPlayheadKeyPressed()
+{
+ /* get curser point ref in screen coord */
+ QPoint ps = QCursor::pos();
+ /* get xPos in scene coord */
+ int mappedXPos = qMax((int)(mapToScene(mapFromGlobal(ps)).x() + 0.5), 0);
+ /* move playhead to new xPos*/
+ seekCursorPos(mappedXPos);
+}
// virtual
void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
// virtual
void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
/** @brief Get effect parameters ready for MLT*/
static void adjustEffectParameters(EffectsParameterList ¶meters, QDomNodeList params, MltVideoProfile profile, const QString &prefix = QString());
/** @brief Get effect parameters ready for MLT*/
static void adjustEffectParameters(EffectsParameterList ¶meters, QDomNodeList params, MltVideoProfile profile, const QString &prefix = QString());
+ /** @brief Move playhead to mouse curser position if p key is pressed */
+ void slotOnPlayheadKeyPressed();
protected:
virtual void drawBackground(QPainter * painter, const QRectF & rect);
protected:
virtual void drawBackground(QPainter * painter, const QRectF & rect);
collection.addAction("delete_timeline_clip", deleteItem);
connect(deleteItem, SIGNAL(triggered(bool)), this, SLOT(slotDeleteItem()));
collection.addAction("delete_timeline_clip", deleteItem);
connect(deleteItem, SIGNAL(triggered(bool)), this, SLOT(slotDeleteItem()));
+ KAction* movePlayhead = new KAction(i18n("Move Playhead"), this);
+ movePlayhead->setShortcut(Qt::Key_P);
+ collection.addAction("move_playhead", movePlayhead);
+ connect(movePlayhead, SIGNAL(triggered(bool)), this, SLOT(slotOnPlayheadKeyPressed()));
+
/*KAction* editTimelineClipSpeed = new KAction(i18n("Change Clip Speed"), this);
collection.addAction("change_clip_speed", editTimelineClipSpeed);
editTimelineClipSpeed->setData("change_speed");
/*KAction* editTimelineClipSpeed = new KAction(i18n("Change Clip Speed"), this);
collection.addAction("change_clip_speed", editTimelineClipSpeed);
editTimelineClipSpeed->setData("change_speed");
+void MainWindow::slotOnPlayheadKeyPressed()
+{
+ m_activeTimeline->projectView()->slotOnPlayheadKeyPressed();
+}
#include "mainwindow.moc"
#include "mainwindow.moc"
void slotSaveTimelineClip();
/** @brief Process keyframe data sent from a clip to effect / transition stack. */
void slotProcessImportKeyframes(GRAPHICSRECTITEM type, const QString& data);
void slotSaveTimelineClip();
/** @brief Process keyframe data sent from a clip to effect / transition stack. */
void slotProcessImportKeyframes(GRAPHICSRECTITEM type, const QString& data);
+ /** @brief Move playhead to mouse curser position if p key is pressed */
+ void slotOnPlayheadKeyPressed();
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);