mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-24 07:05:43 +01:00
Settings objects used in AudioIOBase...
... Giving many examples of use of Settings objects. Many other rewrites like this should be made to eliminate as many direct uses of gPrefs as we can. Don't rely on long distance coincidences of literals for paths or defaults. For each of several paths like /AudioIO/Host, all uses of that path are replaced with use of a global Settings object defined in one place, in AudioIOBase. The object also gives the benefit of caching the last-read or written value. Other users of those preferences must then include "AudioIOBase.h" to make the dependency explicit at compile time. It should be checked that no other mentions of those paths remain in the source, and that there was no unintended change in default values. This also inverts dependency of AudioIOBase on RecordingPrefs, which is GUI for changing some of these settings.
This commit is contained in:
@@ -1053,9 +1053,8 @@ int ProjectManager::GetEstimatedRecordingMinsLeftOnDisk(long lCaptureChannels) {
|
||||
|
||||
// Obtain the current settings
|
||||
auto oCaptureFormat = QualityPrefs::SampleFormatChoice();
|
||||
if (lCaptureChannels == 0) {
|
||||
gPrefs->Read(wxT("/AudioIO/RecordChannels"), &lCaptureChannels, 2L);
|
||||
}
|
||||
if (lCaptureChannels == 0)
|
||||
lCaptureChannels = AudioIORecordChannels.Read();
|
||||
|
||||
// Find out how much free space we have on disk
|
||||
wxLongLong lFreeSpace = ProjectFileIO::Get( project ).GetFreeDiskSpace();
|
||||
|
||||
Reference in New Issue
Block a user