]> git.sesse.net Git - kdenlive/blobdiff - src/monitormanager.cpp
Fix version number (now 0.7), add myself as author
[kdenlive] / src / monitormanager.cpp
index e42d7eb74e08c91d228cb101622596c70e35570b..35c48917c9ac81ba77a94b2f9b889441f1695b9c 100644 (file)
@@ -26,8 +26,6 @@
 
 MonitorManager::MonitorManager(QWidget *parent)
         : QObject(parent) {
-
-
 }
 
 void MonitorManager::setTimecode(Timecode tc) {
@@ -41,23 +39,11 @@ Timecode MonitorManager::timecode() {
 void MonitorManager::initMonitors(Monitor *clipMonitor, Monitor *projectMonitor) {
     m_clipMonitor = clipMonitor;
     m_projectMonitor = projectMonitor;
-    //QTimer::singleShot(1750, this, SLOT(initClipMonitor()));
-    initClipMonitor();
-    //initProjectMonitor();
-}
-
-void MonitorManager::initClipMonitor() {
-    m_clipMonitor->initMonitor();
-    emit connectMonitors();
-    //initProjectMonitor();
-    //QTimer::singleShot(1500, this, SLOT(initProjectMonitor()));
 }
 
-void MonitorManager::initProjectMonitor() {
-    //m_clipMonitor->stop();
-    m_projectMonitor->initMonitor();
-    // activateMonitor("project");
-    emit connectMonitors();
+bool MonitorManager::projectMonitorFocused() {
+    if (m_activeMonitor != "clip") return true;
+    return false;
 }
 
 void MonitorManager::activateMonitor(QString name) {
@@ -75,4 +61,59 @@ void MonitorManager::activateMonitor(QString name) {
     m_activeMonitor = name;
 }
 
+void MonitorManager::switchMonitors() {
+    if (m_activeMonitor == "clip") {
+        m_clipMonitor->stop();
+        m_projectMonitor->start();
+        m_projectMonitor->raise();
+        m_activeMonitor = m_projectMonitor->name();
+        emit raiseClipMonitor(false);
+    } else {
+        m_projectMonitor->stop();
+        m_clipMonitor->start();
+        m_activeMonitor = m_clipMonitor->name();
+        emit raiseClipMonitor(true);
+    }
+}
+
+void MonitorManager::slotPlay() {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotPlay();
+    else m_projectMonitor->slotPlay();
+}
+
+void MonitorManager::slotRewind(double speed) {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotRewind(speed);
+    else m_projectMonitor->slotRewind(speed);
+}
+
+void MonitorManager::slotForward(double speed) {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotForward(speed);
+    else m_projectMonitor->slotForward(speed);
+}
+
+void MonitorManager::slotRewindOneFrame() {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotRewindOneFrame();
+    else m_projectMonitor->slotRewindOneFrame();
+}
+
+void MonitorManager::slotForwardOneFrame() {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotForwardOneFrame();
+    else m_projectMonitor->slotForwardOneFrame();
+}
+
+void MonitorManager::slotStart() {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotStart();
+    else m_projectMonitor->slotStart();
+}
+
+void MonitorManager::slotEnd() {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotEnd();
+    else m_projectMonitor->slotEnd();
+}
+
+void MonitorManager::resetProfiles(QString prof) {
+    m_clipMonitor->resetProfile(prof);
+    m_projectMonitor->resetProfile(prof);
+}
+
 #include "monitormanager.moc"