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

home / end to go to start / end of clip, Ctrl+home/end to go to project start / end

svn path=/branches/KDE4/; revision=2295
parent 95265b50
......@@ -1460,6 +1460,7 @@ void CustomTrackView::slotSeekToPreviousSnap() {
}
}
setCursorPos((int) res.frames(m_document->fps()));
checkScrolling();
}
void CustomTrackView::slotSeekToNextSnap() {
......@@ -1473,6 +1474,31 @@ void CustomTrackView::slotSeekToNextSnap() {
}
}
setCursorPos((int) res.frames(m_document->fps()));
checkScrolling();
}
void CustomTrackView::clipStart() {
QList<QGraphicsItem *> itemList = scene()->selectedItems();
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *item = (ClipItem *) itemList.at(i);
setCursorPos((int) item->startPos().frames(m_document->fps()));
checkScrolling();
break;
}
}
}
void CustomTrackView::clipEnd() {
QList<QGraphicsItem *> itemList = scene()->selectedItems();
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *item = (ClipItem *) itemList.at(i);
setCursorPos((int) item->endPos().frames(m_document->fps()));
checkScrolling();
break;
}
}
}
void CustomTrackView::slotAddClipMarker() {
......
......@@ -89,6 +89,8 @@ public:
bool findNextString(const QString &text);
void initSearchStrings();
void clearSearchStrings();
void clipStart();
void clipEnd();
public slots:
void setCursorPos(int pos, bool seek = true);
......
......@@ -46,7 +46,18 @@
</Menu>
<Menu name="monitor" ><text>Monitor</text>
<Action name="monitor_play" />
</Menu>
<Separator />
<Action name="seek_start" />
<Action name="monitor_seek_snap_backward" />
<Action name="seek_clip_start" />
<Action name="monitor_seek_backward" />
<Action name="monitor_seek_backward-one-frame" />
<Action name="monitor_seek_forward-one-frame" />
<Action name="monitor_seek_forward" />
<Action name="seek_clip_end" />
<Action name="monitor_seek_snap_forward" />
<Action name="seek_end" />
</Menu>
<Menu name="settings" >
<Action name="manage_profiles" />
......
......@@ -548,6 +548,26 @@ void MainWindow::setupActions() {
actionCollection()->addAction("monitor_seek_forward", monitorSeekForward);
connect(monitorSeekForward, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotForward()));
KAction* clipStart = new KAction(KIcon("media-seek-backward"), i18n("Go to Clip Start"), this);
clipStart->setShortcut(Qt::Key_Home);
actionCollection()->addAction("seek_clip_start", clipStart);
connect(clipStart, SIGNAL(triggered(bool)), this, SLOT(slotClipStart()));
KAction* clipEnd = new KAction(KIcon("media-seek-forward"), i18n("Go to Clip End"), this);
clipEnd->setShortcut(Qt::Key_End);
actionCollection()->addAction("seek_clip_end", clipEnd);
connect(clipEnd, SIGNAL(triggered(bool)), this, SLOT(slotClipEnd()));
KAction* projectStart = new KAction(KIcon("media-seek-backward"), i18n("Go to Project Start"), this);
projectStart->setShortcut(Qt::CTRL + Qt::Key_Home);
actionCollection()->addAction("seek_start", projectStart);
connect(projectStart, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotStart()));
KAction* projectEnd = new KAction(KIcon("media-seek-forward"), i18n("Go to Project End"), this);
projectEnd->setShortcut(Qt::CTRL + Qt::Key_End);
actionCollection()->addAction("seek_end", projectEnd);
connect(projectEnd, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotEnd()));
KAction* monitorSeekForwardOneFrame = new KAction(KIcon("media-skip-forward"), i18n("Forward 1 Frame"), this);
monitorSeekForwardOneFrame->setShortcut(Qt::Key_Right);
actionCollection()->addAction("monitor_seek_forward-one-frame", monitorSeekForwardOneFrame);
......@@ -1174,6 +1194,20 @@ void MainWindow::slotSnapForward() {
}
}
void MainWindow::slotClipStart() {
if (m_monitorManager->projectMonitorFocused()) {
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
currentTab->projectView()->clipStart();
}
}
void MainWindow::slotClipEnd() {
if (m_monitorManager->projectMonitorFocused()) {
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
currentTab->projectView()->clipEnd();
}
}
void MainWindow::slotChangeTool(QAction * action) {
if (action == m_buttonSelectTool) slotSetTool(SELECTTOOL);
else if (action == m_buttonRazorTool) slotSetTool(RAZORTOOL);
......
......@@ -200,6 +200,8 @@ private slots:
void slotSetTool(PROJECTTOOL tool);
void slotSnapForward();
void slotSnapRewind();
void slotClipStart();
void slotClipEnd();
void slotFind();
void findTimeout();
void slotFindNext();
......
......@@ -168,6 +168,24 @@ void Monitor::slotSeek(int pos) {
m_timePos->setText(m_monitorManager->timecode().getTimecodeFromFrames(m_position));
}
void Monitor::slotStart() {
if (!m_isActive) m_monitorManager->activateMonitor(m_name);
render->play(0);
m_position = 0;
render->seekToFrame(m_position);
emit renderPosition(m_position);
m_timePos->setText(m_monitorManager->timecode().getTimecodeFromFrames(m_position));
}
void Monitor::slotEnd() {
if (!m_isActive) m_monitorManager->activateMonitor(m_name);
render->play(0);
m_position = render->getLength();
render->seekToFrame(m_position);
emit renderPosition(m_position);
m_timePos->setText(m_monitorManager->timecode().getTimecodeFromFrames(m_position));
}
void Monitor::slotRewind(double speed) {
if (!m_isActive) m_monitorManager->activateMonitor(m_name);
if (speed == 0) {
......
......@@ -98,6 +98,8 @@ public slots:
void slotRewindOneFrame();
void slotForwardOneFrame();
void saveSceneList(QString path, QDomElement info = QDomElement());
void slotStart();
void slotEnd();
signals:
void renderPosition(int);
......
......@@ -101,6 +101,16 @@ void MonitorManager::slotForwardOneFrame() {
else m_projectMonitor->slotForwardOneFrame();
}
void MonitorManager::slotStart() {
if (m_activeMonitor == "clip") m_clipMonitor->slotStart();
else m_projectMonitor->slotStart();
}
void MonitorManager::slotEnd() {
if (m_activeMonitor == "clip") m_clipMonitor->slotEnd();
else m_projectMonitor->slotEnd();
}
void MonitorManager::resetProfiles(QString prof) {
m_clipMonitor->resetProfile(prof);
m_projectMonitor->resetProfile(prof);
......
......@@ -45,6 +45,8 @@ public slots:
void slotForward(double speed = 0);
void slotRewindOneFrame();
void slotForwardOneFrame();
void slotStart();
void slotEnd();
private:
Monitor *m_clipMonitor;
......
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