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.
This commit is contained in:
Shmuel H
2017-12-16 11:41:18 +02:00
parent 37f0c3f33d
commit 6d27f90271

View File

@@ -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());
}
}