From 156ad36850b644bf519177934c2d3d8342f706dc Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 19 Dec 2005 13:01:36 +0000 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ src/tracks/sample_track.cpp | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1f93ca95f..db4b05497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-12-19 Tobias Doerffel + + * 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 * src/tracks/pattern.cpp: diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index d000e0bf0..3780fbf17 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -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() ); }