1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

Bug 2321 - Crash on editing ChangePitch parameters in a Macro

EffectChangePitch:: Don't use the inputTracks() when building the GUI
in Batch mode.

Repeat and NyquistEffect had the same problem as they could call
FindProject() which used inputTracks() on a closed project.  Fixed by a change in Effect::GetSelectionFormat().
This commit is contained in:
James Crook 2020-03-06 19:14:31 +00:00
parent 877ffc3287
commit f1b6843b9a
2 changed files with 3 additions and 3 deletions

View File

@ -438,7 +438,7 @@ bool EffectChangePitch::TransferDataFromWindow()
void EffectChangePitch::DeduceFrequencies()
{
auto FirstTrack = [&]()->const WaveTrack *{
if( !inputTracks() )
if( IsBatchProcessing() || !inputTracks() )
return nullptr;
return *( inputTracks()->Selected< const WaveTrack >() ).first;
};
@ -448,7 +448,7 @@ void EffectChangePitch::DeduceFrequencies()
// As a neat trick, attempt to get the frequency of the note at the
// beginning of the selection.
auto track = FirstTrack();
if (track) {
if (track ) {
double rate = track->GetRate();
// Auto-size window -- high sample rates require larger windowSize.

View File

@ -808,7 +808,7 @@ NumericFormatSymbol Effect::GetDurationFormat()
NumericFormatSymbol Effect::GetSelectionFormat()
{
if( FindProject() )
if( !IsBatchProcessing() && FindProject() )
return ProjectSettings::Get( *FindProject() ).GetSelectionFormat();
return NumericConverter::HoursMinsSecondsFormat();
}