1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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. *
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. *
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 ***************************************************************************/
24 #include "monitormanager.h"
25 #include <mlt++/Mlt.h>
27 MonitorManager::MonitorManager(QWidget *parent)
33 void MonitorManager::setTimecode(Timecode tc) {
37 Timecode MonitorManager::timecode() {
41 void MonitorManager::initMonitors(Monitor *clipMonitor, Monitor *projectMonitor) {
42 m_clipMonitor = clipMonitor;
43 m_projectMonitor = projectMonitor;
44 //QTimer::singleShot(1750, this, SLOT(initClipMonitor()));
46 //initProjectMonitor();
49 void MonitorManager::initClipMonitor() {
50 m_clipMonitor->initMonitor();
51 emit connectMonitors();
52 //initProjectMonitor();
53 //QTimer::singleShot(1500, this, SLOT(initProjectMonitor()));
56 void MonitorManager::initProjectMonitor() {
57 //m_clipMonitor->stop();
58 m_projectMonitor->initMonitor();
59 // activateMonitor("project");
60 emit connectMonitors();
63 void MonitorManager::activateMonitor(QString name) {
64 if (m_activeMonitor == name) return;
66 m_projectMonitor->stop();
67 m_clipMonitor->start();
68 emit raiseClipMonitor(true);
70 m_clipMonitor->stop();
71 m_projectMonitor->start();
72 m_projectMonitor->raise();
73 emit raiseClipMonitor(false);
75 m_activeMonitor = name;
78 void MonitorManager::slotPlay() {
79 if (m_activeMonitor == "clip") m_clipMonitor->slotPlay();
80 else m_projectMonitor->slotPlay();
83 void MonitorManager::resetProfiles(QString prof) {
84 m_clipMonitor->resetProfile(prof);
85 m_projectMonitor->resetProfile(prof);
88 #include "monitormanager.moc"