1 /***************************************************************************
2 editkeyframecommand.cpp - description
5 copyright : (C) 2008 by Jean-Baptiste Mardelle
6 email : jb@kdenlive.org
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
19 #include "editkeyframecommand.h"
20 #include "customtrackview.h"
22 EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, GenTime pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) : m_view(view), m_track(track), m_pos(pos), m_index(effectIndex), m_oldkfr(oldkeyframes), m_newkfr(newkeyframes), m_doIt(doIt) {
23 int prev = m_oldkfr.split(";", QString::SkipEmptyParts).count();
24 int next = m_newkfr.split(";", QString::SkipEmptyParts).count();
25 if (prev == next) setText(i18n("Edit keyframe"));
26 else if (prev > next) setText(i18n("Delete keyframe"));
27 else setText(i18n("Add keyframe"));
28 //kDebug() << "/// CREATE GUIDE COMMAND, TIMES: " << m_oldPos.frames(25) << "x" << m_pos.frames(25);
33 void EditKeyFrameCommand::undo() {
34 m_view->editKeyFrame(m_pos, m_track, m_index, m_oldkfr);
37 void EditKeyFrameCommand::redo() {
39 m_view->editKeyFrame(m_pos, m_track, m_index, m_newkfr);
44 #include "editkeyframecommand.moc"