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);
|
ST_THROW_RT_ERROR(licenseText);
|
||||||
}
|
}
|
||||||
|
|
||||||
float RunParameters::parseSwitchValue(const STRING& str) const
|
double RunParameters::parseSwitchValue(const STRING& str) const
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ float RunParameters::parseSwitchValue(const STRING& str) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read numerical parameter value after '='
|
// 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 throwLicense() const;
|
||||||
void parseSwitchParam(const STRING& str);
|
void parseSwitchParam(const STRING& str);
|
||||||
void checkLimits();
|
void checkLimits();
|
||||||
float parseSwitchValue(const STRING& tr) const;
|
double parseSwitchValue(const STRING& tr) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
STRING inFileName;
|
STRING inFileName;
|
||||||
STRING outFileName;
|
STRING outFileName;
|
||||||
float tempoDelta{ 0 };
|
double tempoDelta{ 0 };
|
||||||
float pitchDelta{ 0 };
|
double pitchDelta{ 0 };
|
||||||
float rateDelta{ 0 };
|
double rateDelta{ 0 };
|
||||||
int quick{ 0 };
|
int quick{ 0 };
|
||||||
int noAntiAlias{ 0 };
|
int noAntiAlias{ 0 };
|
||||||
float goalBPM{ 0 };
|
double goalBPM{ 0 };
|
||||||
bool detectBPM{ false };
|
bool detectBPM{ false };
|
||||||
bool speech{ false };
|
bool speech{ false };
|
||||||
|
|
||||||
|
|||||||
@ -145,9 +145,9 @@ static void setup(SoundTouch& soundTouch, const WavInFile& inFile, const RunPara
|
|||||||
#endif
|
#endif
|
||||||
// print processing information only if outFileName given i.e. some processing will happen
|
// 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, "Processing the file with the following changes:\n");
|
||||||
fprintf(stderr, " tempo change = %+g %%\n", params.tempoDelta);
|
fprintf(stderr, " tempo change = %+lg %%\n", params.tempoDelta);
|
||||||
fprintf(stderr, " pitch change = %+g semitones\n", params.pitchDelta);
|
fprintf(stderr, " pitch change = %+lg semitones\n", params.pitchDelta);
|
||||||
fprintf(stderr, " rate change = %+g %%\n\n", params.rateDelta);
|
fprintf(stderr, " rate change = %+lg %%\n\n", params.rateDelta);
|
||||||
fprintf(stderr, "Working...");
|
fprintf(stderr, "Working...");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -240,7 +240,7 @@ static void detectBPM(WavInFile& inFile, RunParameters& params)
|
|||||||
|
|
||||||
if (bpmValue > 0)
|
if (bpmValue > 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Detected BPM rate %.1f\n\n", bpmValue);
|
fprintf(stderr, "Detected BPM rate %.1lf\n\n", bpmValue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ static void detectBPM(WavInFile& inFile, RunParameters& params)
|
|||||||
{
|
{
|
||||||
// adjust tempo to given bpm
|
// adjust tempo to given bpm
|
||||||
params.tempoDelta = (params.goalBPM / bpmValue - 1.0f) * 100.0f;
|
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