diff --git a/src/FreqWindow.h b/src/FreqWindow.h index 8fb59bd45..1f4c071f2 100644 --- a/src/FreqWindow.h +++ b/src/FreqWindow.h @@ -213,7 +213,7 @@ private: int mMouseX; int mMouseY; - std::auto_ptr mAnalyst; + std::unique_ptr mAnalyst; DECLARE_EVENT_TABLE(); diff --git a/src/TrackPanel.h b/src/TrackPanel.h index a9767410c..a30f9a1ff 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -636,7 +636,7 @@ protected: // and is ignored otherwise. double mFreqSelPin; const WaveTrack *mFreqSelTrack; - std::auto_ptr mFrequencySnapper; + std::unique_ptr mFrequencySnapper; // For toggling of spectral seletion double mLastF0; diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index c4d759d47..32571597d 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -560,7 +560,7 @@ bool WaveClip::GetWaveDisplay(WaveDisplay &display, double t0, return true; } - std::auto_ptr oldCache(mWaveCache); + std::unique_ptr oldCache(mWaveCache); mWaveCache = 0; int oldX0 = 0; @@ -599,7 +599,7 @@ bool WaveClip::GetWaveDisplay(WaveDisplay &display, double t0, // with the current one, re-use as much of the cache as // possible - if (oldCache.get()) { + if (oldCache) { //TODO: only load inval regions if //necessary. (usually is the case, so no rush.) @@ -1111,7 +1111,7 @@ bool WaveClip::GetSpectrogram(WaveTrackCache &waveTrackCache, // a complete hit, because of the complications of time reassignment match = false; - std::auto_ptr oldCache(mSpecCache); + std::unique_ptr oldCache(mSpecCache); mSpecCache = 0; const double tstep = 1.0 / pixelsPerSecond; @@ -1149,7 +1149,7 @@ bool WaveClip::GetSpectrogram(WaveTrackCache &waveTrackCache, // Optimization: if the old cache is good and overlaps // with the current one, re-use as much of the cache as // possible - if (oldCache.get()) { + if (oldCache) { memcpy(&mSpecCache->freq[half * copyBegin], &oldCache->freq[half * (copyBegin + oldX0)], half * (copyEnd - copyBegin) * sizeof(float)); @@ -1437,7 +1437,7 @@ bool WaveClip::Paste(double t0, const WaveClip* other) const bool clipNeedsResampling = other->mRate != mRate; const bool clipNeedsNewFormat = other->mSequence->GetSampleFormat() != mSequence->GetSampleFormat(); - std::auto_ptr newClip; + std::unique_ptr newClip; const WaveClip* pastedClip; if (clipNeedsResampling || clipNeedsNewFormat) diff --git a/src/effects/Generator.cpp b/src/effects/Generator.cpp index 0c82567b1..d568606f1 100644 --- a/src/effects/Generator.cpp +++ b/src/effects/Generator.cpp @@ -65,7 +65,7 @@ bool Generator::Process() { AudacityProject *p = GetActiveProject(); // Create a temporary track - std::auto_ptr tmp( + std::unique_ptr tmp( mFactory->NewWaveTrack(track->GetSampleFormat(), track->GetRate()) ); diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index d029f214d..0bb5b73e7 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -456,7 +456,7 @@ bool EffectNoiseReduction::PromptUser(wxWindow *parent) // from an automation dialog, the only case in which we can // get here without any wavetracks. return mSettings->PromptUser(this, parent, - (mStatistics.get() != 0), (GetNumWaveTracks() == 0)); + bool(mStatistics), (GetNumWaveTracks() == 0)); } bool EffectNoiseReduction::Settings::PromptUser @@ -1291,7 +1291,7 @@ bool EffectNoiseReduction::Worker::ProcessOne StartNewTrack(); - std::auto_ptr outputTrack( + std::unique_ptr outputTrack( mDoProfile ? NULL : factory.NewWaveTrack(track->GetSampleFormat(), track->GetRate())); diff --git a/src/effects/NoiseReduction.h b/src/effects/NoiseReduction.h index 7880ecc76..abfd5cdab 100644 --- a/src/effects/NoiseReduction.h +++ b/src/effects/NoiseReduction.h @@ -54,8 +54,8 @@ private: class Worker; friend class Dialog; - std::auto_ptr mSettings; - std::auto_ptr mStatistics; + std::unique_ptr mSettings; + std::unique_ptr mStatistics; }; #endif diff --git a/src/toolbars/ToolBar.cpp b/src/toolbars/ToolBar.cpp index 9f39818c9..bdbaeeef7 100644 --- a/src/toolbars/ToolBar.cpp +++ b/src/toolbars/ToolBar.cpp @@ -700,7 +700,7 @@ AButton * ToolBar::MakeButton(teBmps eUp, int xoff = (size.GetWidth() - theTheme.Image(eStandardUp).GetWidth())/2; int yoff = (size.GetHeight() - theTheme.Image(eStandardUp).GetHeight())/2; - typedef std::auto_ptr wxImagePtr; + typedef std::unique_ptr wxImagePtr; wxImagePtr up2 (OverlayImage(eUp, eStandardUp, xoff, yoff)); wxImagePtr hilite2 (OverlayImage(eHilite, eStandardUp, xoff, yoff)); wxImagePtr down2 (OverlayImage(eDown, eStandardDown, xoff + 1, yoff + 1)); @@ -726,7 +726,7 @@ void ToolBar::MakeAlternateImages(AButton &button, int idx, int xoff = (size.GetWidth() - theTheme.Image(eStandardUp).GetWidth())/2; int yoff = (size.GetHeight() - theTheme.Image(eStandardUp).GetHeight())/2; - typedef std::auto_ptr wxImagePtr; + typedef std::unique_ptr wxImagePtr; wxImagePtr up (OverlayImage(eUp, eStandardUp, xoff, yoff)); wxImagePtr hilite (OverlayImage(eHilite, eStandardUp, xoff, yoff)); wxImagePtr down (OverlayImage(eDown, eStandardDown, xoff + 1, yoff + 1)); diff --git a/src/widgets/AButton.cpp b/src/widgets/AButton.cpp index d9dc8c169..e691b61a0 100644 --- a/src/widgets/AButton.cpp +++ b/src/widgets/AButton.cpp @@ -280,7 +280,7 @@ void AButton::SetAlternateIdx(unsigned idx) void AButton::FollowModifierKeys() { - if(!mListener.get()) + if(!mListener) mListener.reset(new Listener(this)); } diff --git a/src/widgets/AButton.h b/src/widgets/AButton.h index 026f700c7..6927b0a51 100644 --- a/src/widgets/AButton.h +++ b/src/widgets/AButton.h @@ -164,7 +164,7 @@ class AButton: public wxWindow { wxRect mFocusRect; bool mForceFocusRect; - std::auto_ptr mListener; + std::unique_ptr mListener; public: