Commit 03c8c0bd authored by Julius Künzel's avatar Julius Künzel
Browse files

Merge branch 'refs/heads/release/21.12'

parents 3eee3d5c 9d3a7c6e
Pipeline #123598 passed with stage
in 6 minutes and 38 seconds
......@@ -1652,11 +1652,13 @@ void MainWindow::setupActions()
act = addAction(QStringLiteral("edit_item_speed"), i18n("Change Speed"), this, SLOT(slotEditItemSpeed()),
QIcon::fromTheme(QStringLiteral("speedometer")), QKeySequence(), clipActionCategory);
// "Q" as data means this action should only be available if the item is not endless and has no time remap
act->setData('Q');
act->setEnabled(false);
act = addAction(QStringLiteral("edit_item_remap"), i18n("Time Remap"), this, SLOT(slotRemapItemTime()),
QIcon::fromTheme(QStringLiteral("speedometer")), QKeySequence(), clipActionCategory);
// "C" as data means this action should only be available for clips - not for compositions
// "R" as data means this action should only be available if the item is not endless and has no speed effect
act->setData('R');
act->setCheckable(true);
act->setEnabled(false);
......
......@@ -2612,6 +2612,7 @@ void TimelineController::remapItemTime(int clipId)
// Add remap effect
emit pCore->remapClip(clipId);
}
updateClipActions();
}
void TimelineController::changeItemSpeed(int clipId, double speed)
......@@ -2654,7 +2655,10 @@ void TimelineController::changeItemSpeed(int clipId, double speed)
pitchCompensate = d->getPitchCompensate();
qDebug() << "requesting speed " << speed;
}
m_model->requestClipTimeWarp(clipId, speed, pitchCompensate, true);
bool res = m_model->requestClipTimeWarp(clipId, speed, pitchCompensate, true);
if (res) {
updateClipActions();
}
}
void TimelineController::switchCompositing(int mode)
......@@ -3783,11 +3787,16 @@ void TimelineController::updateClipActions()
// Position actions should stay enabled in clip monitor
enableAction = true;
} else if (actionData == QLatin1Char('R')) {
// Time remap action
enableAction = clip != nullptr && type != ClipType::Color && type != ClipType::Image;
// Time remap action
enableAction = clip != nullptr && type != ClipType::Color && type != ClipType::Image
&& qFuzzyCompare(1., m_model->m_allClips[item]->getSpeed());
if (enableAction) {
act->setChecked(clip->isChain());
}
} else if (actionData == QLatin1Char('Q')) {
// Speed change action
enableAction = clip != nullptr && type != ClipType::Color && type != ClipType::Image
&& !clip->isChain();
}
act->setEnabled(enableAction);
}
......
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