Commit 7b91ff7b authored by Nicolas Carion's avatar Nicolas Carion

seeking on the keyframe timeline seeks in the real timeline

parent ec79c1a7
......@@ -63,6 +63,7 @@ AssetPanel::AssetPanel(QWidget *parent)
m_lay->addWidget(m_effectStackWidget);
m_transitionWidget->setVisible(false);
updatePalette();
connect(m_effectStackWidget, &EffectStackView::seekToPos, this, &AssetPanel::seekToPos);
}
void AssetPanel::showTransition(int tid, std::shared_ptr<AssetParameterModel> transitionModel)
......
......@@ -81,6 +81,7 @@ private slots:
signals:
void doSplitEffect(bool);
void doSplitBinEffect(bool);
void seekToPos(int);
};
#endif
......@@ -62,7 +62,7 @@ void KeyframeView::slotSetPosition(int pos)
if (pos != m_position) {
m_position = pos;
emit atKeyframe(m_model->hasKeyframe(pos));
emit positionChanged(pos);
emit seekToPos(pos);
update();
}
}
......
......@@ -78,7 +78,7 @@ private:
QColor m_colKeyframeBg;
signals:
void positionChanged(int pos);
void seekToPos(int pos);
void atKeyframe(bool);
};
......
......@@ -63,6 +63,7 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
animWidget = static_cast<AnimationWidget *>(w);
}
connect(w, &AbstractParamWidget::valueChanged, this, &AssetParameterView::commitChanges);
connect(w, &AbstractParamWidget::seekToPos, this, &AssetParameterView::seekToPos);
m_lay->addWidget(w);
m_widgets.push_back(w);
}
......@@ -86,6 +87,7 @@ void AssetParameterView::resetValues()
void AssetParameterView::setRange(QPair<int, int> range)
{
qDebug() << "SETTING RANGE"<<range;
QMutexLocker lock(&m_lock);
for (int i = 0; i < m_widgets.size(); ++i) {
auto w = m_widgets[i];
......
......@@ -77,6 +77,9 @@ private slots:
@param storeUndo: if true, an undo object is created
*/
void commitChanges(const QModelIndex &index, const QString &value, bool storeUndo);
signals:
void seekToPos(int);
};
#endif
......@@ -60,6 +60,8 @@ signals:
This happens for example when the user has to pick a color.
*/
void disableCurrentFilter(bool);
void seekToPos(int);
public slots:
/** @brief Toggle the comments on or off
*/
......
......@@ -73,7 +73,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
l->addWidget(m_time, 1, 3, Qt::AlignRight);
connect(m_time, &TimecodeDisplay::timeCodeEditingFinished, [&](){slotSetPosition(-1, true);});
connect(m_keyframeview, &KeyframeView::positionChanged, [&](int p){slotSetPosition(p, true);});
connect(m_keyframeview, &KeyframeView::seekToPos, [&](int p){slotSetPosition(p, true);});
connect(m_keyframeview, &KeyframeView::atKeyframe, this, &KeyframeWidget::slotAtKeyframe);
connect(m_buttonAddDelete, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotAddRemove);
......@@ -102,7 +102,7 @@ void KeyframeWidget::slotSetPosition(int pos, bool update)
}
if (update) {
emit positionChanged(pos);
emit seekToPos(pos);
}
}
......
......@@ -52,9 +52,6 @@ public slots:
private slots:
void slotAtKeyframe(bool atKeyframe);
signals:
void positionChanged(int pos);
private:
std::shared_ptr<KeyframeModelList> m_keyframes;
......
......@@ -42,6 +42,8 @@ signals:
void moveEffect(const QList<int> &current_pos, int new_pos, int groupIndex, const QString &groupName);
/** @brief An effect was saved, trigger effect list reload. */
void reloadEffects();
void seekToPos(int);
};
#endif
......@@ -132,6 +132,7 @@ CollapsibleEffectView::CollapsibleEffectView(std::shared_ptr<EffectItemModel> ef
m_view = new AssetParameterView(this);
m_view->setModel(std::static_pointer_cast<AssetParameterModel>(effectModel), range);
connect(m_view, &AssetParameterView::seekToPos, this, &AbstractCollapsibleWidget::seekToPos);
QVBoxLayout *lay = new QVBoxLayout(widgetFrame);
lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
......
......@@ -36,7 +36,7 @@ class AssetParameterView;
/**)
* @class CollapsibleEffectView
* @brief A dialog for editing markers and guides.
* @brief A container for the parameters of an effect
* @author Jean-Baptiste Mardelle
*/
......
......@@ -23,6 +23,7 @@
#include "assets/assetlist/view/qmltypes/asseticonprovider.hpp"
#include "assets/view/assetparameterview.hpp"
#include "collapsibleeffectview.hpp"
#include "core.h"
#include "effects/effectstack/model/effectitemmodel.hpp"
#include "effects/effectstack/model/effectstackmodel.hpp"
......@@ -188,6 +189,11 @@ void EffectStackView::loadEffects(QPair<int, int> range, int start, int end)
connect(view, &CollapsibleEffectView::startDrag, this, &EffectStackView::slotStartDrag);
connect(view, &CollapsibleEffectView::createGroup, m_model.get(), &EffectStackModel::slotCreateGroup);
connect(view, &CollapsibleEffectView::activateEffect, this, &EffectStackView::slotActivateEffect);
connect(view, &CollapsibleEffectView::seekToPos, [this](int pos){
// at this point, the effects returns a pos relative to the clip. We need to convert it to a global time
int clipIn = pCore->getItemIn(m_model->getOwnerId());
emit seekToPos(pos + clipIn);
});
connect(this, &EffectStackView::doActivateEffect, view, &CollapsibleEffectView::slotActivateEffect);
QModelIndex ix = m_model->getIndexFromItem(effectModel);
m_effectsTree->setIndexWidget(ix, view);
......
......@@ -84,6 +84,7 @@ private slots:
signals:
void doActivateEffect(QModelIndex);
void seekToPos(int);
};
#endif
......@@ -311,6 +311,8 @@ void MainWindow::init()
connect(this, &MainWindow::clearAssetPanel, m_assetPanel, &AssetPanel::clearAssetPanel);
connect(this, &MainWindow::adjustAssetPanelRange, m_assetPanel, &AssetPanel::adjustAssetPanelRange);
connect(m_assetPanel, &AssetPanel::seekToPos, [this](int pos){getCurrentTimeline()->controller()->setPosition(pos);} );
m_effectStackDock = addDock(i18n("Properties"), QStringLiteral("effect_stack"), m_assetPanel);
m_effectList = new EffectsListView();
......
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