commit 958ac096a08f7f78fff59d4bdab09e9aa943d143
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Thu May 4 16:34:55 2023 +0100
Fix crash on startup (rfbz#6669)
4644.patch | 731 ++++++++++++++++++++++++++++++++++++++++++++++++
audacity-freeworld.spec | 6 +-
2 files changed, 736 insertions(+), 1 deletion(-)
---
diff --git a/4644.patch b/4644.patch
new file mode 100644
index 0000000..512a314
--- /dev/null
+++ b/4644.patch
@@ -0,0 +1,731 @@
+From f290610294322b9875f4c69d1bee507b19b085a2 Mon Sep 17 00:00:00 2001
+From: Dmitry Vedenko <dmitry(a)crsib.me>
+Date: Tue, 2 May 2023 21:10:19 +0300
+Subject: [PATCH] NumericFormatType_* are now function, so LTO works
+
+---
+ .../NumericConverterType.cpp | 27 ++++++++++++++++---
+ .../NumericConverterType.h | 10 +++----
+ .../ProjectNumericFormats.cpp | 14 +++++-----
+ .../BeatsNumericConverterFormatter.cpp | 2 +-
+ .../ParsedNumericConverterFormatter.cpp | 18 ++++++-------
+ .../tests/NumericConverterTests.cpp | 2 +-
+ src/LabelDialog.cpp | 4 +--
+ src/TimeDialog.cpp | 2 +-
+ src/TimerRecordDialog.cpp | 6 ++---
+ src/effects/ChangeSpeed.cpp | 8 +++---
+ src/effects/Contrast.cpp | 8 +++---
+ src/effects/DtmfGen.cpp | 2 +-
+ src/effects/Noise.cpp | 2 +-
+ src/effects/Repeat.cpp | 2 +-
+ src/effects/Silence.cpp | 2 +-
+ src/effects/ToneGen.cpp | 2 +-
+ src/effects/VST/VSTEffect.cpp | 2 +-
+ src/effects/VST3/VST3Editor.cpp | 2 +-
+ src/effects/ladspa/LadspaEffect.cpp | 2 +-
+ src/effects/lv2/LV2Editor.cpp | 2 +-
+ src/effects/nyquist/Nyquist.cpp | 2 +-
+ src/import/ImportAUP.cpp | 8 +++---
+ src/toolbars/SelectionBar.cpp | 16 +++++------
+ src/toolbars/SpectralSelectionBar.cpp | 10 +++----
+ src/toolbars/TimeToolBar.cpp | 2 +-
+ src/widgets/Grid.cpp | 14 +++++-----
+ src/widgets/NumericTextCtrl.cpp | 6 ++---
+ 27 files changed, 97 insertions(+), 80 deletions(-)
+
+diff --git a/libraries/lib-numeric-formats/NumericConverterType.cpp
b/libraries/lib-numeric-formats/NumericConverterType.cpp
+index c2aeacee023..9419bcc39f9 100644
+--- a/libraries/lib-numeric-formats/NumericConverterType.cpp
++++ b/libraries/lib-numeric-formats/NumericConverterType.cpp
+@@ -10,7 +10,26 @@
+ **********************************************************************/
+ #include "NumericConverterType.h"
+
+-const NumericConverterType NumericConverterType_TIME { L"time" };
+-const NumericConverterType NumericConverterType_DURATION { L"duration" };
+-const NumericConverterType NumericConverterType_FREQUENCY { L"frequency" };
+-const NumericConverterType NumericConverterType_BANDWIDTH { L"bandwidth" };
++const NumericConverterType& NumericConverterType_TIME()
++{
++ static NumericConverterType value { L"time" };
++ return value;
++}
++
++const NumericConverterType& NumericConverterType_DURATION()
++{
++ static NumericConverterType value { L"duration" };
++ return value;
++}
++
++const NumericConverterType& NumericConverterType_FREQUENCY()
++{
++ static NumericConverterType value { L"frequency" };
++ return value;
++}
++
++const NumericConverterType& NumericConverterType_BANDWIDTH()
++{
++ static NumericConverterType value { L"bandwidth" };
++ return value;
++}
+diff --git a/libraries/lib-numeric-formats/NumericConverterType.h
b/libraries/lib-numeric-formats/NumericConverterType.h
+index a6f5dcf51c2..58faa634458 100644
+--- a/libraries/lib-numeric-formats/NumericConverterType.h
++++ b/libraries/lib-numeric-formats/NumericConverterType.h
+@@ -13,8 +13,8 @@
+ #include "Identifier.h"
+
+ using NumericConverterType = Identifier;
+-
+-NUMERIC_FORMATS_API extern const NumericConverterType NumericConverterType_TIME;
+-NUMERIC_FORMATS_API extern const NumericConverterType NumericConverterType_DURATION;
+-NUMERIC_FORMATS_API extern const NumericConverterType NumericConverterType_FREQUENCY;
+-NUMERIC_FORMATS_API extern const NumericConverterType NumericConverterType_BANDWIDTH;
++
++NUMERIC_FORMATS_API const NumericConverterType& NumericConverterType_TIME();
++NUMERIC_FORMATS_API const NumericConverterType& NumericConverterType_DURATION();
++NUMERIC_FORMATS_API const NumericConverterType& NumericConverterType_FREQUENCY();
++NUMERIC_FORMATS_API const NumericConverterType& NumericConverterType_BANDWIDTH();
+diff --git a/libraries/lib-numeric-formats/ProjectNumericFormats.cpp
b/libraries/lib-numeric-formats/ProjectNumericFormats.cpp
+index e1b418f0e63..c9e663aa540 100644
+--- a/libraries/lib-numeric-formats/ProjectNumericFormats.cpp
++++ b/libraries/lib-numeric-formats/ProjectNumericFormats.cpp
+@@ -40,22 +40,22 @@ ProjectNumericFormats::ProjectNumericFormats(const
AudacityProject& project)
+ : mProject { project }
+ , mSelectionFormat{ NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(project),
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ gPrefs->Read(wxT("/SelectionFormat"), wxT("")))
+ }
+ , mFrequencySelectionFormatName{ NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(project),
+- NumericConverterType_FREQUENCY,
++ NumericConverterType_FREQUENCY(),
+ gPrefs->Read(wxT("/FrequencySelectionFormatName"), wxT(""))
)
+ }
+ , mBandwidthSelectionFormatName{ NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(project),
+- NumericConverterType_BANDWIDTH,
++ NumericConverterType_BANDWIDTH(),
+ gPrefs->Read(wxT("/BandwidthSelectionFormatName"), wxT(""))
)
+ }
+ , mAudioTimeFormat{ NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(project),
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ gPrefs->Read(wxT("/AudioTimeFormat"), wxT("hh:mm:ss")))
+ }
+ {}
+@@ -134,14 +134,14 @@ static ProjectFileIORegistry::AttributeReaderEntries entries {
+ // preference file.
+ { "selectionformat", [](auto &formats, auto value){
+ formats.SetSelectionFormat(formats.LookupFormat(
+- NumericConverterType_TIME, value.ToWString()));
++ NumericConverterType_TIME(), value.ToWString()));
+ } },
+ { "frequencyformat", [](auto &formats, auto value){
+ formats.SetFrequencySelectionFormatName(formats.LookupFormat(
+- NumericConverterType_FREQUENCY, value.ToWString()));
++ NumericConverterType_FREQUENCY(), value.ToWString()));
+ } },
+ { "bandwidthformat", [](auto &formats, auto value){
+ formats.SetBandwidthSelectionFormatName(formats.LookupFormat(
+- NumericConverterType_BANDWIDTH, value.ToWString()));
++ NumericConverterType_BANDWIDTH(), value.ToWString()));
+ } },
+ } };
+diff --git a/libraries/lib-numeric-formats/formatters/BeatsNumericConverterFormatter.cpp
b/libraries/lib-numeric-formats/formatters/BeatsNumericConverterFormatter.cpp
+index e82c66eb2ee..7390ada4899 100644
+--- a/libraries/lib-numeric-formats/formatters/BeatsNumericConverterFormatter.cpp
++++ b/libraries/lib-numeric-formats/formatters/BeatsNumericConverterFormatter.cpp
+@@ -342,7 +342,7 @@ Registry::BaseItemPtr BuildBeatsGroup(bool timeFormat)
+ {
+ return NumericConverterFormatterGroup(
+ timeFormat ? "beatsTime" : "beatsDuration",
+- timeFormat ? NumericConverterType_TIME : NumericConverterType_DURATION,
++ timeFormat ? NumericConverterType_TIME() : NumericConverterType_DURATION(),
+ NumericConverterFormatterItem(
+ /* i18n-hint: "bar" and "beat" are musical notation
elements. */
+ "beats", XO("bar:beat"),
+diff --git a/libraries/lib-numeric-formats/formatters/ParsedNumericConverterFormatter.cpp
b/libraries/lib-numeric-formats/formatters/ParsedNumericConverterFormatter.cpp
+index 0ff2509d2c7..06e5fe02719 100644
+--- a/libraries/lib-numeric-formats/formatters/ParsedNumericConverterFormatter.cpp
++++ b/libraries/lib-numeric-formats/formatters/ParsedNumericConverterFormatter.cpp
+@@ -186,8 +186,8 @@ class ParsedNumericConverterFormatter final :
+
+ bool IsTimeRelatedFormat() const
+ {
+- return mType == NumericConverterType_TIME ||
+- mType == NumericConverterType_DURATION;
++ return mType == NumericConverterType_TIME() ||
++ mType == NumericConverterType_DURATION();
+ }
+
+ void
+@@ -921,7 +921,7 @@ static BuiltinFormatString TimeConverterFormats_[] = {
+ };
+
+ NumericConverterFormats::DefaultFormatRegistrator timeDefault {
+- NumericConverterType_TIME, NumericConverterFormats::MillisecondsFormat()
++ NumericConverterType_TIME(), NumericConverterFormats::MillisecondsFormat()
+ };
+
+ /** \brief array of formats the control knows about internally
+@@ -956,7 +956,7 @@ static const BuiltinFormatString FrequencyConverterFormats_[] = {
+ };
+
+ NumericConverterFormats::DefaultFormatRegistrator frequencyDefault {
+- NumericConverterType_FREQUENCY, NumericConverterFormats::HertzFormat()
++ NumericConverterType_FREQUENCY(), NumericConverterFormats::HertzFormat()
+ };
+
+ /** \brief array of formats the control knows about internally
+@@ -1008,7 +1008,7 @@ static const BuiltinFormatString BandwidthConverterFormats_[] = {
+ };
+
+ NumericConverterFormats::DefaultFormatRegistrator bandwidthDefault {
+- NumericConverterType_BANDWIDTH, NumericConverterFormats::OctavesFormat()
++ NumericConverterType_BANDWIDTH(), NumericConverterFormats::OctavesFormat()
+ };
+
+ class ParsedNumericConverterFormatterFactory final :
+@@ -1073,28 +1073,28 @@ Registry::BaseItemPtr MakeGroup (
+ NumericConverterItemRegistrator parsedTime {
+ Registry::Placement { {}, {} },
+ MakeGroup(
+- "parsedTime", NumericConverterType_TIME, TimeConverterFormats_,
++ "parsedTime", NumericConverterType_TIME(), TimeConverterFormats_,
+ WXSIZEOF(TimeConverterFormats_))
+ };
+
+ NumericConverterItemRegistrator parsedDuration {
+ Registry::Placement { {}, {} },
+ MakeGroup(
+- "parsedDuration", NumericConverterType_DURATION, TimeConverterFormats_,
++ "parsedDuration", NumericConverterType_DURATION(),
TimeConverterFormats_,
+ WXSIZEOF(TimeConverterFormats_))
+ };
+
+ NumericConverterItemRegistrator parsedFrequency {
+ Registry::Placement { {}, {} },
+ MakeGroup(
+- "parsedFrequency", NumericConverterType_FREQUENCY,
++ "parsedFrequency", NumericConverterType_FREQUENCY(),
+ FrequencyConverterFormats_, WXSIZEOF(FrequencyConverterFormats_))
+ };
+
+ NumericConverterItemRegistrator parsedBandwith {
+ Registry::Placement { {}, {} },
+ MakeGroup(
+- "parsedBandwith", NumericConverterType_BANDWIDTH,
++ "parsedBandwith", NumericConverterType_BANDWIDTH(),
+ BandwidthConverterFormats_, WXSIZEOF(BandwidthConverterFormats_))
+ };
+ } // namespace
+diff --git a/libraries/lib-numeric-formats/tests/NumericConverterTests.cpp
b/libraries/lib-numeric-formats/tests/NumericConverterTests.cpp
+index aa79489ea04..4d7abe64744 100644
+--- a/libraries/lib-numeric-formats/tests/NumericConverterTests.cpp
++++ b/libraries/lib-numeric-formats/tests/NumericConverterTests.cpp
+@@ -28,7 +28,7 @@ TEST_CASE("ParsedNumericConverterFormatter", "")
+ auto context = FormatterContext::SampleRateContext(44100.0);
+
+ auto hhmmssFormatter = CreateParsedNumericConverterFormatter(
+- context, NumericConverterType_TIME, Verbatim("0100 h 060 m 060 s"));
++ context, NumericConverterType_TIME(), Verbatim("0100 h 060 m 060 s"));
+
+ REQUIRE(
+ hhmmssFormatter->ValueToString(0.0, false).valueString ==
+diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp
+index 7f75c5ecd53..0341c420b2d 100644
+--- a/src/LabelDialog.cpp
++++ b/src/LabelDialog.cpp
+@@ -529,7 +529,7 @@ void LabelDialog::OnUpdate(wxCommandEvent &event)
+ // Remember the NEW format and repopulate grid
+ mFormat = NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(mProject),
+- NumericConverterType_TIME, event.GetString() );
++ NumericConverterType_TIME(), event.GetString() );
+ TransferDataToWindow();
+
+ event.Skip(false);
+@@ -540,7 +540,7 @@ void LabelDialog::OnFreqUpdate(wxCommandEvent &event)
+ // Remember the NEW format and repopulate grid
+ mFreqFormat = NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(mProject),
+- NumericConverterType_FREQUENCY, event.GetString() );
++ NumericConverterType_FREQUENCY(), event.GetString() );
+ TransferDataToWindow();
+
+ event.Skip(false);
+diff --git a/src/TimeDialog.cpp b/src/TimeDialog.cpp
+index b316109b5bb..5f7a89f83b5 100644
+--- a/src/TimeDialog.cpp
++++ b/src/TimeDialog.cpp
+@@ -55,7 +55,7 @@ void TimeDialog::PopulateOrExchange(ShuttleGui &S)
+ NumericTextCtrl(
+ FormatterContext::ProjectContext(mProject),
+ S.GetParent(), wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ mFormat,
+ mTime,
+ NumericTextCtrl::Options{}
+diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp
+index d83a446b707..cd21e62811a 100644
+--- a/src/TimerRecordDialog.cpp
++++ b/src/TimerRecordDialog.cpp
+@@ -778,7 +778,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
+ .AddWindow(m_pDatePickerCtrl_Start);
+
+ m_pTimeTextCtrl_Start = safenew
NumericTextCtrl(FormatterContext::EmptyContext(),
+- S.GetParent(), ID_TIMETEXT_START, NumericConverterType_TIME,
++ S.GetParent(), ID_TIMETEXT_START, NumericConverterType_TIME(),
+ {}, 0,
+ Options{}
+ .MenuEnabled(false)
+@@ -807,7 +807,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
+ .AddWindow(m_pDatePickerCtrl_End);
+
+ m_pTimeTextCtrl_End = safenew
NumericTextCtrl(FormatterContext::EmptyContext(),
+- S.GetParent(), ID_TIMETEXT_END, NumericConverterType_TIME,
++ S.GetParent(), ID_TIMETEXT_END, NumericConverterType_TIME(),
+ {}, 0,
+ Options{}
+ .MenuEnabled(false)
+@@ -821,7 +821,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
+ S.StartStatic(XO("Duration"), true);
+ {
+ m_pTimeTextCtrl_Duration = safenew
NumericTextCtrl(FormatterContext::EmptyContext(),
+- S.GetParent(), ID_TIMETEXT_DURATION, NumericConverterType_TIME,
++ S.GetParent(), ID_TIMETEXT_DURATION, NumericConverterType_TIME(),
+ {}, 0,
+ Options{}
+ .MenuEnabled(false)
+diff --git a/src/effects/ChangeSpeed.cpp b/src/effects/ChangeSpeed.cpp
+index 670ac8160e9..402b438d99f 100644
+--- a/src/effects/ChangeSpeed.cpp
++++ b/src/effects/ChangeSpeed.cpp
+@@ -253,7 +253,7 @@ std::unique_ptr<EffectEditor>
EffectChangeSpeed::PopulateOrExchange(
+ wxT("TimeFormat"), formatId, mFormat.Internal());
+ mFormat = NumericConverterFormats::Lookup(
+ FormatterContext::SampleRateContext(mProjectRate),
+- NumericConverterType_TIME, formatId );
++ NumericConverterType_TIME(), formatId);
+ }
+ GetConfig(GetDefinition(), PluginSettings::Private,
+ CurrentSettingsGroup(),
+@@ -333,7 +333,7 @@ std::unique_ptr<EffectEditor>
EffectChangeSpeed::PopulateOrExchange(
+ mpFromLengthCtrl = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ mFormat,
+ mFromLength,
+ NumericTextCtrl::Options{}
+@@ -351,7 +351,7 @@ std::unique_ptr<EffectEditor>
EffectChangeSpeed::PopulateOrExchange(
+ mpToLengthCtrl = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), ID_ToLength,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ mFormat,
+ mToLength);
+
+@@ -680,7 +680,7 @@ void EffectChangeSpeed::OnTimeCtrlUpdate(wxCommandEvent & evt)
+ {
+ mFormat = NumericConverterFormats::Lookup(
+ FormatterContext::SampleRateContext(mProjectRate),
+- NumericConverterType_TIME, evt.GetString() );
++ NumericConverterType_TIME(), evt.GetString());
+
+ mpFromLengthCtrl->SetFormatName(mFormat);
+ // Update From/To Length controls (precision has changed).
+diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp
+index 9cb97592d91..407b57a7c21 100644
+--- a/src/effects/Contrast.cpp
++++ b/src/effects/Contrast.cpp
+@@ -252,7 +252,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
+ mForegroundStartT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), ID_FOREGROUNDSTART_T,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ NumericConverterFormats::HundredthsFormat(),
+ 0.0,
+ options);
+@@ -265,7 +265,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
+ mForegroundEndT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), ID_FOREGROUNDEND_T,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ NumericConverterFormats::HundredthsFormat(),
+ 0.0,
+ options);
+@@ -286,7 +286,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
+ mBackgroundStartT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), ID_BACKGROUNDSTART_T,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ NumericConverterFormats::HundredthsFormat(),
+ 0.0,
+ options);
+@@ -299,7 +299,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
+ mBackgroundEndT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), ID_BACKGROUNDEND_T,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ NumericConverterFormats::HundredthsFormat(),
+ 0.0,
+ options);
+diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp
+index 1ef1c9139ec..f8cd981cdf8 100644
+--- a/src/effects/DtmfGen.cpp
++++ b/src/effects/DtmfGen.cpp
+@@ -365,7 +365,7 @@ void EffectDtmf::Editor::PopulateOrExchange(ShuttleGui & S,
+ mDtmfDurationT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(projectRate),
+ S.GetParent(), wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/Noise.cpp b/src/effects/Noise.cpp
+index c350dc9f15e..50827a28414 100644
+--- a/src/effects/Noise.cpp
++++ b/src/effects/Noise.cpp
+@@ -197,7 +197,7 @@ std::unique_ptr<EffectEditor> EffectNoise::PopulateOrExchange(
+ mNoiseDurationT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/Repeat.cpp b/src/effects/Repeat.cpp
+index 072011f89f9..392a8ebb94d 100644
+--- a/src/effects/Repeat.cpp
++++ b/src/effects/Repeat.cpp
+@@ -234,7 +234,7 @@ void EffectRepeat::DisplayNewTime()
+ mRepeatCount->GetValue().ToLong(&l);
+
+ NumericConverter nc(FormatterContext::SampleRateContext(mProjectRate),
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ GetSelectionFormat(),
+ mT1 - mT0);
+
+diff --git a/src/effects/Silence.cpp b/src/effects/Silence.cpp
+index ca9aca3582c..de4decf51cc 100644
+--- a/src/effects/Silence.cpp
++++ b/src/effects/Silence.cpp
+@@ -75,7 +75,7 @@ std::unique_ptr<EffectEditor> EffectSilence::PopulateOrExchange(
+ mDurationT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp
+index 3f61747713f..4b7cc860e0b 100644
+--- a/src/effects/ToneGen.cpp
++++ b/src/effects/ToneGen.cpp
+@@ -377,7 +377,7 @@ std::unique_ptr<EffectEditor>
EffectToneGen::PopulateOrExchange(
+ mToneDurationT = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp
+index b452a9d1a42..22a80e305b6 100644
+--- a/src/effects/VST/VSTEffect.cpp
++++ b/src/effects/VST/VSTEffect.cpp
+@@ -2650,7 +2650,7 @@ void VSTEffectEditor::BuildPlain(EffectSettingsAccess &access,
EffectType effect
+ mDuration = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(projectRate),
+ scroller, ID_Duration,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/VST3/VST3Editor.cpp b/src/effects/VST3/VST3Editor.cpp
+index 9a76ba638b5..1dc93bb5bd6 100644
+--- a/src/effects/VST3/VST3Editor.cpp
++++ b/src/effects/VST3/VST3Editor.cpp
+@@ -31,7 +31,7 @@ VST3Editor::VST3Editor(wxWindow* parent, VST3Wrapper& wrapper,
+ mDuration = safenew NumericTextCtrl(
+ FormatterContext::SampleRateContext(mWrapper.mSetup.sampleRate),
+ parent, wxID_ANY,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp
+index f50d6310797..f1aa2b27052 100644
+--- a/src/effects/ladspa/LadspaEffect.cpp
++++ b/src/effects/ladspa/LadspaEffect.cpp
+@@ -1292,7 +1292,7 @@ void LadspaEffect::Editor::PopulateUI(ShuttleGui &S)
+ mDuration = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mSampleRate),
+ w, ID_Duration,
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}
+diff --git a/src/effects/lv2/LV2Editor.cpp b/src/effects/lv2/LV2Editor.cpp
+index 9c633ba3a7c..a83287b9511 100644
+--- a/src/effects/lv2/LV2Editor.cpp
++++ b/src/effects/lv2/LV2Editor.cpp
+@@ -418,7 +418,7 @@ bool LV2Editor::BuildPlain(EffectSettingsAccess &access)
+ auto &extra = settings.extra;
+ mDuration = safenew NumericTextCtrl(
+ FormatterContext::SampleRateContext(mSampleRate), w, ID_Duration,
+- NumericConverterType_TIME, extra.GetDurationFormat(),
++ NumericConverterType_TIME(), extra.GetDurationFormat(),
+ extra.GetDuration(),
+ NumericTextCtrl::Options{}.AutoPos(true));
+ mDuration->SetName( XO("Duration") );
+diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp
+index 069b0b4e128..565b9e68f61 100644
+--- a/src/effects/nyquist/Nyquist.cpp
++++ b/src/effects/nyquist/Nyquist.cpp
+@@ -2964,7 +2964,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S)
+ NumericTextCtrl *time = safenew
+ NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate),
+ S.GetParent(), (ID_Time + i),
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ GetSelectionFormat(),
+ ctrl.val,
+ options);
+diff --git a/src/import/ImportAUP.cpp b/src/import/ImportAUP.cpp
+index 598cf824010..ee62ce1401b 100644
+--- a/src/import/ImportAUP.cpp
++++ b/src/import/ImportAUP.cpp
+@@ -416,14 +416,14 @@ ProgressResult AUPImportFileHandle::Import(WaveTrackFactory
*WXUNUSED(trackFacto
+ if (mProjectAttrs.haveselectionformat)
+ {
+ selman.AS_SetSelectionFormat(NumericConverterFormats::Lookup(
+- FormatterContext::ProjectContext(mProject), NumericConverterType_TIME,
++ FormatterContext::ProjectContext(mProject), NumericConverterType_TIME(),
+ mProjectAttrs.selectionformat));
+ }
+
+ if (mProjectAttrs.haveaudiotimeformat)
+ {
+ selman.TT_SetAudioTimeFormat(NumericConverterFormats::Lookup(
+- FormatterContext::ProjectContext(mProject), NumericConverterType_TIME,
++ FormatterContext::ProjectContext(mProject), NumericConverterType_TIME(),
+ mProjectAttrs.audiotimeformat));
+ }
+
+@@ -432,7 +432,7 @@ ProgressResult AUPImportFileHandle::Import(WaveTrackFactory
*WXUNUSED(trackFacto
+ selman.SSBL_SetFrequencySelectionFormatName(
+ NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(mProject),
+- NumericConverterType_FREQUENCY,
++ NumericConverterType_FREQUENCY(),
+ mProjectAttrs.frequencyformat));
+ }
+
+@@ -441,7 +441,7 @@ ProgressResult AUPImportFileHandle::Import(WaveTrackFactory
*WXUNUSED(trackFacto
+ selman.SSBL_SetBandwidthSelectionFormatName(
+ NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(mProject),
+- NumericConverterType_BANDWIDTH,
++ NumericConverterType_BANDWIDTH(),
+ mProjectAttrs.bandwidthformat));
+ }
+
+diff --git a/src/toolbars/SelectionBar.cpp b/src/toolbars/SelectionBar.cpp
+index 0be78d25641..6ed5a3ef33d 100644
+--- a/src/toolbars/SelectionBar.cpp
++++ b/src/toolbars/SelectionBar.cpp
+@@ -102,10 +102,10 @@ std::pair<const TranslatableString&, const
TranslatableString&> ModeNames[] = {
+ };
+
+ const NumericConverterType TimeConverterType[][2] {
+- { NumericConverterType_TIME, NumericConverterType_TIME },
+- { NumericConverterType_TIME, NumericConverterType_DURATION },
+- { NumericConverterType_DURATION, NumericConverterType_TIME },
+- { NumericConverterType_DURATION, NumericConverterType_TIME },
++ { NumericConverterType_TIME(), NumericConverterType_TIME() },
++ { NumericConverterType_TIME(), NumericConverterType_DURATION() },
++ { NumericConverterType_DURATION(), NumericConverterType_TIME() },
++ { NumericConverterType_DURATION(), NumericConverterType_TIME() },
+ };
+ }
+
+@@ -218,7 +218,7 @@ void SelectionBar::AddTime(
+ auto formatName = mListener ? mListener->AS_GetSelectionFormat()
+ : NumericFormatSymbol{};
+ auto pCtrl = safenew NumericTextCtrl(FormatterContext::ProjectContext(mProject),
+- this, id, NumericConverterType_TIME, formatName, 0.0);
++ this, id, NumericConverterType_TIME(), formatName, 0.0);
+
+ pCtrl->Bind(
+ wxEVT_TEXT,
+@@ -321,7 +321,7 @@ void SelectionBar::UpdatePrefs()
+ wxCommandEvent e;
+ e.SetString(NumericConverterFormats::Lookup(
+ FormatterContext::ProjectContext(mProject),
+- NumericConverterType_TIME,
++ NumericConverterType_TIME(),
+ gPrefs->Read(wxT("/SelectionFormat"),
wxT(""))).Internal());
+ OnUpdate(e);
+
+@@ -458,7 +458,7 @@ void SelectionBar::OnUpdate(wxCommandEvent &evt)
+ -1;
+
+ auto format = NumericConverterFormats::Lookup(
+- FormatterContext::ProjectContext(mProject), NumericConverterType_TIME,
++ FormatterContext::ProjectContext(mProject), NumericConverterType_TIME(),
+ evt.GetString());
+
+ // Save format name before recreating the controls so they resize properly
+@@ -616,7 +616,7 @@ void SelectionBar::UpdateTimeControlsFormat(const
NumericFormatSymbol& format)
+ TimeConverterType[static_cast<size_t>(mSelectionMode)][controlIndex];
+
+ ctrl->SetTypeAndFormatName(
+- type, type != NumericConverterType_DURATION ?
++ type, type != NumericConverterType_DURATION() ?
+ format :
+ NumericConverterFormats::GetBestDurationFormat(format));
+ }
+diff --git a/src/toolbars/SpectralSelectionBar.cpp
b/src/toolbars/SpectralSelectionBar.cpp
+index 43f38d0c122..19f2bf6cd77 100644
+--- a/src/toolbars/SpectralSelectionBar.cpp
++++ b/src/toolbars/SpectralSelectionBar.cpp
+@@ -169,7 +169,7 @@ void SpectralSelectionBar::Populate()
+ mChoice->SetAccessible(safenew WindowAccessible(mChoice));
+ #endif
+ mChoice->SetMinSize(wxSize(mChoice->GetBestSize().x, toolbarSingle));
+-
++
+ mainSizer->Add(mChoice, 0, wxEXPAND | wxALIGN_TOP | wxRIGHT, 6);
+
+ //
+@@ -181,7 +181,7 @@ void SpectralSelectionBar::Populate()
+
+ mCenterCtrl = safenew NumericTextCtrl(FormatterContext::ProjectContext(mProject),
+ this, OnCenterID,
+- NumericConverterType_FREQUENCY, frequencyFormatName, 0.0,
++ NumericConverterType_FREQUENCY(), frequencyFormatName, 0.0,
+ NumericTextCtrl::Options{}
+ .InvalidValue( true, SelectedRegion::UndefinedFrequency )
+ );
+@@ -191,7 +191,7 @@ void SpectralSelectionBar::Populate()
+ mWidthCtrl = safenew NumericTextCtrl(
+ FormatterContext::ProjectContext(mProject),
+ this, OnWidthID,
+- NumericConverterType_BANDWIDTH, bandwidthFormatName, 0.0,
++ NumericConverterType_BANDWIDTH(), bandwidthFormatName, 0.0,
+ NumericTextCtrl::Options{}
+ .InvalidValue( true, -1.0 )
+ );
+@@ -201,7 +201,7 @@ void SpectralSelectionBar::Populate()
+ mLowCtrl = safenew NumericTextCtrl(
+ FormatterContext::ProjectContext(mProject),
+ this, OnLowID,
+- NumericConverterType_FREQUENCY, frequencyFormatName, 0.0,
++ NumericConverterType_FREQUENCY(), frequencyFormatName, 0.0,
+ NumericTextCtrl::Options{}
+ .InvalidValue( true, SelectedRegion::UndefinedFrequency )
+ );
+@@ -211,7 +211,7 @@ void SpectralSelectionBar::Populate()
+ mHighCtrl = safenew NumericTextCtrl(
+ FormatterContext::ProjectContext(mProject),
+ this, OnHighID,
+- NumericConverterType_FREQUENCY, frequencyFormatName, 0.0,
++ NumericConverterType_FREQUENCY(), frequencyFormatName, 0.0,
+ NumericTextCtrl::Options{}
+ .InvalidValue( true, SelectedRegion::UndefinedFrequency )
+ );
+diff --git a/src/toolbars/TimeToolBar.cpp b/src/toolbars/TimeToolBar.cpp
+index 84564877909..1d04788f575 100644
+--- a/src/toolbars/TimeToolBar.cpp
++++ b/src/toolbars/TimeToolBar.cpp
+@@ -90,7 +90,7 @@ void TimeToolBar::Populate()
+ auto format = formats.GetAudioTimeFormat();
+
+ // Create the read-only time control
+- mAudioTime = safenew NumericTextCtrl(FormatterContext::ProjectContext(mProject),
this, AudioPositionID, NumericConverterType_TIME, format, 0.0);
++ mAudioTime = safenew NumericTextCtrl(FormatterContext::ProjectContext(mProject),
this, AudioPositionID, NumericConverterType_TIME(), format, 0.0);
+ mAudioTime->SetName(XO("Audio Position"));
+ mAudioTime->SetReadOnly(true);
+
+diff --git a/src/widgets/Grid.cpp b/src/widgets/Grid.cpp
+index 82fd99a470d..ba42fa2ba33 100644
+--- a/src/widgets/Grid.cpp
++++ b/src/widgets/Grid.cpp
+@@ -145,7 +145,7 @@ void NumericEditor::Create(wxWindow *parent, wxWindowID id,
wxEvtHandler *handle
+ mOld,
+ NumericTextCtrl::Options{}
+ .AutoPos(true)
+- .InvalidValue(mType == NumericConverterType_FREQUENCY,
++ .InvalidValue(mType == NumericConverterType_FREQUENCY(),
+ SelectedRegion::UndefinedFrequency)
+ );
+ m_control = control;
+@@ -478,15 +478,13 @@ Grid::Grid(
+ // RegisterDataType takes ownership of renderer and editor
+
+ RegisterDataType(GRID_VALUE_TIME,
+- safenew NumericRenderer{ mContext, NumericConverterType_TIME },
+- safenew NumericEditor
+- { mContext, NumericConverterType_TIME,
++ safenew NumericRenderer{ mContext, NumericConverterType_TIME() },
++ safenew NumericEditor { mContext, NumericConverterType_TIME(),
+ NumericConverterFormats::SecondsFormat() });
+
+ RegisterDataType(GRID_VALUE_FREQUENCY,
+- safenew NumericRenderer{ mContext, NumericConverterType_FREQUENCY
},
+- safenew NumericEditor
+- { mContext, NumericConverterType_FREQUENCY,
++ safenew NumericRenderer{ mContext, NumericConverterType_FREQUENCY()
},
++ safenew NumericEditor { mContext, NumericConverterType_FREQUENCY(),
+ NumericConverterFormats::HertzFormat() });
+
+ RegisterDataType(GRID_VALUE_CHOICE,
+@@ -962,7 +960,7 @@ wxAccStatus GridAx::GetName(int childId, wxString *name)
+ if (c && dt && df && ( c == dt || c == df)) {
+ double value;
+ v.ToDouble(&value);
+- NumericConverter converter(mContext, c == dt ? NumericConverterType_TIME :
NumericConverterType_FREQUENCY,
++ NumericConverter converter(mContext, c == dt ? NumericConverterType_TIME() :
NumericConverterType_FREQUENCY(),
+ c->GetFormat(),
+ value);
+
+diff --git a/src/widgets/NumericTextCtrl.cpp b/src/widgets/NumericTextCtrl.cpp
+index d3cfe760f21..b3f0edb8744 100644
+--- a/src/widgets/NumericTextCtrl.cpp
++++ b/src/widgets/NumericTextCtrl.cpp
+@@ -607,11 +607,11 @@ void NumericTextCtrl::OnContext(wxContextMenuEvent &event)
+
+ int eventType = 0;
+
+- if (mType == NumericConverterType_TIME)
++ if (mType == NumericConverterType_TIME())
+ eventType = EVT_TIMETEXTCTRL_UPDATED;
+- else if (mType == NumericConverterType_FREQUENCY)
++ else if (mType == NumericConverterType_FREQUENCY())
+ eventType = EVT_FREQUENCYTEXTCTRL_UPDATED;
+- else if (mType == NumericConverterType_BANDWIDTH)
++ else if (mType == NumericConverterType_BANDWIDTH())
+ eventType = EVT_BANDWIDTHTEXTCTRL_UPDATED;
+ else
+ {
diff --git a/audacity-freeworld.spec b/audacity-freeworld.spec
index 22e2699..ae37f95 100644
--- a/audacity-freeworld.spec
+++ b/audacity-freeworld.spec
@@ -5,7 +5,7 @@
Name: audacity-freeworld
Version: 3.3.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Multitrack audio editor
License: GPLv2
URL:
https://audacity.sourceforge.net
@@ -23,6 +23,7 @@ Patch0: audacity-2.4.2-fix-portmidi-as-system.patch
Patch1: audacity-2.4.2-fix-libmp3lame-as-system.patch
Patch2: audacity-non-x86.patch
Patch3: audacity-3.2.1-compile.patch
+Patch4:
https://github.com/audacity/audacity/pull/4644.patch
BuildRequires: cmake
BuildRequires: gettext-devel
@@ -157,6 +158,9 @@ rm -f %{buildroot}%{_prefix}/%{realname}
%license LICENSE.txt
%changelog
+* Thu May 04 2023 Leigh Scott <leigh123linux(a)gmail.com> - 3.3.1-2
+- Fix crash on startup (rfbz#6669)
+
* Fri Apr 28 2023 Leigh Scott <leigh123linux(a)gmail.com> - 3.3.1-1
- 3.3.1