]> git.sesse.net Git - kdenlive/blob - src/addtransitioncommand.cpp
use more forward decl. to have no unneeded recompiling
[kdenlive] / src / addtransitioncommand.cpp
1 /***************************************************************************
2                           addtransitioncommand.cpp  -  description
3                              -------------------
4     begin                : 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 #include <KLocale>
18
19 #include "addtransitioncommand.h"
20 #include "customtrackview.h"
21
22 AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, int track, QDomElement xml, GenTime pos, bool doIt) : m_view(view), m_track(track), m_xml(xml), m_pos(pos), m_doIt(doIt) {
23     if (m_doIt) setText(i18n("Add transition to clip"));
24     else setText(i18n("Delete transition from clip"));
25 }
26
27
28 // virtual
29 void AddTransitionCommand::undo() {
30     if (m_doIt) m_view->deleteTransition(m_track, m_pos, m_xml);
31     else m_view->addTransition(m_track , m_pos, m_xml);
32 }
33 // virtual
34 void AddTransitionCommand::redo() {
35     if (m_doIt) m_view->addTransition(m_track , m_pos, m_xml);
36     else m_view->deleteTransition(m_track, m_pos, m_xml);
37     m_doIt = true;
38 }
39
40 #include "addtimelineclipcommand.moc"