Audacity  2.2.0
Prefs.cpp File Reference

Utility functions for working with our wxConf (gPrefs) More...

#include "Audacity.h"
#include <wx/defs.h>
#include <wx/msgdlg.h>
#include <wx/app.h>
#include <wx/config.h>
#include <wx/intl.h>
#include <wx/fileconf.h>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include "AudacityApp.h"
#include "FileNames.h"
#include "Languages.h"
#include "Prefs.h"

Functions

static void CopyEntry (wxString path, wxConfigBase *src, wxConfigBase *dst, wxString entry)
 
void InitPreferences ()
 
void FinishPreferences ()
 

Variables

std::unique_ptr< wxFileConfig > ugPrefs {}
 
wxFileConfig * gPrefs = NULL
 
int gMenusDirty = 0
 

Detailed Description

Utility functions for working with our wxConf (gPrefs)

Audacity uses wxWidgets' wxConfig class to handle preferences. See Prefs.h for more information on how it works...

  Note: The info below is very outdated and incomplete

  Preference field specification:
   /
      Version              - Audacity Version that created these prefs
      DefaultOpenPath         - Default directory for NEW file selector
   /FileFormats
      CopyOrEditUncompressedData - Copy data from uncompressed files or
         [ "copy", "edit"]   - edit in place?
      ExportFormat_SF1        - Format to export PCM data in
                             (this number is a libsndfile1.0 format)
   /SamplingRate
      DefaultProjectSampleRate- New projects will have this rate
         [ 8000, 11025, 16000, 22050, 44100, 48000 ]
   /AudioIO
      PlaybackDevice       - device to use for playback
      RecordingDevice         - device to use for recording
         (these are device names understood by PortAudio)
   /Display
      WaveformColor        - 0xRRGGBB  --since it will be stored in
      ShadowColor          -          decimal, it will be somewhat
      SpectrumLowColor     -          non-intuitive to edit, but
      SpectrumHighColor    -          much easier to parse.
   /Locale
      Language          - two-letter language code for translations

   (*): wxGTK
   (+): wxWin
   ($): wxMac

Function Documentation

static void CopyEntry ( wxString  path,
wxConfigBase *  src,
wxConfigBase *  dst,
wxString  entry 
)
static
void FinishPreferences ( )

References gPrefs, and ugPrefs.

Referenced by AudacityApp::OnExit(), and AudacityApp::OnInit().

Variable Documentation

int gMenusDirty = 0
wxFileConfig* gPrefs = NULL

