]> git.sesse.net Git - kdenlive/blob - src/mainwindow.cpp
Title clips now really usable (only transparency & duration change still missing)
[kdenlive] / src / mainwindow.cpp
1 /***************************************************************************
2  *   Copyright (C) 2007 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
21
22 #include <QTextStream>
23 #include <QTimer>
24 #include <QAction>
25 #include <QtTest>
26 #include <QtCore>
27
28 #include <KApplication>
29 #include <KAction>
30 #include <KLocale>
31 #include <KGlobal>
32 #include <KActionCollection>
33 #include <KStandardAction>
34 #include <KFileDialog>
35 #include <KMessageBox>
36 #include <KDebug>
37 #include <KIO/NetAccess>
38 #include <KSaveFile>
39 #include <KRuler>
40 #include <KConfigDialog>
41 #include <KXMLGUIFactory>
42 #include <KStatusBar>
43 #include <kstandarddirs.h>
44 #include <KUrlRequesterDialog>
45 #include <KTemporaryFile>
46 #include <KActionMenu>
47 #include <KMenu>
48 #include <locale.h>
49 #include <ktogglefullscreenaction.h>
50
51 #include <mlt++/Mlt.h>
52
53 #include "mainwindow.h"
54 #include "kdenlivesettings.h"
55 #include "kdenlivesettingsdialog.h"
56 #include "initeffects.h"
57 #include "profilesdialog.h"
58 #include "projectsettings.h"
59 #include "events.h"
60 #include "renderjob.h"
61 #include "clipmanager.h"
62 #include "projectlist.h"
63 #include "monitor.h"
64 #include "recmonitor.h"
65 #include "monitormanager.h"
66 #include "kdenlivedoc.h"
67 #include "trackview.h"
68 #include "customtrackview.h"
69 #include "effectslistview.h"
70 #include "effectstackview.h"
71 #include "transitionsettings.h"
72 #include "renderwidget.h"
73 #include "renderer.h"
74 #include "jogshuttle.h"
75 #include "clipproperties.h"
76
77 #define ID_STATUS_MSG 1
78 #define ID_EDITMODE_MSG 2
79 #define ID_TIMELINE_MSG 3
80 #define ID_TIMELINE_BUTTONS 5
81 #define ID_TIMELINE_POS 6
82 #define ID_TIMELINE_FORMAT 7
83
84 EffectsList MainWindow::videoEffects;
85 EffectsList MainWindow::audioEffects;
86 EffectsList MainWindow::customEffects;
87 EffectsList MainWindow::transitions;
88
89 MainWindow::MainWindow(QWidget *parent)
90         : KXmlGuiWindow(parent),
91         m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL), m_jogProcess(NULL) {
92     setlocale(LC_NUMERIC, "POSIX");
93     parseProfiles();
94     setFont(KGlobalSettings::toolBarFont());
95     m_commandStack = new QUndoGroup;
96     m_timelineArea = new KTabWidget(this);
97     m_timelineArea->setTabReorderingEnabled(true);
98     m_timelineArea->setTabBarHidden(true);
99
100     QToolButton *closeTabButton = new QToolButton;
101     connect(closeTabButton, SIGNAL(clicked()), this, SLOT(slotRemoveTab()));
102     closeTabButton->setIcon(KIcon("tab-close"));
103     closeTabButton->adjustSize();
104     closeTabButton->setToolTip(i18n("Close the current tab"));
105     m_timelineArea->setCornerWidget(closeTabButton);
106     connect(m_timelineArea, SIGNAL(currentChanged(int)), this, SLOT(activateDocument()));
107
108     initEffects::parseEffectFiles();
109     m_monitorManager = new MonitorManager();
110
111     projectListDock = new QDockWidget(i18n("Project Tree"), this);
112     projectListDock->setObjectName("project_tree");
113     m_projectList = new ProjectList(this);
114     projectListDock->setWidget(m_projectList);
115     addDockWidget(Qt::TopDockWidgetArea, projectListDock);
116
117     effectListDock = new QDockWidget(i18n("Effect List"), this);
118     effectListDock->setObjectName("effect_list");
119     m_effectList = new EffectsListView();
120
121     //m_effectList = new KListWidget(this);
122     effectListDock->setWidget(m_effectList);
123     addDockWidget(Qt::TopDockWidgetArea, effectListDock);
124
125     effectStackDock = new QDockWidget(i18n("Effect Stack"), this);
126     effectStackDock->setObjectName("effect_stack");
127     effectStack = new EffectStackView(this);
128     effectStackDock->setWidget(effectStack);
129     addDockWidget(Qt::TopDockWidgetArea, effectStackDock);
130
131     transitionConfigDock = new QDockWidget(i18n("Transition"), this);
132     transitionConfigDock->setObjectName("transition");
133     transitionConfig = new TransitionSettings(this);
134     transitionConfigDock->setWidget(transitionConfig);
135     addDockWidget(Qt::TopDockWidgetArea, transitionConfigDock);
136
137
138     clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
139     clipMonitorDock->setObjectName("clip_monitor");
140     m_clipMonitor = new Monitor("clip", m_monitorManager, this);
141     clipMonitorDock->setWidget(m_clipMonitor);
142     addDockWidget(Qt::TopDockWidgetArea, clipMonitorDock);
143     //m_clipMonitor->stop();
144
145     projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
146     projectMonitorDock->setObjectName("project_monitor");
147     m_projectMonitor = new Monitor("project", m_monitorManager, this);
148     projectMonitorDock->setWidget(m_projectMonitor);
149     addDockWidget(Qt::TopDockWidgetArea, projectMonitorDock);
150
151     recMonitorDock = new QDockWidget(i18n("Record Monitor"), this);
152     recMonitorDock->setObjectName("record_monitor");
153     m_recMonitor = new RecMonitor("record", this);
154     recMonitorDock->setWidget(m_recMonitor);
155     addDockWidget(Qt::TopDockWidgetArea, recMonitorDock);
156
157     connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
158
159     undoViewDock = new QDockWidget(i18n("Undo History"), this);
160     undoViewDock->setObjectName("undo_history");
161     m_undoView = new QUndoView(this);
162     m_undoView->setCleanIcon(KIcon("edit-clear"));
163     m_undoView->setEmptyLabel(i18n("Clean"));
164     undoViewDock->setWidget(m_undoView);
165     m_undoView->setGroup(m_commandStack);
166     addDockWidget(Qt::TopDockWidgetArea, undoViewDock);
167
168     overviewDock = new QDockWidget(i18n("Project Overview"), this);
169     overviewDock->setObjectName("project_overview");
170     m_overView = new CustomTrackView(NULL, NULL, this);
171     overviewDock->setWidget(m_overView);
172     addDockWidget(Qt::TopDockWidgetArea, overviewDock);
173
174     setupActions();
175     tabifyDockWidget(projectListDock, effectListDock);
176     tabifyDockWidget(projectListDock, effectStackDock);
177     tabifyDockWidget(projectListDock, transitionConfigDock);
178     tabifyDockWidget(projectListDock, undoViewDock);
179     projectListDock->raise();
180
181     tabifyDockWidget(clipMonitorDock, projectMonitorDock);
182     setCentralWidget(m_timelineArea);
183
184     m_timecodeFormat = new KComboBox(this);
185     m_timecodeFormat->addItem(i18n("hh:mm:ss::ff"));
186     m_timecodeFormat->addItem(i18n("Frames"));
187
188     statusProgressBar = new QProgressBar(this);
189     statusProgressBar->setMinimum(0);
190     statusProgressBar->setMaximum(100);
191     statusProgressBar->setMaximumWidth(150);
192     statusProgressBar->setVisible(false);
193     statusLabel = new QLabel(this);
194
195     QWidget *w = new QWidget;
196     timeline_buttons_ui.setupUi(w);
197     timeline_buttons_ui.buttonVideo->setDown(KdenliveSettings::videothumbnails());
198     timeline_buttons_ui.buttonAudio->setDown(KdenliveSettings::audiothumbnails());
199     connect(timeline_buttons_ui.buttonVideo, SIGNAL(clicked()), this, SLOT(slotSwitchVideoThumbs()));
200     connect(timeline_buttons_ui.buttonAudio, SIGNAL(clicked()), this, SLOT(slotSwitchAudioThumbs()));
201     connect(timeline_buttons_ui.buttonFitZoom, SIGNAL(clicked()), this, SLOT(slotFitZoom()));
202
203     statusBar()->insertPermanentWidget(0, statusProgressBar, 1);
204     statusBar()->insertPermanentWidget(1, statusLabel, 1);
205     statusBar()->insertPermanentWidget(ID_TIMELINE_BUTTONS, w);
206     statusBar()->insertPermanentFixedItem("00:00:00:00", ID_TIMELINE_POS);
207     statusBar()->insertPermanentWidget(ID_TIMELINE_FORMAT, m_timecodeFormat);
208     statusBar()->setMaximumHeight(statusBar()->font().pointSize() * 4);
209
210     timeline_buttons_ui.buttonVideo->setIcon(KIcon("video-mpeg"));
211     timeline_buttons_ui.buttonVideo->setToolTip(i18n("Show video thumbnails"));
212     timeline_buttons_ui.buttonAudio->setIcon(KIcon("audio-mpeg"));
213     timeline_buttons_ui.buttonAudio->setToolTip(i18n("Show audio thumbnails"));
214     timeline_buttons_ui.buttonFitZoom->setIcon(KIcon("zoom-fit-best"));
215     timeline_buttons_ui.buttonFitZoom->setToolTip(i18n("Fit zoom to project"));
216
217     setupGUI(Default, NULL /*"kdenliveui.rc"*/);
218     kDebug() << factory() << " " << factory()->container("video_effects_menu", this);
219
220     // build effects menus
221     QAction *action;
222     QMenu *videoEffectsMenu = (QMenu*)(factory()->container("video_effects_menu", this));
223     QStringList effects = videoEffects.effectNames();
224     foreach(QString name, effects) {
225         action = new QAction(name, this);
226         action->setData(name);
227         videoEffectsMenu->addAction(action);
228     }
229     QMenu *audioEffectsMenu = (QMenu*)(factory()->container("audio_effects_menu", this));
230     effects = audioEffects.effectNames();
231     foreach(QString name, effects) {
232         action = new QAction(name, this);
233         action->setData(name);
234         audioEffectsMenu->addAction(action);
235     }
236     QMenu *customEffectsMenu = (QMenu*)(factory()->container("custom_effects_menu", this));
237     effects = customEffects.effectNames();
238     foreach(QString name, effects) {
239         action = new QAction(name, this);
240         action->setData(name);
241         customEffectsMenu->addAction(action);
242     }
243
244     connect(videoEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
245     connect(audioEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddAudioEffect(QAction *)));
246     connect(customEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddCustomEffect(QAction *)));
247
248     m_timelineContextMenu = new QMenu(this);
249     m_timelineContextClipMenu = new QMenu(this);
250     m_timelineContextTransitionMenu = new QMenu(this);
251
252     action = actionCollection()->action("delete_timeline_clip");
253     m_timelineContextClipMenu->addAction(action);
254     m_timelineContextClipMenu->addMenu(videoEffectsMenu);
255     m_timelineContextClipMenu->addMenu(audioEffectsMenu);
256     m_timelineContextClipMenu->addMenu(customEffectsMenu);
257
258     connect(projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
259     connect(clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
260     //connect(m_monitorManager, SIGNAL(connectMonitors()), this, SLOT(slotConnectMonitors()));
261     connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), this, SLOT(slotRaiseMonitor(bool)));
262     connect(m_effectList, SIGNAL(addEffect(QDomElement)), this, SLOT(slotAddEffect(QDomElement)));
263     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
264     slotConnectMonitors();
265
266     setAutoSaveSettings();
267     newFile();
268
269     activateShuttleDevice();
270 }
271
272 void MainWindow::queryQuit() {
273     kDebug() << "----- SAVING CONFUIG";
274     if (queryClose()) kapp->quit();
275 }
276
277 //virtual
278 bool MainWindow::queryClose() {
279     saveOptions();
280     if (m_activeDocument && m_activeDocument->isModified()) {
281         switch (KMessageBox::warningYesNoCancel(this, i18n("Save changes to document ?"))) {
282         case KMessageBox::Yes :
283             // save document here. If saving fails, return false;
284             return true;
285         case KMessageBox::No :
286             return true;
287         default: // cancel
288             return false;
289         }
290     }
291     return true;
292 }
293
294 void MainWindow::activateShuttleDevice() {
295     if (m_jogProcess) delete m_jogProcess;
296     m_jogProcess = NULL;
297     if (KdenliveSettings::enableshuttle() == false) return;
298     m_jogProcess = new JogShuttle(KdenliveSettings::shuttledevice());
299     connect(m_jogProcess, SIGNAL(rewind1()), m_monitorManager, SLOT(slotRewindOneFrame()));
300     connect(m_jogProcess, SIGNAL(forward1()), m_monitorManager, SLOT(slotForwardOneFrame()));
301     connect(m_jogProcess, SIGNAL(rewind(double)), m_monitorManager, SLOT(slotRewind(double)));
302     connect(m_jogProcess, SIGNAL(forward(double)), m_monitorManager, SLOT(slotForward(double)));
303     connect(m_jogProcess, SIGNAL(stop()), m_monitorManager, SLOT(slotPlay()));
304     connect(m_jogProcess, SIGNAL(button(int)), this, SLOT(slotShuttleButton(int)));
305 }
306
307 void MainWindow::slotShuttleButton(int code) {
308     switch (code) {
309     case 5:
310         slotShuttleAction(KdenliveSettings::shuttle1());
311         break;
312     case 6:
313         slotShuttleAction(KdenliveSettings::shuttle2());
314         break;
315     case 7:
316         slotShuttleAction(KdenliveSettings::shuttle3());
317         break;
318     case 8:
319         slotShuttleAction(KdenliveSettings::shuttle4());
320         break;
321     case 9:
322         slotShuttleAction(KdenliveSettings::shuttle5());
323         break;
324     }
325 }
326
327 void MainWindow::slotShuttleAction(int code) {
328     switch (code) {
329     case 0:
330         return;
331     case 1:
332         m_monitorManager->slotPlay();
333         break;
334     default:
335         m_monitorManager->slotPlay();
336         break;
337     }
338 }
339
340 void MainWindow::slotFullScreen() {
341     //KToggleFullScreenAction::setFullScreen(this, actionCollection()->action("fullscreen")->isChecked());
342 }
343
344 void MainWindow::slotAddEffect(QDomElement effect, GenTime pos, int track) {
345     if (!m_activeDocument) return;
346     if (effect.isNull()) {
347         kDebug() << "--- ERROR, TRYING TO APPEND NULL EFFECT";
348         return;
349     }
350     TrackView *currentTimeLine = (TrackView *) m_timelineArea->currentWidget();
351     currentTimeLine->projectView()->slotAddEffect(effect, pos, track);
352 }
353
354 void MainWindow::slotRaiseMonitor(bool clipMonitor) {
355     if (clipMonitor) clipMonitorDock->raise();
356     else projectMonitorDock->raise();
357 }
358
359 void MainWindow::slotSetClipDuration(int id, int duration) {
360     if (!m_activeDocument) return;
361     m_activeDocument->setProducerDuration(id, duration);
362 }
363
364 void MainWindow::slotConnectMonitors() {
365
366     m_projectList->setRenderer(m_clipMonitor->render);
367     connect(m_projectList, SIGNAL(clipSelected(const QDomElement &)), m_clipMonitor, SLOT(slotSetXml(const QDomElement &)));
368     connect(m_projectList, SIGNAL(receivedClipDuration(int, int)), this, SLOT(slotSetClipDuration(int, int)));
369     connect(m_projectList, SIGNAL(showClipProperties(DocClipBase *)), this, SLOT(slotShowClipProperties(DocClipBase *)));
370     connect(m_projectList, SIGNAL(getFileProperties(const QDomElement &, int)), m_clipMonitor->render, SLOT(getFileProperties(const QDomElement &, int)));
371     connect(m_clipMonitor->render, SIGNAL(replyGetImage(int, int, const QPixmap &, int, int)), m_projectList, SLOT(slotReplyGetImage(int, int, const QPixmap &, int, int)));
372     connect(m_clipMonitor->render, SIGNAL(replyGetFileProperties(int, const QMap < QString, QString > &, const QMap < QString, QString > &)), m_projectList, SLOT(slotReplyGetFileProperties(int, const QMap < QString, QString > &, const QMap < QString, QString > &)));
373 }
374
375 void MainWindow::setupActions() {
376     KAction* clearAction = new KAction(this);
377     clearAction->setText(i18n("Clear"));
378     clearAction->setIcon(KIcon("document-new"));
379     clearAction->setShortcut(Qt::CTRL + Qt::Key_W);
380     actionCollection()->addAction("clear", clearAction);
381     /*connect(clearAction, SIGNAL(triggered(bool)),
382             textArea, SLOT(clear()));*/
383
384     KAction* profilesAction = new KAction(this);
385     profilesAction->setText(i18n("Manage Profiles"));
386     profilesAction->setIcon(KIcon("document-new"));
387     actionCollection()->addAction("manage_profiles", profilesAction);
388     connect(profilesAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProfiles()));
389
390     KAction* projectAction = new KAction(this);
391     projectAction->setText(i18n("Project Settings"));
392     projectAction->setIcon(KIcon("document-new"));
393     actionCollection()->addAction("project_settings", projectAction);
394     connect(projectAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProjectSettings()));
395
396     KAction* projectRender = new KAction(this);
397     projectRender->setText(i18n("Render Project"));
398     projectRender->setIcon(KIcon("document-new"));
399     actionCollection()->addAction("project_render", projectRender);
400     connect(projectRender, SIGNAL(triggered(bool)), this, SLOT(slotRenderProject()));
401
402     KAction* monitorPlay = new KAction(this);
403     monitorPlay->setText(i18n("Play"));
404     monitorPlay->setIcon(KIcon("media-playback-start"));
405     monitorPlay->setShortcut(Qt::Key_Space);
406     actionCollection()->addAction("monitor_play", monitorPlay);
407     connect(monitorPlay, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotPlay()));
408
409     KAction* monitorSeekBackward = new KAction(this);
410     monitorSeekBackward->setText(i18n("Rewind"));
411     monitorSeekBackward->setIcon(KIcon("media-seek-backward"));
412     monitorSeekBackward->setShortcut(Qt::Key_J);
413     actionCollection()->addAction("monitor_seek_backward", monitorSeekBackward);
414     connect(monitorSeekBackward, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotRewind()));
415
416     KAction* monitorSeekBackwardOneFrame = new KAction(this);
417     monitorSeekBackwardOneFrame->setText(i18n("Rewind 1 Frame"));
418     monitorSeekBackwardOneFrame->setIcon(KIcon("media-skip-backward"));
419     monitorSeekBackwardOneFrame->setShortcut(Qt::Key_Left);
420     actionCollection()->addAction("monitor_seek_backward-one-frame", monitorSeekBackwardOneFrame);
421     connect(monitorSeekBackwardOneFrame, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotRewindOneFrame()));
422
423     KAction* monitorSeekForward = new KAction(this);
424     monitorSeekForward->setText(i18n("Forward"));
425     monitorSeekForward->setIcon(KIcon("media-seek-forward"));
426     monitorSeekForward->setShortcut(Qt::Key_L);
427     actionCollection()->addAction("monitor_seek_forward", monitorSeekForward);
428     connect(monitorSeekForward, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotForward()));
429
430     KAction* monitorSeekForwardOneFrame = new KAction(this);
431     monitorSeekForwardOneFrame->setText(i18n("Forward 1 Frame"));
432     monitorSeekForwardOneFrame->setIcon(KIcon("media-skip-forward"));
433     monitorSeekForwardOneFrame->setShortcut(Qt::Key_Right);
434     actionCollection()->addAction("monitor_seek_forward-one-frame", monitorSeekForwardOneFrame);
435     connect(monitorSeekForwardOneFrame, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotForwardOneFrame()));
436
437     KAction* deleteTimelineClip = new KAction(this);
438     deleteTimelineClip->setText(i18n("Delete Clip"));
439     deleteTimelineClip->setShortcut(Qt::Key_Delete);
440     deleteTimelineClip->setIcon(KIcon("edit-delete"));
441     actionCollection()->addAction("delete_timeline_clip", deleteTimelineClip);
442     connect(deleteTimelineClip, SIGNAL(triggered(bool)), this, SLOT(slotDeleteTimelineClip()));
443
444     KStandardAction::quit(this, SLOT(queryQuit()),
445                           actionCollection());
446
447     KStandardAction::open(this, SLOT(openFile()),
448                           actionCollection());
449
450     m_fileOpenRecent = KStandardAction::openRecent(this, SLOT(openFile(const KUrl &)),
451                        actionCollection());
452
453     KStandardAction::save(this, SLOT(saveFile()),
454                           actionCollection());
455
456     KStandardAction::saveAs(this, SLOT(saveFileAs()),
457                             actionCollection());
458
459     KStandardAction::openNew(this, SLOT(newFile()),
460                              actionCollection());
461
462     KStandardAction::preferences(this, SLOT(slotPreferences()),
463                                  actionCollection());
464
465     KStandardAction::undo(this, SLOT(undo()),
466                           actionCollection());
467
468     KStandardAction::redo(this, SLOT(redo()),
469                           actionCollection());
470
471     KStandardAction::fullScreen(this, SLOT(slotFullScreen()), this, actionCollection());
472
473     connect(actionCollection(), SIGNAL(actionHovered(QAction*)),
474             this, SLOT(slotDisplayActionMessage(QAction*)));
475     //connect(actionCollection(), SIGNAL( clearStatusText() ),
476     //statusBar(), SLOT( clear() ) );
477
478     readOptions();
479 }
480
481 void MainWindow::undo() {
482     m_commandStack->undo();
483 }
484
485 void MainWindow::redo() {
486     m_commandStack->redo();
487 }
488
489 void MainWindow::slotDisplayActionMessage(QAction *a) {
490     statusBar()->showMessage(a->data().toString(), 3000);
491 }
492
493 void MainWindow::saveOptions() {
494     KdenliveSettings::self()->writeConfig();
495     KSharedConfigPtr config = KGlobal::config();
496     m_fileOpenRecent->saveEntries(KConfigGroup(config, "Recent Files"));
497     config->sync();
498 }
499
500 void MainWindow::readOptions() {
501     KSharedConfigPtr config = KGlobal::config();
502     m_fileOpenRecent->loadEntries(KConfigGroup(config, "Recent Files"));
503 }
504
505 void MainWindow::newFile() {
506     QString profileName;
507     KUrl projectFolder;
508     if (m_timelineArea->count() == 0) profileName = KdenliveSettings::default_profile();
509     else {
510         ProjectSettings *w = new ProjectSettings;
511         if (w->exec() != QDialog::Accepted) return;
512         profileName = w->selectedProfile();
513         projectFolder = w->selectedFolder();
514         delete w;
515     }
516     MltVideoProfile prof = ProfilesDialog::getVideoProfile(profileName);
517     if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
518     KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, prof, m_commandStack);
519     TrackView *trackView = new TrackView(doc, this);
520     m_timelineArea->addTab(trackView, KIcon("kdenlive"), i18n("Untitled") + " / " + prof.description);
521     if (m_timelineArea->count() == 1)
522         connectDocument(trackView, doc);
523     else m_timelineArea->setTabBarHidden(false);
524 }
525
526 void MainWindow::activateDocument() {
527     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
528     KdenliveDoc *currentDoc = currentTab->document();
529     connectDocument(currentTab, currentDoc);
530 }
531
532 void MainWindow::slotRemoveTab() {
533     QWidget *w = m_timelineArea->currentWidget();
534     // closing current document
535     int ix = m_timelineArea->currentIndex() + 1;
536     if (ix == m_timelineArea->count()) ix = 0;
537     m_timelineArea->setCurrentIndex(ix);
538     TrackView *tabToClose = (TrackView *) w;
539     KdenliveDoc *docToClose = tabToClose->document();
540     m_timelineArea->removeTab(m_timelineArea->indexOf(w));
541     if (m_timelineArea->count() == 1) m_timelineArea->setTabBarHidden(true);
542     delete docToClose;
543     delete w;
544 }
545
546 void MainWindow::saveFileAs(const QString &outputFileName) {
547     m_projectMonitor->saveSceneList(outputFileName, m_activeDocument->documentInfoXml());
548     m_activeDocument->setUrl(KUrl(outputFileName));
549     setCaption(m_activeDocument->description());
550     m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
551     m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), m_activeDocument->url().path());
552     m_activeDocument->setModified(false);
553 }
554
555 void MainWindow::saveFileAs() {
556     QString outputFile = KFileDialog::getSaveFileName();
557     if (QFile::exists(outputFile)) {
558         if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it ?")) == KMessageBox::No) return;
559     }
560     saveFileAs(outputFile);
561 }
562
563 void MainWindow::saveFile() {
564     if (!m_activeDocument) return;
565     if (m_activeDocument->url().isEmpty()) {
566         saveFileAs();
567     } else {
568         saveFileAs(m_activeDocument->url().path());
569     }
570 }
571
572 void MainWindow::openFile() { //changed
573     KUrl url = KFileDialog::getOpenUrl(KUrl(), "application/vnd.kde.kdenlive;*.kdenlive");
574     if (url.isEmpty()) return;
575     m_fileOpenRecent->addUrl(url);
576     openFile(url);
577 }
578
579 void MainWindow::openFile(const KUrl &url) { //new
580     //TODO: get video profile from url before opening it
581     MltVideoProfile prof = ProfilesDialog::getVideoProfile(KdenliveSettings::default_profile());
582     if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
583     KdenliveDoc *doc = new KdenliveDoc(url, KUrl(), prof, m_commandStack);
584     TrackView *trackView = new TrackView(doc, this);
585     m_timelineArea->setCurrentIndex(m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description()));
586     m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
587     if (m_timelineArea->count() > 1) m_timelineArea->setTabBarHidden(false);
588     //connectDocument(trackView, doc);
589 }
590
591
592 void MainWindow::parseProfiles() {
593     //kdDebug()<<" + + YOUR MLT INSTALL WAS FOUND IN: "<< MLT_PREFIX <<endl;
594
595     //KdenliveSettings::setDefaulttmpfolder();
596     if (KdenliveSettings::mltpath().isEmpty()) {
597         KdenliveSettings::setMltpath(QString(MLT_PREFIX) + QString("/share/mlt/profiles/"));
598     }
599     if (KdenliveSettings::rendererpath().isEmpty()) {
600         KdenliveSettings::setRendererpath(KStandardDirs::findExe("inigo"));
601     }
602     QStringList profilesFilter;
603     profilesFilter << "*";
604     QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
605
606     if (profilesList.isEmpty()) {
607         // Cannot find MLT path, try finding inigo
608         QString profilePath = KdenliveSettings::rendererpath();
609         if (!profilePath.isEmpty()) {
610             profilePath = profilePath.section('/', 0, -3);
611             KdenliveSettings::setMltpath(profilePath + "/share/mlt/profiles/");
612             QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
613         }
614
615         if (profilesList.isEmpty()) {
616             // Cannot find the MLT profiles, ask for location
617             KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your Mlt profiles, please give the path"), this);
618             getUrl->fileDialog()->setMode(KFile::Directory);
619             getUrl->exec();
620             KUrl mltPath = getUrl->selectedUrl();
621             delete getUrl;
622             if (mltPath.isEmpty()) exit(1);
623             KdenliveSettings::setMltpath(mltPath.path());
624             QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
625         }
626     }
627
628     if (KdenliveSettings::rendererpath().isEmpty()) {
629         // Cannot find the MLT inigo renderer, ask for location
630         KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find the inigo program required for rendering (part of Mlt)"), this);
631         getUrl->exec();
632         KUrl rendererPath = getUrl->selectedUrl();
633         delete getUrl;
634         if (rendererPath.isEmpty()) exit(1);
635         KdenliveSettings::setRendererpath(rendererPath.path());
636     }
637
638     kDebug() << "RESULTING MLT PATH: " << KdenliveSettings::mltpath();
639
640     // Parse MLT profiles to build a list of available video formats
641     if (profilesList.isEmpty()) parseProfiles();
642 }
643
644
645 void MainWindow::slotEditProfiles() {
646     ProfilesDialog *w = new ProfilesDialog;
647     w->exec();
648     delete w;
649 }
650
651 void MainWindow::slotEditProjectSettings() {
652     ProjectSettings *w = new ProjectSettings;
653     if (w->exec() == QDialog::Accepted) {
654         QString profile = w->selectedProfile();
655         m_activeDocument->setProfilePath(profile);
656         m_monitorManager->resetProfiles(profile);
657         setCaption(m_activeDocument->description());
658         KdenliveSettings::setCurrent_profile(m_activeDocument->profilePath());
659         if (m_renderWidget) m_renderWidget->setDocumentStandard(m_activeDocument->getDocumentStandard());
660         m_monitorManager->setTimecode(m_activeDocument->timecode());
661         m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
662
663         // We need to desactivate & reactivate monitors to get a refresh
664         m_monitorManager->switchMonitors();
665     }
666     delete w;
667 }
668
669 void MainWindow::slotRenderProject() {
670     if (!m_renderWidget) {
671         m_renderWidget = new RenderWidget(this);
672         connect(m_renderWidget, SIGNAL(doRender(const QString&, const QString&, const QStringList &, bool, bool)), this, SLOT(slotDoRender(const QString&, const QString&, const QStringList &, bool, bool)));
673     }
674     /*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
675     if (currentTab) m_renderWidget->setTimeline(currentTab);
676     m_renderWidget->setDocument(m_activeDocument);*/
677     m_renderWidget->show();
678 }
679
680 void MainWindow::slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter) {
681     if (dest.isEmpty()) return;
682     int in;
683     int out;
684     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
685     if (currentTab && zoneOnly) {
686         in = currentTab->inPoint();
687         out = currentTab->outPoint();
688     }
689     KTemporaryFile temp;
690     temp.setAutoRemove(false);
691     temp.setSuffix(".westley");
692     if (temp.open()) {
693         m_projectMonitor->saveSceneList(temp.fileName());
694         QStringList args;
695         args << "-erase";
696         if (zoneOnly) args << "in=" + QString::number(in) << "out=" + QString::number(out);
697         QString videoPlayer = "-";
698         if (playAfter) videoPlayer = "kmplayer";
699         args << "inigo" << m_activeDocument->profilePath() << render << videoPlayer << temp.fileName() << dest << avformat_args;
700         QProcess::startDetached("kdenlive_render", args);
701     }
702 }
703
704 void MainWindow::slotUpdateMousePosition(int pos) {
705     if (m_activeDocument)
706         switch (m_timecodeFormat->currentIndex()) {
707         case 0:
708             statusBar()->changeItem(m_activeDocument->timecode().getTimecodeFromFrames(pos), ID_TIMELINE_POS);
709             break;
710         default:
711             statusBar()->changeItem(QString::number(pos), ID_TIMELINE_POS);
712         }
713 }
714
715 void MainWindow::slotUpdateDocumentState(bool modified) {
716     setCaption(m_activeDocument->description(), modified);
717     if (modified) {
718         m_timelineArea->setTabTextColor(m_timelineArea->currentIndex(), palette().color(QPalette::Link));
719         m_timelineArea->setTabIcon(m_timelineArea->currentIndex(), KIcon("document-save"));
720     } else {
721         m_timelineArea->setTabTextColor(m_timelineArea->currentIndex(), palette().color(QPalette::Text));
722         m_timelineArea->setTabIcon(m_timelineArea->currentIndex(), KIcon("kdenlive"));
723     }
724 }
725
726 void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //changed
727     //m_projectMonitor->stop();
728     kDebug() << "///////////////////   CONNECTING DOC TO PROJECT VIEW ////////////////";
729     if (m_activeDocument) {
730         if (m_activeDocument == doc) return;
731         m_activeDocument->backupMltPlaylist();
732         if (m_activeTimeline) {
733             disconnect(m_projectMonitor, SIGNAL(renderPosition(int)), m_activeTimeline, SLOT(moveCursorPos(int)));
734             disconnect(m_projectMonitor, SIGNAL(durationChanged(int)), m_activeTimeline, SLOT(setDuration(int)));
735             disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *)), m_projectList, SLOT(slotAddClip(DocClipBase *)));
736             disconnect(m_activeDocument, SIGNAL(addProjectFolder(const QString, int, bool, bool)), m_projectList, SLOT(slotAddFolder(const QString, int, bool, bool)));
737             disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(int)), m_projectList, SLOT(slotDeleteClip(int)));
738             disconnect(m_activeDocument, SIGNAL(updateClipDisplay(int)), m_projectList, SLOT(slotUpdateClip(int)));
739             disconnect(m_activeDocument, SIGNAL(refreshClipThumbnail(int)), m_projectList, SLOT(slotRefreshClipThumbnail(int)));
740             disconnect(m_activeDocument, SIGNAL(deletTimelineClip(int)), m_activeTimeline, SLOT(slotDeleteClip(int)));
741             disconnect(m_activeDocument, SIGNAL(thumbsProgress(KUrl, int)), this, SLOT(slotGotProgressInfo(KUrl, int)));
742             disconnect(m_activeTimeline, SIGNAL(clipItemSelected(ClipItem*)), effectStack, SLOT(slotClipItemSelected(ClipItem*)));
743             disconnect(trackView, SIGNAL(clipItemSelected(ClipItem*)), this, SLOT(slotActivateEffectStackView()));
744             disconnect(m_activeTimeline, SIGNAL(transitionItemSelected(Transition*)), transitionConfig, SLOT(slotTransitionItemSelected(Transition*)));
745             disconnect(trackView, SIGNAL(transitionItemSelected(Transition*)), this, SLOT(slotActivateTransitionView()));
746             disconnect(timeline_buttons_ui.zoom_slider, SIGNAL(valueChanged(int)), m_activeTimeline, SLOT(slotChangeZoom(int)));
747             disconnect(m_activeDocument, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
748             disconnect(effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement)));
749             disconnect(effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
750             disconnect(effectStack, SIGNAL(changeEffectState(ClipItem*, QDomElement, bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*, QDomElement, bool)));
751             disconnect(effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
752             disconnect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
753             disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
754         }
755         m_activeDocument->setRenderer(NULL);
756         disconnect(m_projectList, SIGNAL(clipSelected(const QDomElement &)), m_clipMonitor, SLOT(slotSetXml(const QDomElement &)));
757         m_clipMonitor->stop();
758     }
759     m_monitorManager->resetProfiles(doc->profilePath());
760     m_projectList->setDocument(doc);
761     connect(m_projectList, SIGNAL(clipSelected(const QDomElement &)), m_clipMonitor, SLOT(slotSetXml(const QDomElement &)));
762     connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
763     connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
764     connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
765     connect(m_projectMonitor, SIGNAL(durationChanged(int)), trackView, SLOT(setDuration(int)));
766     connect(doc, SIGNAL(addProjectClip(DocClipBase *)), m_projectList, SLOT(slotAddClip(DocClipBase *)));
767     connect(doc, SIGNAL(addProjectFolder(const QString, int, bool, bool)), m_projectList, SLOT(slotAddFolder(const QString, int, bool, bool)));
768     connect(doc, SIGNAL(signalDeleteProjectClip(int)), m_projectList, SLOT(slotDeleteClip(int)));
769     connect(doc, SIGNAL(updateClipDisplay(int)), m_projectList, SLOT(slotUpdateClip(int)));
770     connect(doc, SIGNAL(refreshClipThumbnail(int)), m_projectList, SLOT(slotRefreshClipThumbnail(int)));
771
772     connect(doc, SIGNAL(deletTimelineClip(int)), trackView, SLOT(slotDeleteClip(int)));
773     connect(doc, SIGNAL(thumbsProgress(KUrl, int)), this, SLOT(slotGotProgressInfo(KUrl, int)));
774     connect(doc, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
775
776
777
778     connect(trackView, SIGNAL(clipItemSelected(ClipItem*)), effectStack, SLOT(slotClipItemSelected(ClipItem*)));
779     connect(trackView, SIGNAL(clipItemSelected(ClipItem*)), this, SLOT(slotActivateEffectStackView()));
780     connect(trackView, SIGNAL(transitionItemSelected(Transition*)), transitionConfig, SLOT(slotTransitionItemSelected(Transition*)));
781     connect(trackView, SIGNAL(transitionItemSelected(Transition*)), this, SLOT(slotActivateTransitionView()));
782     timeline_buttons_ui.zoom_slider->setValue(trackView->currentZoom());
783     connect(timeline_buttons_ui.zoom_slider, SIGNAL(valueChanged(int)), trackView, SLOT(slotChangeZoom(int)));
784     connect(trackView->projectView(), SIGNAL(zoomIn()), this, SLOT(slotZoomIn()));
785     connect(trackView->projectView(), SIGNAL(zoomOut()), this, SLOT(slotZoomOut()));
786     connect(effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement)), trackView->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement)));
787     connect(effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
788     connect(effectStack, SIGNAL(changeEffectState(ClipItem*, QDomElement, bool)), trackView->projectView(), SLOT(slotChangeEffectState(ClipItem*, QDomElement, bool)));
789     connect(effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
790     connect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
791     connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
792     trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu);
793     m_activeTimeline = trackView;
794     KdenliveSettings::setCurrent_profile(doc->profilePath());
795     if (m_renderWidget) m_renderWidget->setDocumentStandard(doc->getDocumentStandard());
796     m_monitorManager->setTimecode(doc->timecode());
797     doc->setRenderer(m_projectMonitor->render);
798     m_commandStack->setActiveStack(doc->commandStack());
799     if (m_commandStack->isClean()) kDebug() << "////////////  UNDO STACK IS CLEAN";
800     else  kDebug() << "////////////  UNDO STACK IS NOT CLEAN*******************";
801
802     m_overView->setScene(trackView->projectScene());
803     //m_overView->scale(m_overView->width() / trackView->duration(), m_overView->height() / (50 * trackView->tracksNumber()));
804     //m_overView->fitInView(m_overView->itemAt(0, 50), Qt::KeepAspectRatio);
805
806     setCaption(doc->description());
807     m_activeDocument = doc;
808 }
809
810 void MainWindow::slotPreferences() {
811     //An instance of your dialog could be already created and could be
812     // cached, in which case you want to display the cached dialog
813     // instead of creating another one
814     if (KConfigDialog::showDialog("settings"))
815         return;
816
817     // KConfigDialog didn't find an instance of this dialog, so lets
818     // create it :
819     KdenliveSettingsDialog* dialog = new KdenliveSettingsDialog(this);
820     connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
821     dialog->show();
822 }
823
824 void MainWindow::updateConfiguration() {
825     //TODO: we should apply settings to all projects, not only the current one
826     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
827     if (currentTab) {
828         currentTab->refresh();
829         currentTab->projectView()->checkAutoScroll();
830         currentTab->projectView()->checkTrackHeight();
831         if (m_activeDocument) m_activeDocument->clipManager()->checkAudioThumbs();
832     }
833     timeline_buttons_ui.buttonAudio->setDown(KdenliveSettings::audiothumbnails());
834     timeline_buttons_ui.buttonVideo->setDown(KdenliveSettings::videothumbnails());
835     activateShuttleDevice();
836
837 }
838
839 void MainWindow::slotSwitchVideoThumbs() {
840     KdenliveSettings::setVideothumbnails(!KdenliveSettings::videothumbnails());
841     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
842     if (currentTab) {
843         currentTab->refresh();
844     }
845     timeline_buttons_ui.buttonVideo->setDown(KdenliveSettings::videothumbnails());
846 }
847
848 void MainWindow::slotSwitchAudioThumbs() {
849     KdenliveSettings::setAudiothumbnails(!KdenliveSettings::audiothumbnails());
850     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
851     if (currentTab) {
852         currentTab->refresh();
853         currentTab->projectView()->checkAutoScroll();
854         if (m_activeDocument) m_activeDocument->clipManager()->checkAudioThumbs();
855     }
856     timeline_buttons_ui.buttonAudio->setDown(KdenliveSettings::audiothumbnails());
857 }
858
859 void MainWindow::slotDeleteTimelineClip() {
860     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
861     if (currentTab) {
862         currentTab->projectView()->deleteSelectedClips();
863     }
864 }
865
866 void MainWindow::slotAddProjectClip(KUrl url) {
867     if (m_activeDocument)
868         m_activeDocument->slotAddClipFile(url, QString());
869 }
870
871 void MainWindow::slotAddVideoEffect(QAction *result) {
872     if (!result) return;
873     QDomElement effect = videoEffects.getEffectByName(result->data().toString());
874     slotAddEffect(effect);
875 }
876
877 void MainWindow::slotAddAudioEffect(QAction *result) {
878     if (!result) return;
879     QDomElement effect = audioEffects.getEffectByName(result->data().toString());
880     slotAddEffect(effect);
881 }
882
883 void MainWindow::slotAddCustomEffect(QAction *result) {
884     if (!result) return;
885     QDomElement effect = customEffects.getEffectByName(result->data().toString());
886     slotAddEffect(effect);
887 }
888
889 void MainWindow::slotZoomIn() {
890     timeline_buttons_ui.zoom_slider->setValue(timeline_buttons_ui.zoom_slider->value() - 1);
891 }
892
893 void MainWindow::slotZoomOut() {
894     timeline_buttons_ui.zoom_slider->setValue(timeline_buttons_ui.zoom_slider->value() + 1);
895 }
896
897 void MainWindow::slotFitZoom() {
898     TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
899     if (currentTab) {
900         timeline_buttons_ui.zoom_slider->setValue(currentTab->fitZoom());
901     }
902 }
903
904 void MainWindow::slotGotProgressInfo(KUrl url, int progress) {
905     statusProgressBar->setValue(progress);
906     if (progress > 0) {
907         statusLabel->setText(tr("Creating Audio Thumbs"));
908         statusProgressBar->setVisible(true);
909     } else {
910         statusLabel->setText("");
911         statusProgressBar->setVisible(false);
912     }
913 }
914
915 void MainWindow::slotShowClipProperties(DocClipBase *clip) {
916     if (clip->clipType() == TEXT) {
917         m_activeDocument->editTextClip(clip->getProperty("xml"), clip->getId());
918         return;
919     }
920     ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
921     if (dia.exec() == QDialog::Accepted) {
922         m_projectList->slotUpdateClipProperties(dia.clipId(), dia.properties());
923     }
924 }
925
926 void MainWindow::customEvent(QEvent* e) {
927     if (e->type() == QEvent::User) {
928         // The timeline playing position changed...
929         kDebug() << "RECIEVED JOG EVEMNT!!!";
930     }
931 }
932 void MainWindow::slotActivateEffectStackView() {
933     effectStack->raiseWindow(effectStackDock);
934 }
935
936 void MainWindow::slotActivateTransitionView() {
937     transitionConfig->raiseWindow(transitionConfigDock);
938 }
939 #include "mainwindow.moc"