]> git.sesse.net Git - kdenlive/blob - src/monitormanager.cpp
adapt to latest MLT changes
[kdenlive] / src / monitormanager.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 #include <QObject>
22 #include <QTimer>
23
24 #include "monitormanager.h"
25 #include <mlt++/Mlt.h>
26
27 MonitorManager::MonitorManager(QWidget *parent)
28     : QObject(parent)
29 {
30
31
32 }
33
34 void MonitorManager::setTimecode(Timecode tc)
35 {
36   m_timecode = tc;
37 }
38
39 Timecode MonitorManager::timecode()
40 {
41   return m_timecode;
42 }
43
44 void MonitorManager::initMonitors(Monitor *clipMonitor, Monitor *projectMonitor)
45 {
46   m_clipMonitor = clipMonitor;
47   m_projectMonitor = projectMonitor;
48   //QTimer::singleShot(1750, this, SLOT(initClipMonitor()));
49   initClipMonitor();
50   //initProjectMonitor();
51 }
52
53 void MonitorManager::initClipMonitor()
54 {
55   m_clipMonitor->initMonitor();
56   emit connectMonitors();
57   //initProjectMonitor();
58   //QTimer::singleShot(1500, this, SLOT(initProjectMonitor()));
59 }
60
61 void MonitorManager::initProjectMonitor()
62 {
63   //m_clipMonitor->stop();
64   m_projectMonitor->initMonitor();
65   // activateMonitor("project");
66   emit connectMonitors();
67 }
68
69 void MonitorManager::activateMonitor(QString name)
70 {
71   if (m_activeMonitor == name) return;
72   if (name == "clip") {
73     m_projectMonitor->stop();
74     m_clipMonitor->start();
75     emit raiseClipMonitor(true);
76   }
77   else {
78     m_clipMonitor->stop();
79     m_projectMonitor->start();
80     m_projectMonitor->raise();
81     emit raiseClipMonitor(false);
82   }
83   m_activeMonitor = name;
84 }
85
86 #include "monitormanager.moc"