19template <
typename T> std::optional<T>
GetFromFile(
const char* filenameStem)
21 bool tuningOn =
false;
22 gPrefs->
Read(
wxT(
"/TimeAndPitch/TuningOn"), &tuningOn,
false);
27 filenameStem +
".txt" };
31 if (file.peek() == std::ifstream::traits_type::eof() || file.peek() ==
'\n')
46 if (
const auto logTime = GetFromFile<double>(
"overrideLogTime"))
47 return static_cast<int>(*logTime *
sampleRate);
54 return GetFromFile<double>(
"overrideCutoffQuefrency");
59 if (
const auto fftSizeExponent = GetFromFile<int>(
"overrideFftSizeExponent"))
60 return 1 << *fftSizeExponent;
66 if (
const auto reduceImaging = GetFromFile<int>(
"overrideReduceImaging"))
67 return static_cast<bool>(*reduceImaging);
audacity::BasicSettings * gPrefs
virtual bool Read(const wxString &key, bool *value) const =0
FILES_API FilePath ConfigDir()
Audacity user config directory.
std::optional< int > GetLogSample(int sampleRate)
std::optional< bool > GetReduceImagingOverride()
std::optional< double > GetCutoffQuefrencyOverride()
std::optional< int > GetFftSizeOverride()
constexpr auto sampleRate
std::optional< T > GetFromFile(const char *filenameStem)