From 6d27f90271a4f968a6f50549a540ae33cb1af358 Mon Sep 17 00:00:00 2001 From: Shmuel H Date: Sat, 16 Dec 2017 11:41:18 +0200 Subject: [PATCH] Bugfix - SampleTrack -> Load & Save: Fix recorded sample track not being played correctly after saving and loading a project due to sample rate not getting saved in the project file. --- src/tracks/SampleTrack.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index b45f442d1..ad1ae1b81 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -260,6 +260,8 @@ void SampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this ) QString s; _this.setAttribute( "data", m_sampleBuffer->toBase64( s ) ); } + + _this.setAttribute ("sample_rate", m_sampleBuffer->sampleRate()); // TODO: start- and end-frame } @@ -279,6 +281,10 @@ void SampleTCO::loadSettings( const QDomElement & _this ) } changeLength( _this.attribute( "len" ).toInt() ); setMuted( _this.attribute( "muted" ).toInt() ); + + if (_this.hasAttribute("sample_rate")) { + m_sampleBuffer->setSampleRate(_this.attribute("sample_rate").toInt()); + } }