mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-23 15:50:05 +02:00
Bug 1977 - Simpler rule for 'Default sample rate' and 'Project rate'.
After discussion it was felt that only using 'Default sample rate' for new projects was better.
This commit is contained in:
parent
98073f7696
commit
cbe778adb5
src
@ -1351,6 +1351,10 @@ void AudacityProject::UpdatePrefsVariables()
|
|||||||
gPrefs->Read(wxT("/GUI/TracksFitVerticallyZoomed"), &mTracksFitVerticallyZoomed, false);
|
gPrefs->Read(wxT("/GUI/TracksFitVerticallyZoomed"), &mTracksFitVerticallyZoomed, false);
|
||||||
// gPrefs->Read(wxT("/GUI/UpdateSpectrogram"), &mViewInfo.bUpdateSpectrogram, true);
|
// gPrefs->Read(wxT("/GUI/UpdateSpectrogram"), &mViewInfo.bUpdateSpectrogram, true);
|
||||||
|
|
||||||
|
// This code to change an empty projects rate is currently disabled, after discussion.
|
||||||
|
// The rule 'Default sample rate' only affects newly created projects was felt to
|
||||||
|
// be simpler and better.
|
||||||
|
#if 0
|
||||||
// The DefaultProjectSample rate is the rate for new projects.
|
// The DefaultProjectSample rate is the rate for new projects.
|
||||||
// Do not change this project's rate, unless there are no tracks.
|
// Do not change this project's rate, unless there are no tracks.
|
||||||
if( GetTrackCount() == 0){
|
if( GetTrackCount() == 0){
|
||||||
@ -1361,6 +1365,8 @@ void AudacityProject::UpdatePrefsVariables()
|
|||||||
bar->SetRate( mRate );
|
bar->SetRate( mRate );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
mDefaultFormat = QualityPrefs::SampleFormatChoice();
|
mDefaultFormat = QualityPrefs::SampleFormatChoice();
|
||||||
|
|
||||||
gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &mSeekShort, 1.0);
|
gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &mSeekShort, 1.0);
|
||||||
|
@ -117,7 +117,6 @@ SelectionBar::SelectionBar()
|
|||||||
// Refer to bug #462 for a scenario where the division-by-zero causes
|
// Refer to bug #462 for a scenario where the division-by-zero causes
|
||||||
// Audacity to fail.
|
// Audacity to fail.
|
||||||
// We expect mRate to be set from the project later.
|
// We expect mRate to be set from the project later.
|
||||||
// We could just use AudioIO::GetOptimalSupportedSampleRate() here.
|
|
||||||
mRate = (double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
|
mRate = (double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
|
||||||
AudioIO::GetOptimalSupportedSampleRate());
|
AudioIO::GetOptimalSupportedSampleRate());
|
||||||
|
|
||||||
@ -344,11 +343,11 @@ void SelectionBar::Populate()
|
|||||||
void SelectionBar::UpdatePrefs()
|
void SelectionBar::UpdatePrefs()
|
||||||
{
|
{
|
||||||
// The project rate is no longer driven from here.
|
// The project rate is no longer driven from here.
|
||||||
// IF /SamplingRate/DefaultProjectSampleRate has changed, that is sent to the project.
|
// When preferences change, the Project learns about it too.
|
||||||
// IF the project has no tracks, then the project updates its sample rate, and
|
// If necessary we can drive the SelectionBar mRate via the Project
|
||||||
// signals that back to the SelectionBar via SetRate().
|
// calling our SetRate().
|
||||||
// Usually though there are tracks, and changes to that pref will only affect new
|
// As of 13-Sep-2018, changes to the sample rate pref will only affect
|
||||||
// or empty projects.
|
// creation of new projects, not the smaple rate in existing ones.
|
||||||
|
|
||||||
wxCommandEvent e;
|
wxCommandEvent e;
|
||||||
e.SetInt(mStartTime->GetFormatIndex());
|
e.SetInt(mStartTime->GetFormatIndex());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user