]> git.sesse.net Git - kdenlive/blob - src/keyframeedit.cpp
Some progress on keyframe editor
[kdenlive] / src / keyframeedit.cpp
1 /***************************************************************************
2                           geomeytrval.cpp  -  description
3                              -------------------
4     begin                : 03 Aug 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 "keyframeedit.h"
19 #include "kdenlivesettings.h"
20
21 #include <KDebug>
22
23
24 KeyframeEdit::KeyframeEdit(Timecode tc, QWidget* parent) :
25         QWidget(parent),
26         m_timecode(tc)
27 {
28     m_ui.setupUi(this);
29     m_ui.keyframe_list->setHeaderLabels(QStringList() << i18n("Position") << i18n("Value"));
30     m_ui.button_add->setIcon(KIcon("document-new"));
31     m_ui.button_delete->setIcon(KIcon("edit-delete"));
32     setEnabled(false);
33 }
34
35 void KeyframeEdit::setupParam(int maxFrame, int minValue, int maxValue, QString keyframes)
36 {
37     m_maxFrame = maxFrame;
38     m_min = minValue;
39     m_max = maxValue;
40     m_ui.keyframe_list->clear();
41     QStringList frames = keyframes.split(";");
42     for (int i = 0; i < frames.count(); i++) {
43         QString framePos = m_timecode.getTimecodeFromFrames(frames.at(i).section(':', 0, 0).toInt());
44         m_ui.keyframe_list->addTopLevelItem(new QTreeWidgetItem(QStringList() << framePos << frames.at(i).section(':', 1, 1)));
45     }
46 }
47
48