]> git.sesse.net Git - kdenlive/blob - src/transitionsettings.cpp
all transitions can now added
[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
22 TransitionSettings::TransitionSettings(EffectsList *transitions, QWidget* parent): QWidget(parent) {
23     ui.setupUi(this);
24     setEnabled(false);
25     m_transitions = transitions;
26     ui.listWidget->addItems(transitions->effectNames());
27     kDebug() << transitions->effectNames().size() << " -" << transitions->size();
28     connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slotTransitionChanged()));
29 }
30
31 void TransitionSettings::slotTransitionChanged() {
32     QDomElement e = m_usedTransition->toXML();
33     QDomElement newElement = e.cloneNode().toElement();
34
35     QDomElement desc = m_transitions->getEffectByName(ui.listWidget->currentItem()->text());
36
37     newElement.setAttribute("type", desc.attribute("tag"));
38     emit transitionUpdated(e, newElement);
39 }
40
41 void TransitionSettings::slotTransitionItemSelected(Transition* t) {
42     setEnabled(t != NULL);
43     m_usedTransition = t;
44 }
45