1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 22:28:57 +02:00

More uses of std::make_unique

This commit is contained in:
Paul Licameli 2016-08-08 09:56:26 -04:00
parent 13e056de43
commit 15004b1ade
4 changed files with 3 additions and 6 deletions

View File

@ -549,7 +549,7 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
mFreqSelMode = FREQ_SEL_INVALID;
mFrequencySnapper.reset(new SpectrumAnalyst());
mFrequencySnapper = std::make_unique<SpectrumAnalyst>();
mLastF0 = mLastF1 = SelectedRegion::UndefinedFrequency;
#endif

View File

@ -292,7 +292,7 @@ void AButton::SetAlternateIdx(unsigned idx)
void AButton::FollowModifierKeys()
{
if(!mListener)
mListener.reset(new Listener(this));
mListener = std::make_unique<Listener>(this);
}
void AButton::SetFocusRect(wxRect & r)

View File

@ -514,7 +514,6 @@ void LWSlider::Init(wxWindow * parent,
AdjustSize(size);
mpRuler = NULL; // Do this and Move() before Draw().
Move(pos);
}
@ -811,7 +810,7 @@ void LWSlider::Draw(wxDC & paintDC)
//{
// if (!mpRuler)
// {
// mpRuler = new Ruler();
// mpRuler = std::make_unique<Ruler>();
// mpRuler->mbTicksOnly = false;
// mpRuler->mbTicksAtExtremes = true;

View File

@ -231,8 +231,6 @@ class LWSlider
std::unique_ptr<TipPanel> mTipPanel;
wxString mTipTemplate;
std::unique_ptr<Ruler> mpRuler;
bool mIsDragging;
std::unique_ptr<wxBitmap> mBitmap, mThumbBitmap;