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