1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-03 14:13:11 +02:00

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.
This commit is contained in:
James Crook 2018-09-10 20:08:19 +01:00
parent a6866f4b4d
commit a66d7442a3

View File

@ -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++)