]> git.sesse.net Git - kdenlive/blob - src/monitor.cpp
Some work on project tree view
[kdenlive] / src / monitor.cpp
1
2 #include <QMouseEvent>
3 #include <QStylePainter>
4
5 #include <KDebug>
6 #include <KLocale>
7
8 #include "gentime.h"
9 #include "monitor.h"
10
11 Monitor::Monitor(QString name, QWidget *parent)
12     : QWidget(parent)
13 {
14   ui.setupUi(this);
15   if (name == "project") {
16   render = new Render(name, this);
17   render->createVideoXWindow(ui.video_frame->winId(), -1);
18   connect(ui.button_play, SIGNAL(clicked()), this, SLOT(slotOpen()));
19   connect(ui.button_rew, SIGNAL(clicked()), this, SLOT(slotRewind()));
20   connect(ui.button_play_2, SIGNAL(clicked()), this, SLOT(slotPlay()));
21   }
22 }
23
24 void Monitor::slotOpen()
25 {
26
27 render->mltInsertClip(2, GenTime(1, 25), QString("<westley><producer mlt_service=\"colour\" colour=\"red\" in=\"1\" out=\"30\" /></westley>"));
28 render->mltInsertClip(2, GenTime(0, 25), QString("<westley><producer mlt_service=\"avformat\" resource=\"/home/one/.vids/clip3e.mpg\" in=\"1\" out=\"300\" /></westley>"));
29 }
30
31 void Monitor::slotRewind()
32 {
33   render->seek(GenTime(0));
34
35 }
36
37 void Monitor::slotPlay()
38 {
39   render->switchPlay();
40 }
41
42 void Monitor::slotSetXml(const QDomElement &e)
43 {
44     QDomDocument doc;
45     QDomElement westley = doc.createElement("westley");
46     doc.appendChild(westley);
47     westley.appendChild(e);
48     render->setSceneList(doc, 0);
49 }
50
51
52 void Monitor::slotOpenFile(const QString &file)
53 {
54     QDomDocument doc;
55     QDomElement westley = doc.createElement("westley");
56     doc.appendChild(westley);
57     QDomElement prod = doc.createElement("producer");
58     westley.appendChild(prod);
59     prod.setAttribute("mlt_service", "avformat");
60     prod.setAttribute("resource", file);
61     render->setSceneList(doc, 0);
62 }
63
64
65
66 #include "monitor.moc"