m_trackindex(-1),
m_draggedEffect(NULL),
m_draggedGroup(NULL),
- m_groupIndex(0)
+ m_groupIndex(0),
+ m_monitorSceneWanted(false)
{
m_effectMetaInfo.trackMode = false;
m_effectMetaInfo.monitor = monitor;
void EffectStackView2::slotRenderPos(int pos)
{
if (m_effects.isEmpty()) return;
- slotCheckMonitorPosition(pos);
+ if (m_monitorSceneWanted) slotCheckMonitorPosition(pos);
if (!m_effectMetaInfo.trackMode && m_clipref) pos = pos - m_clipref->startPos().frames(KdenliveSettings::project_fps());
for (int i = 0; i< m_effects.count(); i++)
void EffectStackView2::setupListView()
{
blockSignals(true);
+ m_monitorSceneWanted = false;
m_draggedEffect = NULL;
m_draggedGroup = NULL;
disconnect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
else {
isSelected = currentEffect->effectIndex() == m_clipref->selectedEffectIndex();
}
- if (isSelected) currentEffect->setActive(true);
+ if (isSelected) {
+ currentEffect->setActive(true);
+ if (currentEffect->needsMonitorEffectScene()) m_monitorSceneWanted = true;
+ }
m_effects.append(currentEffect);
if (group) {
group->addGroupEffect(currentEffect);
void EffectStackView2::slotCheckMonitorPosition(int renderPos)
{
- CollapsibleEffect *current = currentEffect();
- if (current && current->needsMonitorEffectScene()) {
+ if (m_monitorSceneWanted) {
if (m_effectMetaInfo.trackMode || (m_clipref && renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
if (!m_effectMetaInfo.monitor->effectSceneDisplayed()) {
m_effectMetaInfo.monitor->slotShowEffectScene(true);
void EffectStackView2::clear()
{
m_effects.clear();
+ m_monitorSceneWanted = false;
QWidget *view = m_ui.container->takeWidget();
if (view) {
delete view;
if (m_effects.at(i)->effectIndex() == ix) {
if (m_effects.at(i)->isActive()) return;
m_effects.at(i)->setActive(true);
+ m_monitorSceneWanted = m_effects.at(i)->needsMonitorEffectScene();
slotCheckMonitorPosition(m_effectMetaInfo.monitor->render->seekFramePosition());
m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
}
}
-CollapsibleEffect *EffectStackView2::currentEffect() const
-{
- for (int i = 0; i < m_effects.count(); i++) {
- if (m_effects.at(i)->isActive()) return m_effects.at(i);
- }
- return NULL;
-}
-
void EffectStackView2::slotDeleteGroup(QDomDocument doc)
{
QDomNodeList effects = doc.elementsByTagName("effect");
/** @brief The current number of groups. */
int m_groupIndex;
+
+ /** @brief The current effect may require an on monitor scene. */
+ bool m_monitorSceneWanted;
/** @brief Sets the list of effects according to the clip's effect list. */
void setupListView();
void connectEffect(CollapsibleEffect *currentEffect);
/** @brief Connect a group to its signals. */
void connectGroup(CollapsibleGroup *group);
- /** @brief Returns the currentl active effect. */
- CollapsibleEffect *currentEffect() const;
public slots:
/** @brief Sets the clip whose effect list should be managed.