Changeset View
Changeset View
Standalone View
Standalone View
src/assets/view/widgets/animationwidget.cpp
Show First 20 Lines • Show All 1336 Lines • ▼ Show 20 Line(s) | 1333 | { | |||
---|---|---|---|---|---|
1337 | m_active = activate; | 1337 | m_active = activate; | ||
1338 | if (!m_spinX) { | 1338 | if (!m_spinX) { | ||
1339 | // No animated rect displayed in monitor, return | 1339 | // No animated rect displayed in monitor, return | ||
1340 | return; | 1340 | return; | ||
1341 | } | 1341 | } | ||
1342 | if (activate) { | 1342 | if (activate) { | ||
1343 | connect(m_monitor, &Monitor::effectChanged, this, &AnimationWidget::slotUpdateGeometryRect, Qt::UniqueConnection); | 1343 | connect(m_monitor, &Monitor::effectChanged, this, &AnimationWidget::slotUpdateGeometryRect, Qt::UniqueConnection); | ||
1344 | connect(m_monitor, &Monitor::effectPointsChanged, this, &AnimationWidget::slotUpdateCenters, Qt::UniqueConnection); | 1344 | connect(m_monitor, &Monitor::effectPointsChanged, this, &AnimationWidget::slotUpdateCenters, Qt::UniqueConnection); | ||
1345 | connect(m_monitor, &Monitor::opacityChanged, this, &AnimationWidget::slotUpdateOpacity, Qt::UniqueConnection); | ||||
1346 | connect(m_monitor, &Monitor::rotationChanged, this, &AnimationWidget::slotUpdateRotation, Qt::UniqueConnection); | ||||
1345 | connect(m_monitor, &Monitor::seekToKeyframe, this, &AnimationWidget::slotSeekToKeyframe, Qt::UniqueConnection); | 1347 | connect(m_monitor, &Monitor::seekToKeyframe, this, &AnimationWidget::slotSeekToKeyframe, Qt::UniqueConnection); | ||
1346 | connect(m_monitor, &Monitor::seekToNextKeyframe, this, &AnimationWidget::slotNext, Qt::UniqueConnection); | 1348 | connect(m_monitor, &Monitor::seekToNextKeyframe, this, &AnimationWidget::slotNext, Qt::UniqueConnection); | ||
1347 | connect(m_monitor, &Monitor::seekToPreviousKeyframe, this, &AnimationWidget::slotPrevious, Qt::UniqueConnection); | 1349 | connect(m_monitor, &Monitor::seekToPreviousKeyframe, this, &AnimationWidget::slotPrevious, Qt::UniqueConnection); | ||
1348 | connect(m_monitor, SIGNAL(addKeyframe()), this, SLOT(slotAddKeyframe()), Qt::UniqueConnection); | 1350 | connect(m_monitor, SIGNAL(addKeyframe()), this, SLOT(slotAddKeyframe()), Qt::UniqueConnection); | ||
1349 | connect(m_monitor, SIGNAL(deleteKeyframe()), this, SLOT(slotDeleteKeyframe()), Qt::UniqueConnection); | 1351 | connect(m_monitor, SIGNAL(deleteKeyframe()), this, SLOT(slotDeleteKeyframe()), Qt::UniqueConnection); | ||
1350 | int framePos = qBound<int>(0, m_monitor->position() - m_inPoint, m_timePos->maximum()); | 1352 | int framePos = qBound<int>(0, m_monitor->position() - m_inPoint, m_timePos->maximum()); | ||
1351 | slotPositionChanged(framePos, false); | 1353 | slotPositionChanged(framePos, false); | ||
1352 | double ratio = (double)m_spinWidth->value() / m_spinHeight->value(); | 1354 | double ratio = (double)m_spinWidth->value() / m_spinHeight->value(); | ||
1353 | if (m_frameSize.width() != m_monitorSize.width() || m_frameSize.height() != m_monitorSize.height()) { | 1355 | if (m_frameSize.width() != m_monitorSize.width() || m_frameSize.height() != m_monitorSize.height()) { | ||
1354 | // Source frame size different than project frame size, enable original size option accordingly | 1356 | // Source frame size different than project frame size, enable original size option accordingly | ||
1355 | bool isOriginalSize = | 1357 | bool isOriginalSize = | ||
1356 | qAbs((double)m_frameSize.width() / m_frameSize.height() - ratio) < qAbs((double)m_monitorSize.width() / m_monitorSize.height() - ratio); | 1358 | qAbs((double)m_frameSize.width() / m_frameSize.height() - ratio) < qAbs((double)m_monitorSize.width() / m_monitorSize.height() - ratio); | ||
1357 | if (isOriginalSize) { | 1359 | if (isOriginalSize) { | ||
1358 | m_originalSize->blockSignals(true); | 1360 | m_originalSize->blockSignals(true); | ||
1359 | m_originalSize->setChecked(true); | 1361 | m_originalSize->setChecked(true); | ||
1360 | m_originalSize->blockSignals(false); | 1362 | m_originalSize->blockSignals(false); | ||
1361 | } | 1363 | } | ||
1362 | } | 1364 | } | ||
1363 | } else { | 1365 | } else { | ||
1364 | disconnect(m_monitor, &Monitor::effectChanged, this, &AnimationWidget::slotUpdateGeometryRect); | 1366 | disconnect(m_monitor, &Monitor::effectChanged, this, &AnimationWidget::slotUpdateGeometryRect); | ||
1365 | disconnect(m_monitor, &Monitor::effectPointsChanged, this, &AnimationWidget::slotUpdateCenters); | 1367 | disconnect(m_monitor, &Monitor::effectPointsChanged, this, &AnimationWidget::slotUpdateCenters); | ||
1368 | disconnect(m_monitor, &Monitor::opacityChanged, this, &AnimationWidget::slotUpdateOpacity, Qt::UniqueConnection); | ||||
1369 | disconnect(m_monitor, &Monitor::rotationChanged, this, &AnimationWidget::slotUpdateRotation, Qt::UniqueConnection); | ||||
1366 | disconnect(m_monitor, SIGNAL(addKeyframe()), this, SLOT(slotAddKeyframe())); | 1370 | disconnect(m_monitor, SIGNAL(addKeyframe()), this, SLOT(slotAddKeyframe())); | ||
1367 | disconnect(m_monitor, SIGNAL(deleteKeyframe()), this, SLOT(slotDeleteKeyframe())); | 1371 | disconnect(m_monitor, SIGNAL(deleteKeyframe()), this, SLOT(slotDeleteKeyframe())); | ||
1368 | disconnect(m_monitor, &Monitor::seekToNextKeyframe, this, &AnimationWidget::slotNext); | 1372 | disconnect(m_monitor, &Monitor::seekToNextKeyframe, this, &AnimationWidget::slotNext); | ||
1369 | disconnect(m_monitor, &Monitor::seekToPreviousKeyframe, this, &AnimationWidget::slotPrevious); | 1373 | disconnect(m_monitor, &Monitor::seekToPreviousKeyframe, this, &AnimationWidget::slotPrevious); | ||
1370 | disconnect(m_monitor, &Monitor::seekToKeyframe, this, &AnimationWidget::slotSeekToKeyframe); | 1374 | disconnect(m_monitor, &Monitor::seekToKeyframe, this, &AnimationWidget::slotSeekToKeyframe); | ||
1371 | } | 1375 | } | ||
1372 | } | 1376 | } | ||
1373 | 1377 | | |||
▲ Show 20 Lines • Show All 313 Lines • ▼ Show 20 Line(s) | |||||
1687 | void AnimationWidget::slotSetRange(QPair<int, int> range) | 1691 | void AnimationWidget::slotSetRange(QPair<int, int> range) | ||
1688 | { | 1692 | { | ||
1689 | m_inPoint = range.first; | 1693 | m_inPoint = range.first; | ||
1690 | m_outPoint = range.second; | 1694 | m_outPoint = range.second; | ||
1691 | m_offset = m_model->data(m_index, AssetParameterModel::InRole).toInt(); | 1695 | m_offset = m_model->data(m_index, AssetParameterModel::InRole).toInt(); | ||
1692 | m_ruler->setRange(0, m_outPoint - m_inPoint); | 1696 | m_ruler->setRange(0, m_outPoint - m_inPoint); | ||
1693 | m_timePos->setRange(0, m_outPoint - m_inPoint - 1); | 1697 | m_timePos->setRange(0, m_outPoint - m_inPoint - 1); | ||
1694 | } | 1698 | } | ||
1699 | | ||||
1700 | void AnimationWidget::slotUpdateOpacity(qreal value) | ||||
1701 | { | ||||
1702 | m_spinOpacity->setValue(value); | ||||
1703 | } | ||||
1704 | | ||||
1705 | void AnimationWidget::slotUpdateRotation() | ||||
1706 | { | ||||
1707 | | ||||
1708 | } |