Commit b4fbbdec authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Saving is now functionnal with track type

parent b4aec14d
......@@ -341,20 +341,12 @@ void MainWorkflow::loadProject( const QDomElement& project )
void MainWorkflow::saveProject( QDomDocument& doc, QDomElement& rootNode )
{
// QDomElement project = doc.createElement( "timeline" );
// for ( unsigned int i = 0; i < m_trackCount; ++i )
// {
// if ( m_tracks[i]->getLength() > 0 )
// {
// QDomElement trackNode = doc.createElement( "track" );
//
// trackNode.setAttribute( "id", i );
//
// m_tracks[i]->save( doc, trackNode );
// project.appendChild( trackNode );
// }
// }
// rootNode.appendChild( project );
QDomElement project = doc.createElement( "timeline" );
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
{
m_tracks[i]->save( doc, project );
}
rootNode.appendChild( project );
}
void MainWorkflow::clear()
......
......@@ -322,3 +322,18 @@ unsigned int TrackHandler::getTrackCount() const
return m_trackCount;
}
void TrackHandler::save( QDomDocument& doc, QDomElement& timelineNode ) const
{
for ( unsigned int i = 0; i < m_trackCount; ++i)
{
if ( m_tracks[i]->getLength() > 0 )
{
QDomElement trackNode = doc.createElement( "track" );
trackNode.setAttribute( "id", i );
m_tracks[i]->save( doc, trackNode );
timelineNode.appendChild( trackNode );
}
}
}
......@@ -60,6 +60,8 @@ class TrackHandler : public QObject
bool isPaused() const;
bool allTracksRendered() const;
void save( QDomDocument& doc, QDomElement& timelineNode ) const;
private:
void computeLength();
void activateTrack( unsigned int tracKId );
......
......@@ -573,6 +573,13 @@ void TrackWorkflow::save( QDomDocument& doc, QDomElement& trackNode ) const
end.appendChild( text );
clipNode.appendChild( end );
}
{
QDomElement trackType = doc.createElement( "trackType" );
QDomCharacterData text = doc.createTextNode( QString::number( m_trackType ) );
trackType.appendChild( text );
clipNode.appendChild( trackType );
}
trackNode.appendChild( clipNode );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment