mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
Uniform init in blockfile ctors (prevents implicit narrowings)
This commit is contained in:
parent
477d8d9d1d
commit
367ed1dfce
@ -542,7 +542,7 @@ AliasBlockFile::AliasBlockFile(wxFileNameWrapper &&existingSummaryFileName,
|
||||
sampleCount aliasLen,
|
||||
int aliasChannel,
|
||||
float min, float max, float rms):
|
||||
BlockFile(std::move(existingSummaryFileName), aliasLen),
|
||||
BlockFile{ std::move(existingSummaryFileName), aliasLen },
|
||||
mAliasedFileName(std::move(aliasedFileName)),
|
||||
mAliasStart(aliasStart),
|
||||
mAliasChannel(aliasChannel)
|
||||
|
@ -27,8 +27,8 @@ LegacyAliasBlockFile::LegacyAliasBlockFile(wxFileNameWrapper &&fileName,
|
||||
int aliasChannel,
|
||||
sampleCount summaryLen,
|
||||
bool noRMS)
|
||||
: PCMAliasBlockFile(std::move(fileName), std::move(aliasedFileName), aliasStart, aliasLen,
|
||||
aliasChannel, 0.0, 0.0, 0.0)
|
||||
: PCMAliasBlockFile{ std::move(fileName), std::move(aliasedFileName), aliasStart, aliasLen,
|
||||
aliasChannel, 0.0, 0.0, 0.0 }
|
||||
{
|
||||
sampleFormat format;
|
||||
|
||||
|
@ -131,7 +131,7 @@ LegacyBlockFile::LegacyBlockFile(wxFileNameWrapper &&existingFile,
|
||||
sampleCount summaryLen,
|
||||
sampleCount len,
|
||||
bool noRMS):
|
||||
BlockFile(std::move(existingFile), len),
|
||||
BlockFile{ std::move(existingFile), len },
|
||||
mFormat(format)
|
||||
{
|
||||
|
||||
|
@ -38,8 +38,9 @@ char bheaderTag[bheaderTagLen + 1] = "AudacityBlockFile112";
|
||||
/// Create a disk file and write summary and sample data to it
|
||||
ODDecodeBlockFile::ODDecodeBlockFile(wxFileNameWrapper &&baseFileName, wxFileNameWrapper &&audioFileName, sampleCount aliasStart,
|
||||
sampleCount aliasLen, int aliasChannel,unsigned int decodeType):
|
||||
SimpleBlockFile(std::move(baseFileName),
|
||||
NULL,aliasLen,floatSample,true,true), //floatSample has no effect. last two bools - bypass writing of blockfile and cache
|
||||
SimpleBlockFile{ std::move(baseFileName),
|
||||
NULL, aliasLen, floatSample, true, true },
|
||||
//floatSample has no effect. last two bools - bypass writing of blockfile and cache
|
||||
|
||||
mType(decodeType),
|
||||
mAliasStart(aliasStart),
|
||||
@ -55,7 +56,7 @@ ODDecodeBlockFile::ODDecodeBlockFile(wxFileNameWrapper &&baseFileName, wxFileNam
|
||||
ODDecodeBlockFile::ODDecodeBlockFile(wxFileNameWrapper &&existingFile, wxFileNameWrapper &&audioFileName, sampleCount aliasStart,
|
||||
sampleCount aliasLen, int aliasChannel, unsigned int decodeType,
|
||||
float min, float max, float rms, bool dataAvailable):
|
||||
SimpleBlockFile(std::move(existingFile),aliasLen,min,max,rms),
|
||||
SimpleBlockFile{ std::move(existingFile), aliasLen, min, max, rms },
|
||||
|
||||
mType(decodeType),
|
||||
mAliasStart(aliasStart),
|
||||
|
@ -49,8 +49,8 @@ ODPCMAliasBlockFile::ODPCMAliasBlockFile(
|
||||
wxFileNameWrapper &&aliasedFileName,
|
||||
sampleCount aliasStart,
|
||||
sampleCount aliasLen, int aliasChannel)
|
||||
: PCMAliasBlockFile(std::move(fileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen, aliasChannel,false)
|
||||
: PCMAliasBlockFile { std::move(fileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen, aliasChannel, false }
|
||||
{
|
||||
mSummaryAvailable = mSummaryBeingComputed = mHasBeenSaved = false;
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ PCMAliasBlockFile::PCMAliasBlockFile(
|
||||
wxFileNameWrapper &&aliasedFileName,
|
||||
sampleCount aliasStart,
|
||||
sampleCount aliasLen, int aliasChannel)
|
||||
: AliasBlockFile(std::move(fileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen, aliasChannel)
|
||||
: AliasBlockFile{ std::move(fileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen, aliasChannel }
|
||||
{
|
||||
AliasBlockFile::WriteSummary();
|
||||
}
|
||||
@ -43,8 +43,8 @@ PCMAliasBlockFile::PCMAliasBlockFile(
|
||||
wxFileNameWrapper&& aliasedFileName,
|
||||
sampleCount aliasStart,
|
||||
sampleCount aliasLen, int aliasChannel,bool writeSummary)
|
||||
: AliasBlockFile(std::move(fileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen, aliasChannel)
|
||||
: AliasBlockFile{ std::move(fileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen, aliasChannel }
|
||||
{
|
||||
if(writeSummary)
|
||||
AliasBlockFile::WriteSummary();
|
||||
@ -56,9 +56,9 @@ PCMAliasBlockFile::PCMAliasBlockFile(
|
||||
sampleCount aliasStart,
|
||||
sampleCount aliasLen, int aliasChannel,
|
||||
float min, float max, float rms)
|
||||
: AliasBlockFile(std::move(existingSummaryFileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen,
|
||||
aliasChannel, min, max, rms)
|
||||
: AliasBlockFile{ std::move(existingSummaryFileName), std::move(aliasedFileName),
|
||||
aliasStart, aliasLen,
|
||||
aliasChannel, min, max, rms }
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "../FileFormats.h"
|
||||
|
||||
SilentBlockFile::SilentBlockFile(sampleCount sampleLen):
|
||||
BlockFile(wxFileNameWrapper{}, sampleLen)
|
||||
BlockFile{ wxFileNameWrapper{}, sampleLen }
|
||||
{
|
||||
mMin = 0.;
|
||||
mMax = 0.;
|
||||
|
@ -141,7 +141,7 @@ SimpleBlockFile::SimpleBlockFile(wxFileNameWrapper &&baseFileName,
|
||||
/// @param existingFile The disk file this SimpleBlockFile should use.
|
||||
SimpleBlockFile::SimpleBlockFile(wxFileNameWrapper &&existingFile, sampleCount len,
|
||||
float min, float max, float rms):
|
||||
BlockFile(std::move(existingFile), len)
|
||||
BlockFile{ std::move(existingFile), len }
|
||||
{
|
||||
// Set an invalid format to force GetSpaceUsage() to read it from the file.
|
||||
mFormat = (sampleFormat) 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user