"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/models/keyframesmodel.cpp" between
shotcut-22.10.22.tar.gz and shotcut-22.11.25.tar.gz

About: Shotcut is a cross-platform (Qt) advanced video editor.

keyframesmodel.cpp  (shotcut-22.10.22):keyframesmodel.cpp  (shotcut-22.11.25)
skipping to change at line 289 skipping to change at line 289
if (keyframeIndex > 0) { if (keyframeIndex > 0) {
modelIndex = index(keyframeIndex - 1, 0, index(parameterInde x)); modelIndex = index(keyframeIndex - 1, 0, index(parameterInde x));
emit dataChanged(modelIndex, modelIndex, QVector<int>() << M aximumFrameRole); emit dataChanged(modelIndex, modelIndex, QVector<int>() << M aximumFrameRole);
} }
if (keyframeIndex < keyframeCount(parameterIndex)) { if (keyframeIndex < keyframeCount(parameterIndex)) {
modelIndex = index(keyframeIndex, 0, index(parameterIndex)); modelIndex = index(keyframeIndex, 0, index(parameterIndex));
emit dataChanged(modelIndex, modelIndex, QVector<int>() << M inimumFrameRole); emit dataChanged(modelIndex, modelIndex, QVector<int>() << M inimumFrameRole);
} }
emit dataChanged(index(parameterIndex), index(parameterIndex), emit dataChanged(index(parameterIndex), index(parameterIndex),
QVector<int>() << LowestValueRole << HighestVal ueRole); QVector<int>() << LowestValueRole << HighestVal ueRole);
emit m_filter->changed(); emit m_filter->changed(name.toUtf8().constData());
} }
} }
} }
return error; return error;
} }
int KeyframesModel::previousKeyframePosition(int parameterIndex, int currentPosi tion) int KeyframesModel::previousKeyframePosition(int parameterIndex, int currentPosi tion)
{ {
int result = -1; int result = -1;
if (m_filter && parameterIndex < m_propertyNames.count()) { if (m_filter && parameterIndex < m_propertyNames.count()) {
skipping to change at line 371 skipping to change at line 371
if (!animation.key_set_type(keyframeIndex, mlt_keyframe_type(type))) { if (!animation.key_set_type(keyframeIndex, mlt_keyframe_type(type))) {
// LOG_DEBUG() << "keyframe index" << keyframeIndex << "keyframe type" << type; // LOG_DEBUG() << "keyframe index" << keyframeIndex << "keyframe type" << type;
foreach (name, m_metadata->keyframes()->parameter( foreach (name, m_metadata->keyframes()->parameter(
m_metadataIndex[parameterIndex])->gangedProperties( )) { m_metadataIndex[parameterIndex])->gangedProperties( )) {
Mlt::Animation animation = m_filter->getAnimation(name); Mlt::Animation animation = m_filter->getAnimation(name);
animation.key_set_type(keyframeIndex, mlt_keyframe_type(type )); animation.key_set_type(keyframeIndex, mlt_keyframe_type(type ));
} }
QModelIndex modelIndex = index(keyframeIndex, 0, index(parameter Index)); QModelIndex modelIndex = index(keyframeIndex, 0, index(parameter Index));
emit dataChanged(modelIndex, modelIndex, QVector<int>() << Keyfr ameTypeRole << NameRole); emit dataChanged(modelIndex, modelIndex, QVector<int>() << Keyfr ameTypeRole << NameRole);
error = false; error = false;
emit m_filter->changed(); emit m_filter->changed(name.toUtf8().constData());
emit m_filter->propertyChanged(name.toUtf8().constData()); emit m_filter->propertyChanged(name.toUtf8().constData());
} }
} }
} }
if (error) if (error)
LOG_ERROR() << "failed to set keyframe" << "at parameter index" << param eterIndex << "keyframeIndex" LOG_ERROR() << "failed to set keyframe" << "at parameter index" << param eterIndex << "keyframeIndex"
<< keyframeIndex << "to type" << type; << keyframeIndex << "to type" << type;
return error; return error;
} }
skipping to change at line 431 skipping to change at line 431
foreach (name, m_metadata->keyframes()->parameter( foreach (name, m_metadata->keyframes()->parameter(
m_metadataIndex[parameterIndex])->gangedProperties()) { m_metadataIndex[parameterIndex])->gangedProperties()) {
Mlt::Animation animation = m_filter->getAnimation(name); Mlt::Animation animation = m_filter->getAnimation(name);
if (animation.is_valid()) if (animation.is_valid())
animation.key_set_frame(keyframeIndex, position); animation.key_set_frame(keyframeIndex, position);
} }
QModelIndex modelIndex = index(keyframeIndex, 0, index(parameterIndex)); QModelIndex modelIndex = index(keyframeIndex, 0, index(parameterIndex));
emit dataChanged(modelIndex, modelIndex, QVector<int>() << FrameNumberRole < < NameRole); emit dataChanged(modelIndex, modelIndex, QVector<int>() << FrameNumberRole < < NameRole);
updateNeighborsMinMax(parameterIndex, keyframeIndex); updateNeighborsMinMax(parameterIndex, keyframeIndex);
emit m_filter->changed(); emit m_filter->changed(name.toUtf8().constData());
emit m_filter->propertyChanged(name.toUtf8().constData()); emit m_filter->propertyChanged(name.toUtf8().constData());
} }
void KeyframesModel::addKeyframe(int parameterIndex, double value, int position, void KeyframesModel::addKeyframe(int parameterIndex, double value, int position,
KeyframesModel::InterpolationType type) KeyframesModel::InterpolationType type)
{ {
if (m_filter && parameterIndex < m_propertyNames.count()) { if (m_filter && parameterIndex < m_propertyNames.count()) {
QString name = m_propertyNames[parameterIndex]; QString name = m_propertyNames[parameterIndex];
m_filter->set(name, value, position, mlt_keyframe_type(type)); m_filter->set(name, value, position, mlt_keyframe_type(type));
foreach (name, m_metadata->keyframes()->parameter( foreach (name, m_metadata->keyframes()->parameter(
skipping to change at line 528 skipping to change at line 528
return; return;
} }
mlt_keyframe_type type = animation.key_get_type(keyframeIndex); mlt_keyframe_type type = animation.key_get_type(keyframeIndex);
m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_f ilter->duration(), m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_f ilter->duration(),
type); type);
foreach (name, m_metadata->keyframes()->parameter( foreach (name, m_metadata->keyframes()->parameter(
m_metadataIndex[parameterIndex])->gangedProperties()) m_metadataIndex[parameterIndex])->gangedProperties())
m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_filter->duration(), m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_filter->duration(),
type); type);
emit m_filter->changed(); emit m_filter->changed(name.toUtf8().constData());
emit m_filter->propertyChanged(name.toUtf8().constData()); emit m_filter->propertyChanged(name.toUtf8().constData());
QModelIndex modelIndex = index(keyframeIndex, 0, index(parameterIndex)); QModelIndex modelIndex = index(keyframeIndex, 0, index(parameterIndex));
emit dataChanged(modelIndex, modelIndex, QVector<int>() << NumericValueRole << NameRole); emit dataChanged(modelIndex, modelIndex, QVector<int>() << NumericValueRole << NameRole);
emit dataChanged(index(parameterIndex), index(parameterIndex), emit dataChanged(index(parameterIndex), index(parameterIndex),
QVector<int>() << LowestValueRole << HighestValueRole); QVector<int>() << LowestValueRole << HighestValueRole);
} }
void KeyframesModel::setKeyframeValuePosition(int parameterIndex, int keyframeIn dex, double value, void KeyframesModel::setKeyframeValuePosition(int parameterIndex, int keyframeIn dex, double value,
int position) int position)
{ {
skipping to change at line 590 skipping to change at line 590
updateNeighborsMinMax(parameterIndex, keyframeIndex); updateNeighborsMinMax(parameterIndex, keyframeIndex);
} }
mlt_keyframe_type type = animation.key_get_type(keyframeIndex); mlt_keyframe_type type = animation.key_get_type(keyframeIndex);
m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_f ilter->duration(), m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_f ilter->duration(),
type); type);
foreach (name, m_metadata->keyframes()->parameter( foreach (name, m_metadata->keyframes()->parameter(
m_metadataIndex[parameterIndex])->gangedProperties()) m_metadataIndex[parameterIndex])->gangedProperties())
m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_filter->duration(), m_filter->service().anim_set(name.toUtf8().constData(), value, position, m_filter->duration(),
type); type);
emit m_filter->changed(); emit m_filter->changed(name.toUtf8().constData());
emit m_filter->propertyChanged(name.toUtf8().constData()); emit m_filter->propertyChanged(name.toUtf8().constData());
roles << NumericValueRole << NameRole; roles << NumericValueRole << NameRole;
QModelIndex modelIndex = index(keyframeIndex, 0, index(parameterIndex)); QModelIndex modelIndex = index(keyframeIndex, 0, index(parameterIndex));
emit dataChanged(modelIndex, modelIndex, roles); emit dataChanged(modelIndex, modelIndex, roles);
emit dataChanged(index(parameterIndex), index(parameterIndex), emit dataChanged(index(parameterIndex), index(parameterIndex),
QVector<int>() << LowestValueRole << HighestValueRole); QVector<int>() << LowestValueRole << HighestValueRole);
} }
bool KeyframesModel::isKeyframe(int parameterIndex, int position) bool KeyframesModel::isKeyframe(int parameterIndex, int position)
{ {
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)