3 #include <QStylePainter>
11 #include "documenttrack.h"
13 DocumentTrack::DocumentTrack(QDomElement xml, TrackView * view, QWidget *parent)
14 : QWidget(parent), m_xml(xml), m_trackDuration(0)
21 void DocumentTrack::parseXml()
25 for(QDomNode n = m_xml.firstChild(); !n.isNull(); n = n.nextSibling())
27 QDomElement elem = n.toElement();
28 if (elem.tagName() == "blank") {
29 position += elem.attribute("length", 0).toInt();
31 else if (elem.tagName() == "entry") {
33 clip.startTime = position;
34 int in = elem.attribute("in", 0).toInt();
35 int out = elem.attribute("out", 0).toInt() - in;
39 clip.producer = elem.attribute("producer", QString::null);
40 kDebug()<<"++++++++++++++\n\n / / /ADDING CLIP: "<<clip.cropTime<<", out: "<<clip.duration<<", Producer: "<<clip.producer<<"\n\n++++++++++++++++++++";
41 m_clipList.append(clip);
44 m_trackDuration = position;
47 int DocumentTrack::duration()
49 return m_trackDuration;
52 QList <TrackViewClip> DocumentTrack::clipList()
58 void DocumentTrack::paintEvent(QPaintEvent *e )
60 QRect region = e->rect();
61 region.setBottomRight(QPoint(region.right() - 1, region.bottom() - 1));
62 QPainter painter(this);
63 painter.fillRect(region, QBrush(Qt::red));
64 painter.drawLine(region.bottomLeft (), region.bottomRight ());
68 #include "documenttrack.moc"