]> git.sesse.net Git - kdenlive/blob - src/clipproperties.cpp
Clip properties dialog
[kdenlive] / src / clipproperties.cpp
1 /***************************************************************************
2  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #include <QDir>
21
22 #include <KStandardDirs>
23 #include <KDebug>
24
25 #include "kdenlivesettings.h"
26 #include "clipproperties.h"
27 #include "kthumb.h"
28
29 ClipProperties::ClipProperties(DocClipBase *clip, QWidget * parent): QDialog(parent) {
30     m_view.setupUi(this);
31     m_clip = clip;
32
33     m_view.clip_path->setText(m_clip->fileURL().path());
34     m_view.clip_description->setText(m_clip->description());
35     QMap <QString, QString> props = m_clip->properties();
36     if (props.contains("frame_size"))
37         m_view.clip_size->setText(props["frame_size"]);
38     if (props.contains("videocodec"))
39         m_view.clip_vcodec->setText(props["videocodec"]);
40     if (props.contains("audiocodec"))
41         m_view.clip_acodec->setText(props["audiocodec"]);
42     if (props.contains("fps"))
43         m_view.clip_fps->setText(props["fps"]);
44     if (props.contains("frequency"))
45         m_view.clip_frequency->setText(props["frequency"]);
46     if (props.contains("channels"))
47         m_view.clip_channels->setText(props["channels"]);
48     if (props.contains("aspect_ratio"))
49         m_view.clip_ratio->setText(props["aspect_ratio"]);
50     QPixmap pix = m_clip->thumbProducer()->getImage(m_clip->fileURL(), 240, 180);
51     m_view.clip_thumb->setPixmap(pix);
52     CLIPTYPE t = m_clip->clipType();
53     if (t == IMAGE || t == VIDEO) m_view.tabWidget->removeTab(1);
54 }
55
56 #include "clipproperties.moc"
57
58