Referenced by AudacityProject::AddEffectMenuItemGroup(), AudacityProject::AddEffectMenuItems(), EffectTruncSilence::Analyze(), GetPreferenceCommand::Apply(), SetPreferenceCommand::Apply(), BatchCommands::ApplyChain(), AudacityProject::AS_SetSelectionFormat(), AudacityProject::AS_SetSnapTo(), AskCopyOrEdit(), AudacityProject::AudacityProject(), ProgressDialog::Beep(), ScreenshotCommand::CapturePreferences(), DeviceToolBar::ChangeDevice(), DeviceToolBar::ChangeHost(), Exporter::CheckFilename(), ExportMP3::CheckFileName(), Exporter::CheckMix(), RecordingPrefs::Commit(), GUIPrefs::Commit(), TracksPrefs::Commit(), DevicePrefs::Commit(), QualityPrefs::Commit(), KeyConfigPrefs::Commit(), ControlToolBar::ControlToolBar(), AudacityProject::CreateMenusAndCommands(), FileNames::DefaultToDocumentsFolder(), LabelTrack::DoCaptureKey(), TrackArtist::DrawTracks(), EVT_COMMAND(), EVT_COMMAND_RANGE(), WaveTrack::ExpandCutLine(), ExportCL::Export(), ExportMP3::Export(), ExportCLOptions::ExportCLOptions(), ExportMP3Options::ExportMP3Options(), DirManager::FillBlockfilesCache(), DeviceToolBar::FillHostDevices(), DeviceToolBar::FillInputChannels(), WaveTrack::FindDefaultViewMode(), MP3Exporter::FindLibrary(), FinishPreferences(), EditToolBar::ForAllButtons(), FreqWindow::FreqWindow(), ModulePrefs::GetAllModuleStatuses(), SimpleBlockFile::GetCache(), TracksPrefs::GetDefaultAudioTrackNamePreference(), AudioIO::GetDeviceInfo(), AudacityProject::GetEstimatedRecordingMinsLeftOnDisk(), Exporter::GetFilename(), PluginManager::GetFirstPlugin(), PluginManager::GetFirstPluginForEffectType(), ModulePrefs::GetModuleStatus(), PluginManager::GetNextPlugin(), PluginManager::GetNextPluginForEffectType(), GetNextWindowPlacement(), TracksPrefs::GetPinnedHeadPreference(), AudioIO::getPlayDevIndex(), GlobalPrefsDialog::GetPreferredPage(), AudioIO::getRecordDevIndex(), AudioIO::GetSupportedCaptureRates(), WaveTrack::HandleClear(), AudioIO::HandleDeviceChange(), Importer::Import(), AudacityProject::Import(), ImportRaw(), InitAudioIO(), InitDitherers(), InitPreferences(), AudacityApp::InitTempDir(), EffectEqualization::LoadCurves(), Tags::LoadDefaults(), ThemeBase::LoadPreferredTheme(), SpectrogramSettings::Globals::LoadPrefs(), WaveformSettings::LoadPrefs(), SpectrogramSettings::LoadPrefs(), ToolBar::MakeButtonBackgroundsLarge(), ToolBar::MakeButtonBackgroundsSmall(), AudacityProject::MayStartMonitoring(), AudacityProject::ModifyToolbarMenus(), MP3Exporter::MP3Exporter(), CommandManager::NewIdentifier(), AudacityProject::OnAlign(), BatchProcessDialog::OnApplyToFiles(), BatchProcessDialog::OnApplyToProject(), AdornedRulerPanel::OnAutoScroll(), DeviceToolBar::OnChoice(), SpectralSelectionBar::OnChoice(), DirectoriesPrefs::OnChooseTempDir(), BrowserDialog::OnClose(), FreqWindow::OnCloseButton(), AudacityProject::OnCut(), AudacityProject::OnCutLabels(), ScreenFrame::OnDirChoose(), SplashDialog::OnDontShow(), AudacityApp::OnExit(), ExportMultiple::OnExport(), EffectUIHost::OnFFwd(), AudacityProject::OnImport(), KeyConfigPrefs::OnImportDefaults(), AudacityApp::OnInit(), ExportMP3Options::OnMono(), AudacityProject::OnMoveSelectionWithTracks(), SoundActivatedRecord::OnOK(), PrefsDialog::OnOK(), TimerRecordDialog::OnOK(), EditChainsDialog::OnOK(), TagsEditor::OnOk(), AudacityProject::OnPlayAfterSelectionEnd(), AudacityProject::OnPlayAfterSelectionStart(), AudacityProject::OnPlayBeforeAndAfterSelectionEnd(), AudacityProject::OnPlayBeforeAndAfterSelectionStart(), AudacityProject::OnPlayBeforeSelectionEnd(), AudacityProject::OnPlayBeforeSelectionStart(), Meter::OnPreferences(), ControlToolBar::OnRecord(), FreqWindow::OnReplot(), EffectUIHost::OnRewind(), BenchmarkDialog::OnRun(), TagsEditor::OnSaveDefaults(), LabelTrackMenuTable::OnSetFont(), AudacityProject::OnShowClipping(), AudacityProject::OnShowExtraMenus(), AudacityProject::OnSyncLock(), AdornedRulerPanel::OnSyncSelToQuickPlay(), AdornedRulerPanel::OnTimelineToolTips(), AudacityProject::OnTogglePlayRecording(), AdornedRulerPanel::OnToggleQuickPlay(), AdornedRulerPanel::OnToggleScrubRuler(), AudacityProject::OnToggleSoundActivated(), AudacityProject::OnToggleSWPlaythrough(), AudacityProject::OnToggleTypeToCreateLabel(), ToolsToolBar::OnTool(), AudacityProject::OpenFiles(), WaveTrack::Paste(), PCMImportFileHandle::PCMImportFileHandle(), ControlToolBar::PlayPlayRegion(), DevicePrefs::Populate(), QualityPrefs::Populate(), SplashDialog::Populate(), SpectralSelectionBar::Populate(), EditChainsDialog::Populate(), ControlToolBar::Populate(), AudacityProject::PopulateEffectsMenu(), SoundActivatedRecord::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), BatchProcessDialog::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Settings::PrefsIO(), Effect::Preview(), Generator::Process(), NyquistEffect::Process(), EffectPaulstretch::ProcessOne(), Effect::ProcessTrack(), ToolBarConfiguration::Read(), ToolManager::ReadConfig(), ReadExportFormatPref(), ThemeBase::ReadImageCache(), Importer::ReadImportItems(), RecordingPrefs::RecordingPrefs(), ControlToolBar::RegenerateTooltips(), LabelStruct::RegionRelation(), BatchCommands::ReportAndSkip(), LabelTrack::ResetFont(), AudacityProject::SaveAs(), DependencyDialog::SaveFutureActionChoice(), GlobalPrefsDialog::SavePreferredPage(), SpectrogramSettings::Globals::SavePrefs(), WaveformSettings::SavePrefs(), SpectrogramSettings::SavePrefs(), SaveWindowSize(), SelectionBar::SelectionModeUpdated(), ToolsToolBar::SetCurrentTool(), DeviceToolBar::SetDevices(), CommandManager::SetMaxList(), Resample::SetMethod(), ModulePrefs::SetModuleStatus(), ExportMP3::SetNumExportChannels(), TracksPrefs::SetPinnedHeadPreference(), FreqWindow::Show(), ShowDependencyDialogIfNeeded(), HelpSystem::ShowHelpDialog(), AudacityProject::ShowOpenDialog(), ShowWarningDialog(), AudacityProject::SSBL_SetBandwidthSelectionFormatName(), AudacityProject::SSBL_SetFrequencySelectionFormatName(), AudioIO::StartMonitoring(), AudioIO::StartPortAudioStream(), ControlToolBar::StartScrolling(), AudioIO::StartStream(), EffectLeveller::Startup(), EffectNoise::Startup(), EffectNormalize::Startup(), EffectAutoDuck::Startup(), EffectClickRemoval::Startup(), EffectDtmf::Startup(), EffectCompressor::Startup(), EffectChangeSpeed::Startup(), EffectTruncSilence::Startup(), EffectScienFilter::Startup(), EffectReverb::Startup(), EffectEqualization::Startup(), AudioIO::StopStream(), WaveTrack::SyncLockAdjust(), TagsEditor::TagsEditor(), FileNames::TempDir(), TimerRecordDialog::TimerRecordDialog(), TracksPrefs::TracksPrefs(), ShuttlePrefs::TransferBool(), ExportCLOptions::TransferDataFromWindow(), TimerRecordDialog::TransferDataFromWindow(), ExportPCMOptions::TransferDataFromWindow(), ExportMP3Options::TransferDataFromWindow(), ShuttlePrefs::TransferDouble(), ShuttlePrefs::TransferInt(), ShuttlePrefs::TransferString(), EffectEqualization::UpdateDefaultCurves(), FileNames::UpdateDefaultPath(), DeviceToolBar::UpdatePrefs(), ZoomInfo::UpdatePrefs(), ControlToolBar::UpdatePrefs(), SelectionBar::UpdatePrefs(), TrackArtist::UpdatePrefs(), Meter::UpdatePrefs(), ViewInfo::UpdatePrefs(), TrackPanel::UpdatePrefs(), AdornedRulerPanel::UpdatePrefs(), AudacityProject::UpdatePrefs(), AudacityProject::UpdatePrefsVariables(), DirectoriesPrefs::Validate(), ToolBarConfiguration::Write(), ToolManager::WriteConfig(), WriteExportFormatPref(), Importer::WriteImportItems(), and BatchCommands::WriteMp3File().

std::unique_ptr<wxFileConfig> ugPrefs {}