]> git.sesse.net Git - kdenlive/blobdiff - src/monitor.cpp
Rewrote DVD creation, should now support correctly 4:3 and 16:9 menus, letterbox...
[kdenlive] / src / monitor.cpp
index 529e6304ee53e0ef8d253c22f2fdf365b7c77419..02a9d92178e064c5042f6b2431f67c13afcca86c 100644 (file)
@@ -175,7 +175,6 @@ Monitor::Monitor(Kdenlive::MONITORID id, MonitorManager *manager, QString profil
     layout->addWidget(m_ruler);
     
     connect(m_audioSlider, SIGNAL(valueChanged(int)), this, SLOT(slotSetVolume(int)));
-    connect(m_ruler, SIGNAL(seekRenderer(int)), this, SLOT(slotSeek(int)));
     connect(render, SIGNAL(durationChanged(int)), this, SLOT(adjustRulerSize(int)));
     connect(render, SIGNAL(rendererStopped(int)), this, SLOT(rendererStopped(int)));
     connect(render, SIGNAL(rendererPosition(int)), this, SLOT(seekCursor(int)));
@@ -227,6 +226,7 @@ QWidget *Monitor::container()
 bool Monitor::createOpenGlWidget(QWidget *parent, const QString profile)
 {
     render = new Render(id(), 0, profile, this);
+    kDebug()<<"+++++++++++++\nCREATED OPENGL WIDG\n++++++++++++++";
     m_glWidget = new VideoGLWidget(parent);
     if (m_glWidget == NULL) {
         // Creation failed, we are in trouble...
@@ -367,8 +367,8 @@ void Monitor::updateMarkers(DocClipBase *source)
                 QAction *go = m_markerMenu->addAction(position);
                 go->setData(pos);
             }
-            m_ruler->setMarkers(marks);
-        } else m_ruler->setMarkers(QList <int>());
+        }
+       m_ruler->setMarkers(markers);
         m_markerMenu->setEnabled(!m_markerMenu->isEmpty());
     }
 }
@@ -710,7 +710,6 @@ void Monitor::slotForwardOneFrame(int diff)
 
 void Monitor::seekCursor(int pos)
 {
-    //slotActivateMonitor();
     if (m_ruler->slotNewValue(pos)) {
         checkOverlay();
         m_timePos->setValue(pos);
@@ -744,7 +743,7 @@ void Monitor::stop()
 void Monitor::start()
 {
     if (!isVisible() || !isActive()) return;
-    if (render) render->doRefresh();// start();
+    if (render) render->startConsumer();
 }
 
 void Monitor::refreshMonitor(bool visible)
@@ -788,6 +787,7 @@ void Monitor::slotPlay()
         m_playAction->setIcon(m_playIcon);
         render->switchPlay(false);
     }
+    m_ruler->refreshRuler();
 }
 
 void Monitor::slotPlayZone()
@@ -830,6 +830,7 @@ void Monitor::slotSetClipProducer(DocClipBase *clip, QPoint zone, bool forceUpda
 {
     if (render == NULL) return;
     if (clip == NULL && m_currentClip != NULL) {
+       m_currentClip->lastSeekPosition = render->seekFramePosition();
         kDebug()<<"// SETTING NULL CLIP MONITOR";
         m_currentClip = NULL;
         m_length = -1;
@@ -838,8 +839,9 @@ void Monitor::slotSetClipProducer(DocClipBase *clip, QPoint zone, bool forceUpda
     }
 
     if (clip != m_currentClip || forceUpdate) {
+       if (m_currentClip) m_currentClip->lastSeekPosition = render->seekFramePosition();
         m_currentClip = clip;
-        if (m_currentClip) slotActivateMonitor();
+       if (position == -1) position = clip->lastSeekPosition;
         updateMarkers(clip);
         Mlt::Producer *prod = NULL;
         if (clip) prod = clip->getCloneProducer();