1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

BlockFile::ReadData overrides: on failure, pad with 0s or throw...

... as the mayThrow argument directs.
This commit is contained in:
Paul Licameli
2016-12-25 08:42:44 -05:00
parent 70d9e4bdc7
commit 98d1468a01
14 changed files with 113 additions and 84 deletions

View File

@@ -67,8 +67,12 @@ class PROFILE_DLL_API BlockFile /* not final, abstract */ {
// Reading
/// Retrieves audio data from this BlockFile
/// Returns the number of samples really read, not more than len
/// If fewer can be read than len, throws an exception if mayThrow is true,
/// otherwise fills the remainder of data with zeroes.
virtual size_t ReadData(samplePtr data, sampleFormat format,
size_t start, size_t len) const = 0;
size_t start, size_t len, bool mayThrow = true)
const = 0;
// Other Properties
@@ -223,6 +227,7 @@ class PROFILE_DLL_API BlockFile /* not final, abstract */ {
virtual void FixSummary(void *data);
static size_t CommonReadData(
bool mayThrow,
const wxFileName &fileName, bool &mSilentLog,
const AliasBlockFile *pAliasFile, sampleCount origin, unsigned channel,
samplePtr data, sampleFormat format, size_t start, size_t len,