mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +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:
parent
877ffc3287
commit
f1b6843b9a
@ -438,7 +438,7 @@ bool EffectChangePitch::TransferDataFromWindow()
|
|||||||
void EffectChangePitch::DeduceFrequencies()
|
void EffectChangePitch::DeduceFrequencies()
|
||||||
{
|
{
|
||||||
auto FirstTrack = [&]()->const WaveTrack *{
|
auto FirstTrack = [&]()->const WaveTrack *{
|
||||||
if( !inputTracks() )
|
if( IsBatchProcessing() || !inputTracks() )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return *( inputTracks()->Selected< const WaveTrack >() ).first;
|
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
|
// As a neat trick, attempt to get the frequency of the note at the
|
||||||
// beginning of the selection.
|
// beginning of the selection.
|
||||||
auto track = FirstTrack();
|
auto track = FirstTrack();
|
||||||
if (track) {
|
if (track ) {
|
||||||
double rate = track->GetRate();
|
double rate = track->GetRate();
|
||||||
|
|
||||||
// Auto-size window -- high sample rates require larger windowSize.
|
// Auto-size window -- high sample rates require larger windowSize.
|
||||||
|
@ -808,7 +808,7 @@ NumericFormatSymbol Effect::GetDurationFormat()
|
|||||||
|
|
||||||
NumericFormatSymbol Effect::GetSelectionFormat()
|
NumericFormatSymbol Effect::GetSelectionFormat()
|
||||||
{
|
{
|
||||||
if( FindProject() )
|
if( !IsBatchProcessing() && FindProject() )
|
||||||
return ProjectSettings::Get( *FindProject() ).GetSelectionFormat();
|
return ProjectSettings::Get( *FindProject() ).GetSelectionFormat();
|
||||||
return NumericConverter::HoursMinsSecondsFormat();
|
return NumericConverter::HoursMinsSecondsFormat();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user