From a66d7442a3a4480af2a98d2253e7503b65cb6912 Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 10 Sep 2018 20:08:19 +0100 Subject: [PATCH] Bug 1977 - Using Spectrogram Settings in TCP causes Audacity to reset Project Rate to default 44100 Hz The Project Rate in the Selection Toolbar and in the Preferences dialog are now the same thing. They ALMOST were before, causing confusion, and this bug. This means that the fancy mechanism to set 'other' rates in Preferences is moot, since the Selection Toolbar bar does not have that option. 49000 will be overridden by 48000 for example. --- src/toolbars/SelectionBar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/toolbars/SelectionBar.cpp b/src/toolbars/SelectionBar.cpp index dcabd7b29..45ca4cdcd 100644 --- a/src/toolbars/SelectionBar.cpp +++ b/src/toolbars/SelectionBar.cpp @@ -658,6 +658,10 @@ void SelectionBar::SetRate(double rate) // if the rate is actually being changed mRate = rate; // update the stored rate mRateBox->SetValue(wxString::Format(wxT("%d"), (int)rate)); + // Update rate in stored prefs. + // This will also update rate in preferences dialog. + gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mRate); + // update the TimeTextCtrls if they exist NumericTextCtrl ** Ctrls[5] = { &mStartTime, &mEndTime, &mLengthTime, &mCenterTime, &mAudioTime }; int i; @@ -672,6 +676,7 @@ void SelectionBar::OnRate(wxCommandEvent & WXUNUSED(event)) if (mRateBox->GetValue().ToDouble(&mRate) && // is a numeric value (mRate != 0.0)) { + gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mRate); NumericTextCtrl ** Ctrls[5] = { &mStartTime, &mEndTime, &mLengthTime, &mCenterTime, &mAudioTime }; int i; for(i=0;i<5;i++)