]> git.sesse.net Git - kdenlive/commitdiff
Add non realtime preview mode to Kdenlive (available from monitor context menu)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 18 Jun 2009 06:41:26 +0000 (06:41 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 18 Jun 2009 06:41:26 +0000 (06:41 +0000)
svn path=/trunk/kdenlive/; revision=3567

src/monitor.cpp
src/monitor.h
src/renderer.cpp
src/renderer.h

index cafe772bba346c8d1f3b17dacf677e9d8b0fccca..5daa2c771807229ff38e3ea2aca6ad00ac90c284 100644 (file)
@@ -186,7 +186,14 @@ void Monitor::setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMe
     showTips->setCheckable(true);
     connect(showTips, SIGNAL(toggled(bool)), this, SLOT(slotSwitchMonitorInfo(bool)));
     showTips->setChecked(KdenliveSettings::displayMonitorInfo());
+
+    QAction *dropFrames = m_contextMenu->addAction(KIcon(), i18n("Real time (drop frames)"));
+    dropFrames->setCheckable(true);
+    dropFrames->setChecked(true);
+    connect(dropFrames, SIGNAL(toggled(bool)), this, SLOT(slotSwitchDropFrames(bool)));
+
     m_configMenu->addAction(showTips);
+    m_configMenu->addAction(dropFrames);
 
 }
 
@@ -734,6 +741,11 @@ void Monitor::setClipZone(QPoint pos)
     m_currentClip->setZone(pos);
 }
 
+void Monitor::slotSwitchDropFrames(bool show)
+{
+    render->setDropFrames(show);
+}
+
 void Monitor::slotSwitchMonitorInfo(bool show)
 {
     KdenliveSettings::setDisplayMonitorInfo(show);
@@ -748,6 +760,7 @@ void Monitor::slotSwitchMonitorInfo(bool show)
     }
 }
 
+
 MonitorRefresh::MonitorRefresh(QWidget* parent) : \
         QWidget(parent),
         m_renderer(NULL)
index fbe9ee8358ba4c05fe70563f5a488bd5553b0deb..accd3aac0a6b8eb9eeb8977d45b6963511fba48e 100644 (file)
@@ -125,6 +125,7 @@ private slots:
     void slotSeek();
     void setClipZone(QPoint pos);
     void slotSwitchMonitorInfo(bool show);
+    void slotSwitchDropFrames(bool show);
 
 public slots:
     void slotOpenFile(const QString &);
index 8b2afc740deb921b7968a8a6ba888b7a683da902..affbff833fb4770f008cbe7712f7dae0cbfcb030 100644 (file)
@@ -55,7 +55,7 @@ static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr
 
 Render::Render(const QString & rendererName, int winid, int /* extid */, QWidget *parent) :
         QObject(parent),
-        m_isBlocked(1),
+        m_isBlocked(0),
         m_name(rendererName),
         m_mltConsumer(NULL),
         m_mltProducer(NULL),
@@ -1222,7 +1222,7 @@ void Render::seekToFrame(int pos)
 void Render::askForRefresh()
 {
     // Use a Timer so that we don't refresh too much
-    m_refreshTimer->start(500);
+    m_refreshTimer->start(300);
 }
 
 void Render::doRefresh()
@@ -1241,6 +1241,17 @@ void Render::refresh()
     }
 }
 
+void Render::setDropFrames(bool show)
+{
+    if (m_mltConsumer) {
+        int dropFrames = 1;
+        if (show == false) dropFrames = 0;
+        m_mltConsumer->stop();
+        m_mltConsumer->set("play.real_time", dropFrames);
+        m_mltConsumer->start();
+    }
+}
+
 double Render::playSpeed()
 {
     if (m_mltProducer) return m_mltProducer->get_speed();
index 080e1294eb739b147d0eb62ae0e3886ca4fbc2ae..ecbf6bc3f376d95ffa5d71dc99e0350f9cec8566 100644 (file)
@@ -189,6 +189,7 @@ Q_OBJECT public:
 
     QList <Mlt::Producer *> producersList();
     void updatePreviewSettings();
+    void setDropFrames(bool show);
 
 private:   // Private attributes & methods
     /** The name of this renderer - useful to identify the renderes by what they do - e.g. background rendering, workspace monitor, etc... */