[vlmc-devel] commit: TrackWorkflow: Load clips from the newly created node ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Sep 17 00:38:53 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Sep 17 00:29:36 2010 +0200| [f12dd71e1651ea4a66cd590355a539d73309232a] | committer: Hugo Beauzée-Luyssen 

TrackWorkflow: Load clips from the newly created node

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

 src/Workflow/MainWorkflow.cpp  |   62 +++++++++++++++++++++------------------
 src/Workflow/TrackWorkflow.cpp |    1 -
 2 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index 5188feb..a55b864 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -266,38 +266,42 @@ MainWorkflow::loadProject( const QDomElement &root )
         }
         type = static_cast<Workflow::TrackType>( utype );
 
-        QDomElement clip = elem.firstChildElement();
-        while ( clip.isNull() == false )
+        QDomElement clips = elem.firstChildElement( "clips" );
+        if ( clips.isNull() == false )
         {
-            //Iterate over clip fields:
-            QString                     uuid;
-            QString                     begin;
-            QString                     end;
-            QString                     startFrame;
-            QString                     chUuid;
-
-            uuid = clip.attribute( "uuid" );
-            begin = clip.attribute( "begin" );
-            end = clip.attribute( "end" );
-            startFrame = clip.attribute( "startFrame" );
-            chUuid = clip.attribute( "helper" );
-
-            if ( uuid.isEmpty() == true || startFrame.isEmpty() == true )
+            QDomElement clip = clips.firstChildElement();
+            while ( clip.isNull() == false )
             {
-                qWarning() << "Invalid clip node";
-                return ;
+                //Iterate over clip fields:
+                QString                     uuid;
+                QString                     begin;
+                QString                     end;
+                QString                     startFrame;
+                QString                     chUuid;
+
+                uuid = clip.attribute( "uuid" );
+                begin = clip.attribute( "begin" );
+                end = clip.attribute( "end" );
+                startFrame = clip.attribute( "startFrame" );
+                chUuid = clip.attribute( "helper" );
+
+                if ( uuid.isEmpty() == true || startFrame.isEmpty() == true )
+                {
+                    qWarning() << "Invalid clip node";
+                    return ;
+                }
+
+                Clip* c = Library::getInstance()->clip( uuid );
+                if ( c != NULL )
+                {
+                    ClipHelper  *ch = new ClipHelper( c, begin.toLongLong(),
+                                                      end.toLongLong(), chUuid );
+                    track( type, trackId )->addClip( ch, startFrame.toLongLong() );
+
+                    ch->clipWorkflow()->loadEffects( clip );
+                }
+                clip = clip.nextSiblingElement();
             }
-
-            Clip* c = Library::getInstance()->clip( uuid );
-            if ( c != NULL )
-            {
-                ClipHelper  *ch = new ClipHelper( c, begin.toLongLong(),
-                                                  end.toLongLong(), chUuid );
-                track( type, trackId )->addClip( ch, startFrame.toLongLong() );
-
-                ch->clipWorkflow()->loadEffects( clip );
-            }
-            clip = clip.nextSiblingElement();
         }
         elem = elem.nextSiblingElement();
     }
diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 0130784..78faba3 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -439,7 +439,6 @@ ClipWorkflow*       TrackWorkflow::removeClipWorkflow( const QUuid& id )
             m_clips.erase( it );
             computeLength();
             return cw;
-
         }
         ++it;
     }



More information about the Vlmc-devel mailing list