Allow shortcut for change speed action.

Fixes #201
parent 28633d7a
......@@ -330,12 +330,6 @@ ObjectId AssetPanel::effectStackOwner()
return m_effectStackWidget->stackOwner();
}
void AssetPanel::parameterChanged(QString name, int value)
{
Q_UNUSED(name)
emit changeSpeed(value);
}
bool AssetPanel::addEffect(const QString &effectId)
{
if (!m_effectStackWidget->isVisible()) {
......
......@@ -69,7 +69,6 @@ public:
public slots:
/** @brief Clear panel if displaying itemId */
void clearAssetPanel(int itemId);
void parameterChanged(QString name, int value);
void deleteCurrentEffect();
protected:
......@@ -98,7 +97,6 @@ signals:
void doSplitEffect(bool);
void doSplitBinEffect(bool);
void seekToPos(int);
void changeSpeed(int);
void reloadEffect(const QString &path);
};
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="159" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="160" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="dvd_wizard" />
......@@ -103,6 +103,7 @@
<Action name="cut_timeline_clip" />
<Action name="delete_timeline_clip" />
<Action name="edit_item_duration" />
<Action name="edit_item_speed" />
<Action name="clip_split" />
<Action name="clip_disable" />
<Action name="clip_in_project_tree" />
......
......@@ -306,7 +306,6 @@ void MainWindow::init()
m_effectStackDock = addDock(i18n("Properties"), QStringLiteral("effect_stack"), m_assetPanel);
connect(m_assetPanel, &AssetPanel::doSplitEffect, m_projectMonitor, &Monitor::slotSwitchCompare);
connect(m_assetPanel, &AssetPanel::doSplitBinEffect, m_clipMonitor, &Monitor::slotSwitchCompare);
connect(m_assetPanel, &AssetPanel::changeSpeed, this, &MainWindow::slotChangeSpeed);
connect(m_timelineTabs, &TimelineTabs::showTransitionModel, m_assetPanel, &AssetPanel::showTransition);
connect(m_timelineTabs, &TimelineTabs::showTransitionModel, [&] () {
m_effectStackDock->raise();
......@@ -1285,6 +1284,10 @@ void MainWindow::setupActions()
QIcon::fromTheme(QStringLiteral("measure")), QKeySequence(), clipActionCategory);
act->setEnabled(false);
act = addAction(QStringLiteral("edit_item_speed"), i18n("Change Speed"), this, SLOT(slotEditItemSpeed()),
QIcon::fromTheme(QStringLiteral("speedometer")), QKeySequence(), clipActionCategory);
act->setEnabled(false);
act = addAction(QStringLiteral("clip_in_project_tree"), i18n("Clip in Project Bin"), this, SLOT(slotClipInProjectTree()),
QIcon::fromTheme(QStringLiteral("go-jump-definition")), QKeySequence(), clipActionCategory);
act->setEnabled(false);
......@@ -3739,12 +3742,11 @@ void MainWindow::resetTimelineTracks()
}
}
void MainWindow::slotChangeSpeed(int speed)
void MainWindow::slotEditItemSpeed()
{
ObjectId owner = m_assetPanel->effectStackOwner();
// TODO: manage bin clips / tracks
if (owner.first == ObjectType::TimelineClip) {
getCurrentTimeline()->controller()->changeItemSpeed(owner.second, speed);
TimelineWidget *current = getCurrentTimeline();
if (current) {
current->controller()->changeItemSpeed(-1, -1);
}
}
......
......@@ -465,7 +465,7 @@ private slots:
void setTrimMode(const QString &mode);
/** @brief Set timeline toolbar icon size. */
void setTimelineToolbarIconSize(QAction *a);
void slotChangeSpeed(int speed);
void slotEditItemSpeed();
void updateAction();
/** @brief Request adjust of timeline track height */
void resetTimelineTracks();
......
......@@ -1442,6 +1442,13 @@ void TimelineController::invalidateZone(int in, int out)
void TimelineController::changeItemSpeed(int clipId, double speed)
{
if (clipId == -1) {
clipId = getMainSelectedItem(false, true);
}
if (clipId == -1) {
pCore->displayMessage(i18n("No item to edit"), InformationMessage, 500);
return;
}
if (qFuzzyCompare(speed, -1)) {
speed = 100 * m_model->getClipSpeed(clipId);
double duration = m_model->getItemPlaytime(clipId);
......
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