]> git.sesse.net Git - kdenlive/blob - src/transitionsettings.cpp
cleanup and now every change of transitions tag updates the monitor
[kdenlive] / src / transitionsettings.cpp
1 /***************************************************************************
2                           effecstackedit.h  -  description
3                              -------------------
4     begin                : Mar 15 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #include "transitionsettings.h"
19 #include "transition.h"
20 #include <KDebug>
21 #include "effectslist.h"
22 #include "effectstackedit.h"
23
24 TransitionSettings::TransitionSettings(EffectsList *transitions, QWidget* parent): QWidget(parent) {
25     ui.setupUi(this);
26     effectEdit = new EffectStackEdit(ui.frame, this);
27     setEnabled(false);
28     m_transitions = transitions;
29     ui.listWidget->addItems(transitions->effectNames());
30     kDebug() << transitions->effectNames().size() << " -" << transitions->size();
31     connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slotTransitionChanged()));
32     connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), effectEdit , SLOT(transferParamDesc(const QDomElement&, int , int)));
33     connect(effectEdit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
34 }
35
36
37 void TransitionSettings::slotTransitionChanged() {
38     QDomElement e = m_usedTransition->toXML();
39
40     //set old values from e in <ktransition> to desc (like reverse and so )
41     QDomElement desc = m_transitions->getEffectByName(ui.listWidget->currentItem()->text());
42     if (m_usedTransition)
43         m_usedTransition->setTransitionParameters(desc);
44     emit transitionUpdated(e, m_usedTransition->toXML());
45     emit transferParamDesc(desc, 0, 0);
46 }
47
48 void TransitionSettings::slotTransitionItemSelected(Transition* t) {
49     setEnabled(t != NULL);
50     m_usedTransition = t;
51
52 }
53
54 void TransitionSettings::slotUpdateEffectParams(const QDomElement& oldparam, const QDomElement& param) {
55
56     emit transitionUpdated(oldparam, param);
57 }