mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-06 23:20:03 +01:00
SoundStretch: parse command-line argument values with double precision
This commit is contained in:
parent
ddf28667c9
commit
d3f7e2530b
@ -199,7 +199,7 @@ void RunParameters::throwLicense() const
|
||||
ST_THROW_RT_ERROR(licenseText);
|
||||
}
|
||||
|
||||
float RunParameters::parseSwitchValue(const STRING& str) const
|
||||
double RunParameters::parseSwitchValue(const STRING& str) const
|
||||
{
|
||||
int pos;
|
||||
|
||||
@ -211,7 +211,7 @@ float RunParameters::parseSwitchValue(const STRING& str) const
|
||||
}
|
||||
|
||||
// Read numerical parameter value after '='
|
||||
return (float)stof(str.substr(pos + 1).c_str());
|
||||
return stof(str.substr(pos + 1).c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -48,17 +48,17 @@ private:
|
||||
void throwLicense() const;
|
||||
void parseSwitchParam(const STRING& str);
|
||||
void checkLimits();
|
||||
float parseSwitchValue(const STRING& tr) const;
|
||||
double parseSwitchValue(const STRING& tr) const;
|
||||
|
||||
public:
|
||||
STRING inFileName;
|
||||
STRING outFileName;
|
||||
float tempoDelta{ 0 };
|
||||
float pitchDelta{ 0 };
|
||||
float rateDelta{ 0 };
|
||||
double tempoDelta{ 0 };
|
||||
double pitchDelta{ 0 };
|
||||
double rateDelta{ 0 };
|
||||
int quick{ 0 };
|
||||
int noAntiAlias{ 0 };
|
||||
float goalBPM{ 0 };
|
||||
double goalBPM{ 0 };
|
||||
bool detectBPM{ false };
|
||||
bool speech{ false };
|
||||
|
||||
|
||||
@ -145,9 +145,9 @@ static void setup(SoundTouch& soundTouch, const WavInFile& inFile, const RunPara
|
||||
#endif
|
||||
// print processing information only if outFileName given i.e. some processing will happen
|
||||
fprintf(stderr, "Processing the file with the following changes:\n");
|
||||
fprintf(stderr, " tempo change = %+g %%\n", params.tempoDelta);
|
||||
fprintf(stderr, " pitch change = %+g semitones\n", params.pitchDelta);
|
||||
fprintf(stderr, " rate change = %+g %%\n\n", params.rateDelta);
|
||||
fprintf(stderr, " tempo change = %+lg %%\n", params.tempoDelta);
|
||||
fprintf(stderr, " pitch change = %+lg semitones\n", params.pitchDelta);
|
||||
fprintf(stderr, " rate change = %+lg %%\n\n", params.rateDelta);
|
||||
fprintf(stderr, "Working...");
|
||||
}
|
||||
else
|
||||
@ -240,7 +240,7 @@ static void detectBPM(WavInFile& inFile, RunParameters& params)
|
||||
|
||||
if (bpmValue > 0)
|
||||
{
|
||||
fprintf(stderr, "Detected BPM rate %.1f\n\n", bpmValue);
|
||||
fprintf(stderr, "Detected BPM rate %.1lf\n\n", bpmValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -252,7 +252,7 @@ static void detectBPM(WavInFile& inFile, RunParameters& params)
|
||||
{
|
||||
// adjust tempo to given bpm
|
||||
params.tempoDelta = (params.goalBPM / bpmValue - 1.0f) * 100.0f;
|
||||
fprintf(stderr, "The file will be converted to %.1f BPM\n\n", params.goalBPM);
|
||||
fprintf(stderr, "The file will be converted to %.1lf BPM\n\n", params.goalBPM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user