]> git.sesse.net Git - kdenlive/blob - src/transitionsettings.cpp
First big cleanup of transition / clipitem. Transitions are a bit broken for now...
[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
19 #include <KDebug>
20
21 #include "transitionsettings.h"
22 #include "transition.h"
23 #include "effectslist.h"
24 #include "effectstackedit.h"
25
26 TransitionSettings::TransitionSettings(EffectsList *transitions, QWidget* parent): QWidget(parent) {
27     ui.setupUi(this);
28     effectEdit = new EffectStackEdit(ui.frame, this);
29     setEnabled(false);
30     m_transitions = transitions;
31     ui.listWidget->addItems(transitions->effectNames());
32     kDebug() << transitions->effectNames().size() << " -" << transitions->size();
33     connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slotTransitionChanged()));
34     connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), effectEdit , SLOT(transferParamDesc(const QDomElement&, int , int)));
35     connect(effectEdit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
36 }
37
38
39 void TransitionSettings::slotTransitionChanged() {
40     /*
41         QDomElement e = m_usedTransition->toXML();
42
43         //set old values from e in <ktransition> to desc (like reverse and so )
44         QDomElement desc = m_transitions->getEffectByName(ui.listWidget->currentItem()->text());
45         if (m_usedTransition) {
46             m_usedTransition->setTransitionParameters(desc);
47             m_usedTransition->update();
48         }
49         emit transitionUpdated(e, m_usedTransition->toXML());
50         emit transferParamDesc(desc, 0, 0);
51     */
52 }
53
54 void TransitionSettings::slotTransitionItemSelected(Transition* t) {
55     setEnabled(t != NULL);
56     m_usedTransition = t;
57
58 }
59
60 void TransitionSettings::slotUpdateEffectParams(const QDomElement& oldparam, const QDomElement& param) {
61
62     emit transitionUpdated(oldparam, param);
63 }