[vlmc-devel] commit: EffectHelper: Let the EffectHelper know what it target is. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Sep 10 19:24:53 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Sep 10 16:00:06 2010 +0200| [66f41dc2105aa7e655d3013b3cf9cc065d842c93] | committer: Hugo Beauzée-Luyssen 

EffectHelper: Let the EffectHelper know what it target is.

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

 src/EffectsEngine/EffectHelper.cpp |   15 ++++++++++++++-
 src/EffectsEngine/EffectHelper.h   |    4 ++++
 src/EffectsEngine/EffectUser.cpp   |    7 ++++++-
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/EffectsEngine/EffectHelper.cpp b/src/EffectsEngine/EffectHelper.cpp
index 2f73324..725ded2 100644
--- a/src/EffectsEngine/EffectHelper.cpp
+++ b/src/EffectsEngine/EffectHelper.cpp
@@ -25,7 +25,8 @@
 EffectHelper::EffectHelper( EffectInstance *effectInstance, qint64 begin, qint64 end,
                             const QString &uuid ) :
     Helper( begin, end, uuid ),
-    m_effectInstance( effectInstance )
+    m_effectInstance( effectInstance ),
+    m_target( NULL )
 {
 }
 
@@ -40,3 +41,15 @@ EffectHelper::effectInstance() const
 {
     return m_effectInstance;
 }
+
+const EffectUser*
+EffectHelper::target() const
+{
+    return m_target;
+}
+
+void
+EffectHelper::setTarget( const EffectUser *target )
+{
+    m_target = target;
+}
diff --git a/src/EffectsEngine/EffectHelper.h b/src/EffectsEngine/EffectHelper.h
index 1494627..e7afbac 100644
--- a/src/EffectsEngine/EffectHelper.h
+++ b/src/EffectsEngine/EffectHelper.h
@@ -24,6 +24,7 @@
 #define EFFECTHELPER_H
 
 class   EffectInstance;
+class   EffectUser;
 
 #include "Helper.h"
 
@@ -41,9 +42,12 @@ class   EffectHelper : public Workflow::Helper
 
         EffectInstance          *effectInstance();
         const EffectInstance    *effectInstance() const;
+        const EffectUser        *target() const;
+        void                    setTarget( const EffectUser *target );
 
     private:
         EffectInstance          *m_effectInstance;
+        const EffectUser        *m_target;
 };
 
 Q_DECLARE_METATYPE( EffectHelper* );
diff --git a/src/EffectsEngine/EffectUser.cpp b/src/EffectsEngine/EffectUser.cpp
index 3d1dc1f..9e3d326 100644
--- a/src/EffectsEngine/EffectUser.cpp
+++ b/src/EffectsEngine/EffectUser.cpp
@@ -64,6 +64,7 @@ EffectUser::addEffect( EffectHelper *effectHelper )
         m_filters.push_back( effectHelper );
     else
         m_mixers.push_back( effectHelper );
+    effectHelper->setTarget( this );
     emit effectAdded( effectHelper, effectHelper->begin() );
 }
 
@@ -236,6 +237,7 @@ EffectUser::removeEffect( Effect::Type type, qint32 idx )
         if ( idx < m_filters.size() )
         {
             EffectHelper    *helper = m_filters.takeAt( idx );
+            helper->setTarget( NULL );
             emit    effectRemoved( helper->uuid() );
         }
     }
@@ -244,6 +246,7 @@ EffectUser::removeEffect( Effect::Type type, qint32 idx )
         if ( idx < m_mixers.size() )
         {
             EffectHelper    *helper = m_mixers.takeAt( idx );
+            helper->setTarget( NULL );
             emit    effectRemoved( helper->uuid() );
         }
     }
@@ -262,8 +265,10 @@ EffectUser::removeEffect(EffectHelper *helper)
     {
         if ( (*it)->uuid() == helper->uuid() )
         {
+            EffectHelper    *eh = *it;
+            eh->setTarget( NULL );
             m_filters.erase( it );
-            emit effectRemoved( (*it)->uuid() );
+            emit effectRemoved( eh->uuid() );
             return ;
         }
     }



More information about the Vlmc-devel mailing list