load and save/load sample-data which doesn't come from sample in/from XML-node (base64-encoded)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@39 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2005-12-19 13:01:36 +00:00
parent 5e6a719b7c
commit 156ad36850
2 changed files with 15 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2005-12-19 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* src/tracks/sample_track.cpp:
load and save/load sample-data which doesn't come from sample in/from
XML-node (base64-encoded)
2005-12-18 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* src/tracks/pattern.cpp:

View File

@@ -249,6 +249,10 @@ void FASTCALL sampleTCO::saveSettings( QDomDocument & _doc,
}
sampletco_de.setAttribute( "len", QString::number( length() ) );
sampletco_de.setAttribute( "src", sampleFile() );
if( sampleFile() == "" )
{
sampletco_de.setAttribute( "data", m_sampleBuffer.toBase64() );
}
// TODO: start- and end-frame
_parent.appendChild( sampletco_de );
}
@@ -262,8 +266,12 @@ void FASTCALL sampleTCO::loadSettings( const QDomElement & _this )
{
movePosition( _this.attribute( "pos" ).toInt() );
}
changeLength( _this.attribute( "len" ).toInt() );
setSampleFile( _this.attribute( "src" ) );
if( sampleFile() == "" )
{
m_sampleBuffer.loadFromBase64( _this.attribute( "data" ) );
}
changeLength( _this.attribute( "len" ).toInt() );
}