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)
31 Timecode MonitorManager::timecode() {
35 void MonitorManager::initMonitors(Monitor *clipMonitor, Monitor *projectMonitor) {
36 m_clipMonitor = clipMonitor;
37 m_projectMonitor = projectMonitor;
40 void MonitorManager::activateMonitor(QString name) {
41 if (m_activeMonitor == name) return;
43 m_projectMonitor->stop();
44 m_clipMonitor->start();
45 emit raiseClipMonitor(true);
47 m_clipMonitor->stop();
48 m_projectMonitor->start();
49 m_projectMonitor->raise();
50 emit raiseClipMonitor(false);
52 m_activeMonitor = name;
55 void MonitorManager::switchMonitors() {
56 if (m_clipMonitor->isActive()) {
57 m_clipMonitor->stop();
58 m_projectMonitor->start();
59 m_projectMonitor->raise();
60 m_activeMonitor = m_projectMonitor->name();
61 emit raiseClipMonitor(false);
63 m_projectMonitor->stop();
64 m_clipMonitor->start();
65 m_activeMonitor = m_clipMonitor->name();
66 emit raiseClipMonitor(true);
70 void MonitorManager::stopActiveMonitor() {
71 if (m_clipMonitor->isActive()) m_clipMonitor->pause();
72 else m_projectMonitor->pause();
75 void MonitorManager::slotPlay() {
76 if (m_clipMonitor->isActive()) m_clipMonitor->slotPlay();
77 else m_projectMonitor->slotPlay();
80 void MonitorManager::slotRewind(double speed) {
81 if (m_clipMonitor->isActive()) m_clipMonitor->slotRewind(speed);
82 else m_projectMonitor->slotRewind(speed);
85 void MonitorManager::slotForward(double speed) {
86 if (m_clipMonitor->isActive()) m_clipMonitor->slotForward(speed);
87 else m_projectMonitor->slotForward(speed);
90 void MonitorManager::slotRewindOneFrame() {
91 if (m_clipMonitor->isActive()) m_clipMonitor->slotRewindOneFrame();
92 else m_projectMonitor->slotRewindOneFrame();
95 void MonitorManager::slotForwardOneFrame() {
96 if (m_clipMonitor->isActive()) m_clipMonitor->slotForwardOneFrame();
97 else m_projectMonitor->slotForwardOneFrame();
100 void MonitorManager::slotStart() {
101 if (m_clipMonitor->isActive()) m_clipMonitor->slotStart();
102 else m_projectMonitor->slotStart();
105 void MonitorManager::slotEnd() {
106 if (m_clipMonitor->isActive()) m_clipMonitor->slotEnd();
107 else m_projectMonitor->slotEnd();
110 void MonitorManager::resetProfiles(Timecode tc) {
115 void MonitorManager::slotResetProfiles() {
116 activateMonitor("clip");
117 m_clipMonitor->resetProfile();
118 activateMonitor("project");
119 m_projectMonitor->resetProfile();
120 //m_projectMonitor->refreshMonitor(true);
123 #include "monitormanager.moc"