[vlmc-devel] commit: ClipHelper: Emit a signal when the contained clip is destroyed ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Thu Oct 7 15:03:01 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Oct  7 12:26:35 2010 +0200| [f5b92422d2227fb51647ab6f9664fe5638743049] | committer: Hugo Beauzée-Luyssen 

ClipHelper: Emit a signal when the contained clip is destroyed

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

 src/Workflow/ClipHelper.cpp |    9 +++++++++
 src/Workflow/ClipHelper.h   |    3 +++
 src/Workflow/Helper.h       |    1 +
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/Workflow/ClipHelper.cpp b/src/Workflow/ClipHelper.cpp
index 9ba93fa..eccec27 100644
--- a/src/Workflow/ClipHelper.cpp
+++ b/src/Workflow/ClipHelper.cpp
@@ -34,6 +34,7 @@ ClipHelper::ClipHelper( Clip* clip, qint64 begin /*= -1*/, qint64 end /*= -1*/,
         m_begin = clip->begin();
     if ( end == -1 )
         m_end = clip->end();
+    connect( clip, SIGNAL( destroyed() ), this, SLOT( clipDestroyed() ) );
 }
 
 void
@@ -73,3 +74,11 @@ ClipHelper::setClipWorkflow( ClipWorkflow* cw )
 {
     m_clipWorkflow = cw;
 }
+
+void
+ClipHelper::clipDestroyed()
+{
+    emit destroyed( m_uuid );
+    //A clip helper is useless without a clip.
+    deleteLater();
+}
diff --git a/src/Workflow/ClipHelper.h b/src/Workflow/ClipHelper.h
index 6eee4ce..cd08c78 100644
--- a/src/Workflow/ClipHelper.h
+++ b/src/Workflow/ClipHelper.h
@@ -57,6 +57,9 @@ class   ClipHelper : public Workflow::Helper
         Clip*           m_clip;
         ClipWorkflow*   m_clipWorkflow;
 
+    private slots:
+        void        clipDestroyed();
+
     signals:
         void        error();
 };
diff --git a/src/Workflow/Helper.h b/src/Workflow/Helper.h
index ad72b0a..f825c4b 100644
--- a/src/Workflow/Helper.h
+++ b/src/Workflow/Helper.h
@@ -52,6 +52,7 @@ namespace   Workflow
 
         signals:
             void                    lengthUpdated();
+            void                    destroyed( const QUuid &uuid );
     };
 }
 



More information about the Vlmc-devel mailing list