summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-10-08 13:59:21 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-10-08 13:59:21 (GMT)
commit670d54393d1d504032848553b82f4122353f3c9f (patch)
tree5f47ea70898881d074e215865ed744ff1ffa1ec1
parent58cd2707997d6db088837bbe811a83a926b7a0ed (diff)
Remember track effect state when disabling timeline effects
BUG: 368245
-rw-r--r--src/timeline/effectmanager.cpp18
-rw-r--r--src/timeline/effectmanager.h2
-rw-r--r--src/timeline/track.cpp7
-rw-r--r--src/timeline/track.h2
4 files changed, 19 insertions, 10 deletions
diff --git a/src/timeline/effectmanager.cpp b/src/timeline/effectmanager.cpp
index b9a0393..75d38d2 100644
--- a/src/timeline/effectmanager.cpp
+++ b/src/timeline/effectmanager.cpp
@@ -363,17 +363,27 @@ bool EffectManager::removeEffect(int effectIndex, bool updateIndex)
return success;
}
-bool EffectManager::enableEffects(const QList <int> &effectIndexes, bool disable)
+bool EffectManager::enableEffects(const QList <int> &effectIndexes, bool disable, bool rememberState)
{
int ct = 0;
bool success = false;
Mlt::Filter *filter = m_producer.filter(ct);
while (filter) {
if (effectIndexes.isEmpty() || effectIndexes.contains(filter->get_int("kdenlive_ix"))) {
- m_producer.lock();
- filter->set("disable", (int) disable);
+ //m_producer.lock();
+ if (rememberState) {
+ if (disable && filter->get_int("disable") == 0) {
+ filter->set("auto_disable", 1);
+ filter->set("disable", (int) disable);
+ } else if (!disable && filter->get_int("auto_disable") == 1) {
+ filter->set("disable", (char*) NULL);
+ filter->set("auto_disable", (char*) NULL);
+ }
+ } else {
+ filter->set("disable", (int) disable);
+ }
success = true;
- m_producer.unlock();
+ //m_producer.unlock();
}
delete filter;
ct++;
diff --git a/src/timeline/effectmanager.h b/src/timeline/effectmanager.h
index 7340f2a..296332e 100644
--- a/src/timeline/effectmanager.h
+++ b/src/timeline/effectmanager.h
@@ -46,7 +46,7 @@ public:
bool doAddFilter(EffectsParameterList params, int duration);
bool editEffect(EffectsParameterList params, int duration, bool replaceEffect);
bool removeEffect(int effectIndex, bool updateIndex);
- bool enableEffects(const QList <int> &effectIndexes, bool disable);
+ bool enableEffects(const QList <int> &effectIndexes, bool disable, bool rememberState = false);
bool moveEffect(int oldPos, int newPos);
public Q_SLOTS:
diff --git a/src/timeline/track.cpp b/src/timeline/track.cpp
index 2f78b43..32aa837 100644
--- a/src/timeline/track.cpp
+++ b/src/timeline/track.cpp
@@ -862,8 +862,7 @@ int Track::spaceLength(int pos, bool fromBlankStart)
void Track::disableEffects(bool disable)
{
// Disable track effects
- enableTrackEffects(QList <int> (), disable);
-
+ enableTrackEffects(QList <int> (), disable, true);
// Disable timeline clip effects
for (int i = 0; i < m_playlist.count(); i++) {
QScopedPointer<Mlt::Producer> original(m_playlist.get_clip(i));
@@ -950,10 +949,10 @@ bool Track::enableEffects(double start, const QList <int> &effectIndexes, bool d
return effect.enableEffects(effectIndexes, disable);
}
-bool Track::enableTrackEffects(const QList <int> &effectIndexes, bool disable)
+bool Track::enableTrackEffects(const QList <int> &effectIndexes, bool disable, bool remember)
{
EffectManager effect(m_playlist);
- return effect.enableEffects(effectIndexes, disable);
+ return effect.enableEffects(effectIndexes, disable, remember);
}
bool Track::moveEffect(double start, int oldPos, int newPos)
diff --git a/src/timeline/track.h b/src/timeline/track.h
index 1b0599b..a4e7671 100644
--- a/src/timeline/track.h
+++ b/src/timeline/track.h
@@ -202,7 +202,7 @@ public:
bool removeEffect(double start, int effectIndex, bool updateIndex);
bool removeTrackEffect(int effectIndex, bool updateIndex);
bool enableEffects(double start, const QList <int> &effectIndexes, bool disable);
- bool enableTrackEffects(const QList <int> &effectIndexes, bool disable);
+ bool enableTrackEffects(const QList <int> &effectIndexes, bool disable, bool remember = false);
bool moveEffect(double start, int oldPos, int newPos);
bool moveTrackEffect(int oldPos, int newPos);
QList <QPoint> visibleClips();