[vlmc-devel] commit: EffectsEngine: Merging EffectList and MixerList. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Mon Aug 30 00:55:28 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Aug 29 23:01:23 2010 +0200| [94a45f310ce899c782d197d9327888d30ddc2440] | committer: Hugo Beauzée-Luyssen 

EffectsEngine: Merging EffectList and MixerList.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=94a45f310ce899c782d197d9327888d30ddc2440
---

 src/EffectsEngine/EffectsEngine.cpp |   29 +++++++----------------------
 src/EffectsEngine/EffectsEngine.h   |    7 ++-----
 src/Renderer/WorkflowRenderer.cpp   |    2 +-
 src/Workflow/TrackWorkflow.cpp      |    4 ++--
 src/Workflow/TrackWorkflow.h        |    2 +-
 src/Workflow/VideoClipWorkflow.cpp  |    2 +-
 6 files changed, 14 insertions(+), 32 deletions(-)

diff --git a/src/EffectsEngine/EffectsEngine.cpp b/src/EffectsEngine/EffectsEngine.cpp
index 12b280c..83e2dcb 100644
--- a/src/EffectsEngine/EffectsEngine.cpp
+++ b/src/EffectsEngine/EffectsEngine.cpp
@@ -179,7 +179,7 @@ EffectsEngine::saveFilters( const EffectList &effects, QXmlStreamWriter &project
 }
 
 void
-EffectsEngine::initFilters( const EffectList &effects, quint32 width, quint32 height )
+EffectsEngine::initEffects( const EffectList &effects, quint32 width, quint32 height )
 {
     EffectsEngine::EffectList::const_iterator   it = effects.begin();
     EffectsEngine::EffectList::const_iterator   ite = effects.end();
@@ -192,17 +192,17 @@ EffectsEngine::initFilters( const EffectList &effects, quint32 width, quint32 he
 }
 
 EffectsEngine::EffectHelper*
-EffectsEngine::getMixer( const MixerList &mixers, qint64 currentFrame )
+EffectsEngine::getMixer( const EffectList &mixers, qint64 currentFrame )
 {
-    MixerList::const_iterator       it = mixers.constBegin();
-    MixerList::const_iterator       ite = mixers.constEnd();
+    EffectList::const_iterator      it = mixers.constBegin();
+    EffectList::const_iterator      ite = mixers.constEnd();
 
     while ( it != ite )
     {
-        if ( it.key() <= currentFrame && currentFrame <= it.value()->end )
+        if ( (*it)->start <= currentFrame && currentFrame <= (*it)->end )
         {
-            Q_ASSERT( it.value()->effect->effect()->type() == Effect::Mixer2 );
-            return it.value();
+            Q_ASSERT( (*it)->effect->effect()->type() == Effect::Mixer2 );
+            return (*it);
         }
         ++it;
     }
@@ -210,21 +210,6 @@ EffectsEngine::getMixer( const MixerList &mixers, qint64 currentFrame )
 }
 
 void
-EffectsEngine::initMixers( const MixerList &mixers, quint32 width, quint32 height )
-{
-    if ( mixers.size() <= 0 )
-        return ;
-    EffectsEngine::MixerList::const_iterator   it = mixers.constBegin();
-    EffectsEngine::MixerList::const_iterator   ite = mixers.constEnd();
-
-    while ( it != ite )
-    {
-        it.value()->effect->init( width, height );
-        ++it;
-    }
-}
-
-void
 EffectsEngine::loadEffects()
 {
     //FIXME: What should we do for windows ?!
diff --git a/src/EffectsEngine/EffectsEngine.h b/src/EffectsEngine/EffectsEngine.h
index ed1dd1d..d473803 100644
--- a/src/EffectsEngine/EffectsEngine.h
+++ b/src/EffectsEngine/EffectsEngine.h
@@ -69,23 +69,20 @@ class   EffectsEngine : public QObject, public Singleton<EffectsEngine>
             QUuid           uuid;
         };
         typedef QList<EffectHelper*>            EffectList;
-        typedef QHash<qint64, EffectHelper*>    MixerList;
         static const quint32                    MaxFramesForMixer = 3;
 
         Effect*     effect( const QString& name );
         bool        loadEffect( const QString& fileName );
         void        loadEffects();
 
+        static void     initEffects( const EffectList &effects, quint32 width, quint32 height );
         //Filters methods:
         static quint32  *applyFilters( const EffectList &effects,
                                   const Workflow::Frame *frame, qint64 currentFrame, double time );
         static void     saveFilters( const EffectList &effects, QXmlStreamWriter &project );
-        static void     initFilters( const EffectList &effects, quint32 width, quint32 height );
 
         //Mixers methods:
-        static EffectHelper     *getMixer( const MixerList& mixers, qint64 currentFrame );
-        static void             initMixers( const MixerList& mixers, quint32 width,
-                                            quint32 height );
+        static EffectHelper     *getMixer( const EffectList &mixers, qint64 currentFrame );
 
     private:
         EffectsEngine();
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 84d1544..dbeed62 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -245,7 +245,7 @@ void        WorkflowRenderer::startPreview()
         setupRenderer( m_width, m_height, m_outputFps );
     }
     QReadLocker     lock( m_effectsLock );
-    EffectsEngine::initFilters( m_filters, m_width, m_height );
+    EffectsEngine::initEffects( m_filters, m_width, m_height );
 
     //Deactivating vlc's keyboard inputs.
     m_mediaPlayer->setKeyInput( false );
diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 5e35c04..1c286a2 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -576,8 +576,8 @@ TrackWorkflow::initRender( quint32 width, quint32 height, double fps )
         ++it;
     }
     QReadLocker     lock2( m_effectsLock );
-    EffectsEngine::initMixers( m_mixers, width, height );
-    EffectsEngine::initFilters( m_filters, width, height );
+    EffectsEngine::initEffects( m_mixers, width, height );
+    EffectsEngine::initEffects( m_filters, width, height );
 }
 
 bool
diff --git a/src/Workflow/TrackWorkflow.h b/src/Workflow/TrackWorkflow.h
index 6609624..6fb86a4 100644
--- a/src/Workflow/TrackWorkflow.h
+++ b/src/Workflow/TrackWorkflow.h
@@ -113,7 +113,7 @@ class   TrackWorkflow : public QObject
     private:
         QMap<qint64, ClipWorkflow*>             m_clips;
         QReadWriteLock                          *m_effectsLock;
-        EffectsEngine::MixerList                m_mixers;
+        EffectsEngine::EffectList               m_mixers;
         EffectsEngine::EffectList               m_filters;
 
         /**
diff --git a/src/Workflow/VideoClipWorkflow.cpp b/src/Workflow/VideoClipWorkflow.cpp
index ae56f1d..48e5a72 100644
--- a/src/Workflow/VideoClipWorkflow.cpp
+++ b/src/Workflow/VideoClipWorkflow.cpp
@@ -104,7 +104,7 @@ VideoClipWorkflow::initVlcOutput()
     m_vlcMedia->addOption( buffer );
 
     QReadLocker     lock( m_effectsLock );
-    EffectsEngine::initFilters( m_filters, m_width, m_height );
+    EffectsEngine::initEffects( m_filters, m_width, m_height );
 }
 
 void*



More information about the Vlmc-devel mailing list