[vlmc-devel] commit: ClipWorkflow: Let the clip workflow save themselves. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Wed Jul 28 00:22:10 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Jul 27 23:55:00 2010 +0200| [973460060c5228c6768468f68d7c62330c569ed3] | committer: Hugo Beauzée-Luyssen 

ClipWorkflow: Let the clip workflow save themselves.

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

 src/Workflow/ClipWorkflow.cpp  |    9 +++++++++
 src/Workflow/ClipWorkflow.h    |    3 +++
 src/Workflow/TrackWorkflow.cpp |    5 +----
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/Workflow/ClipWorkflow.cpp b/src/Workflow/ClipWorkflow.cpp
index b2b4219..c93c8c0 100644
--- a/src/Workflow/ClipWorkflow.cpp
+++ b/src/Workflow/ClipWorkflow.cpp
@@ -315,3 +315,12 @@ ClipWorkflow::shouldRender() const
              m_state != ClipWorkflow::Stopped &&
              m_state != ClipWorkflow::Stopping );
 }
+
+void
+ClipWorkflow::save( QXmlStreamWriter &project ) const
+{
+    project.writeAttribute( "uuid", m_clipHelper->clip()->fullId() );
+    project.writeAttribute( "begin", QString::number( m_clipHelper->begin() ) );
+    project.writeAttribute( "end", QString::number( m_clipHelper->end() ) );
+    project.writeAttribute( "helper", m_clipHelper->uuid().toString() );
+}
diff --git a/src/Workflow/ClipWorkflow.h b/src/Workflow/ClipWorkflow.h
index 08d8a91..17cc96f 100644
--- a/src/Workflow/ClipWorkflow.h
+++ b/src/Workflow/ClipWorkflow.h
@@ -28,6 +28,7 @@
 
 #include <QObject>
 #include <QUuid>
+#include <QXmlStreamWriter>
 
 class   QMutex;
 class   QReadWriteLock;
@@ -196,6 +197,8 @@ class   ClipWorkflow : public QObject
          */
         void                    stopRenderer();
 
+        void                    save( QXmlStreamWriter& project ) const;
+
     private:
         void                    setState( State state );
         void                    adjustBegin();
diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 76b7375..e9eb5d4 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -419,11 +419,8 @@ void    TrackWorkflow::save( QXmlStreamWriter& project ) const
     for ( ; it != end ; ++it )
     {
         project.writeStartElement( "clip" );
-        project.writeAttribute( "uuid", it.value()->clip()->fullId() );
         project.writeAttribute( "startFrame", QString::number( it.key() ) );
-        project.writeAttribute( "begin", QString::number( it.value()->getClipHelper()->begin() ) );
-        project.writeAttribute( "end", QString::number( it.value()->getClipHelper()->end() ) );
-        project.writeAttribute( "helper", it.value()->getClipHelper()->uuid().toString() );
+        it.value()->save( project );
         project.writeEndElement();
     }
 }



More information about the Vlmc-devel mailing list