1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-24 16:20:05 +02:00

movable_ptr(_with_deleter) -> std::unique_ptr

This commit is contained in:
Paul Licameli 2018-04-16 13:47:44 -04:00
parent b8a8712ba0
commit a9e7a7e5d5
53 changed files with 69 additions and 69 deletions

View File

@ -180,7 +180,7 @@ class PROFILE_DLL_API BlockFile /* not final, abstract */ {
struct ReadUnlocker { void operator () ( const BlockFile *p ) const { struct ReadUnlocker { void operator () ( const BlockFile *p ) const {
if (p) p->UnlockRead(); } }; if (p) p->UnlockRead(); } };
using ReadLockBase = using ReadLockBase =
movable_ptr_with_deleter< const BlockFile, ReadUnlocker >; std::unique_ptr< const BlockFile, ReadUnlocker >;
public: public:
class ReadLock : public ReadLockBase class ReadLock : public ReadLockBase

View File

@ -163,7 +163,7 @@ public:
wxArrayString mKeywords; wxArrayString mKeywords;
}; };
using MusicalInstrumentArray = std::vector<movable_ptr<MusicalInstrument>>; using MusicalInstrumentArray = std::vector<std::unique_ptr<MusicalInstrument>>;

View File

@ -66,13 +66,13 @@ struct ModuleInterfaceDeleter {
void operator ()(ModuleInterface *pInterface) const; void operator ()(ModuleInterface *pInterface) const;
}; };
using ModuleInterfaceHandle = movable_ptr_with_deleter< using ModuleInterfaceHandle = std::unique_ptr<
ModuleInterface, ModuleInterfaceDeleter ModuleInterface, ModuleInterfaceDeleter
>; >;
typedef std::map<wxString, ModuleMain *> ModuleMainMap; typedef std::map<wxString, ModuleMain *> ModuleMainMap;
typedef std::map<wxString, ModuleInterfaceHandle> ModuleMap; typedef std::map<wxString, ModuleInterfaceHandle> ModuleMap;
typedef std::map<ModuleInterface *, movable_ptr<wxDynamicLibrary>> LibraryMap; typedef std::map<ModuleInterface *, std::unique_ptr<wxDynamicLibrary>> LibraryMap;
class ModuleManager final : public ModuleManagerInterface class ModuleManager final : public ModuleManagerInterface
{ {
@ -126,7 +126,7 @@ private:
ModuleMap mDynModules; ModuleMap mDynModules;
LibraryMap mLibs; LibraryMap mLibs;
std::vector<movable_ptr<Module>> mModules; std::vector<std::unique_ptr<Module>> mModules;
}; };
#endif /* __AUDACITY_MODULEMANAGER_H__ */ #endif /* __AUDACITY_MODULEMANAGER_H__ */

View File

@ -60,7 +60,7 @@ class Profiler
TaskProfile* GetTaskProfileByDescription(const char* description); TaskProfile* GetTaskProfileByDescription(const char* description);
//List of current Task to do. //List of current Task to do.
std::vector<movable_ptr<TaskProfile>> mTasks; std::vector<std::unique_ptr<TaskProfile>> mTasks;
//mutex for above variable //mutex for above variable
ODLock mTasksMutex; ODLock mTasksMutex;

View File

@ -3402,7 +3402,7 @@ void AudacityProject::EnqueueODTasks()
TrackListIterator triter(GetTracks()); TrackListIterator triter(GetTracks());
tr = triter.First(); tr = triter.First();
std::vector<movable_ptr<ODTask>> newTasks; std::vector<std::unique_ptr<ODTask>> newTasks;
//std::vector<ODDecodeTask*> decodeTasks; //std::vector<ODDecodeTask*> decodeTasks;
unsigned int createdODTasks=0; unsigned int createdODTasks=0;
while (tr) { while (tr) {
@ -3422,7 +3422,7 @@ void AudacityProject::EnqueueODTasks()
//we want at most one instance of each class for the project //we want at most one instance of each class for the project
while((odFlags|createdODTasks) != createdODTasks) while((odFlags|createdODTasks) != createdODTasks)
{ {
movable_ptr<ODTask> newTask; std::unique_ptr<ODTask> newTask;
#ifdef EXPERIMENTAL_OD_FLAC #ifdef EXPERIMENTAL_OD_FLAC
if(!(createdODTasks&ODTask::eODFLAC) && (odFlags & ODTask::eODFLAC)) { if(!(createdODTasks&ODTask::eODFLAC) && (odFlags & ODTask::eODFLAC)) {
newTask = std::make_unique<ODDecodeFlacTask>(); newTask = std::make_unique<ODDecodeFlacTask>();
@ -4039,7 +4039,7 @@ bool AudacityProject::DoSave
// (Otherwise the NEW project would be fine, but the old one would // (Otherwise the NEW project would be fine, but the old one would
// be empty of all of its files.) // be empty of all of its files.)
std::vector<movable_ptr<WaveTrack::Locker>> lockers; std::vector<std::unique_ptr<WaveTrack::Locker>> lockers;
if (mLastSavedTracks) { if (mLastSavedTracks) {
lockers.reserve(mLastSavedTracks->size()); lockers.reserve(mLastSavedTracks->size());
TrackListIterator iter(mLastSavedTracks.get()); TrackListIterator iter(mLastSavedTracks.get());
@ -4666,7 +4666,7 @@ void AudacityProject::PopState(const UndoState &state)
TrackListIterator iter(tracks); TrackListIterator iter(tracks);
Track *t = iter.First(); Track *t = iter.First();
bool odUsed = false; bool odUsed = false;
movable_ptr<ODComputeSummaryTask> computeTask; std::unique_ptr<ODComputeSummaryTask> computeTask;
while (t) while (t)
{ {

View File

@ -102,7 +102,7 @@ HFFT InitializeFFT(size_t fftlen)
enum : size_t { MAX_HFFT = 10 }; enum : size_t { MAX_HFFT = 10 };
// Maintain a pool: // Maintain a pool:
static std::vector< movable_ptr<FFTParam> > hFFTArray(MAX_HFFT); static std::vector< std::unique_ptr<FFTParam> > hFFTArray(MAX_HFFT);
wxCriticalSection getFFTMutex; wxCriticalSection getFFTMutex;
/* Get a handle to the FFT tables of the desired length */ /* Get a handle to the FFT tables of the desired length */

View File

@ -72,7 +72,7 @@ struct UndoState {
SelectedRegion selectedRegion; // by value SelectedRegion selectedRegion; // by value
}; };
using UndoStack = std::vector <movable_ptr<UndoStackElem>>; using UndoStack = std::vector <std::unique_ptr<UndoStackElem>>;
using SpaceArray = std::vector <unsigned long long> ; using SpaceArray = std::vector <unsigned long long> ;

View File

@ -77,7 +77,7 @@ OldStyleCommandType *CommandDirectory::LookUp(const wxString &cmdName) const
return iter->second.get(); return iter->second.get();
} }
void CommandDirectory::AddCommand(movable_ptr<OldStyleCommandType> &&type) void CommandDirectory::AddCommand(std::unique_ptr<OldStyleCommandType> &&type)
{ {
wxASSERT(type != NULL); wxASSERT(type != NULL);
// Internal string is shown but only in assertion message // Internal string is shown but only in assertion message

View File

@ -44,7 +44,7 @@ public:
OldStyleCommandType *LookUp(const wxString &cmdName) const; OldStyleCommandType *LookUp(const wxString &cmdName) const;
/// Register a type of command with the directory. /// Register a type of command with the directory.
void AddCommand(movable_ptr<OldStyleCommandType> &&type); void AddCommand(std::unique_ptr<OldStyleCommandType> &&type);
/// Get a pointer to the singleton instance /// Get a pointer to the singleton instance
static CommandDirectory *Get(); static CommandDirectory *Get();

View File

@ -90,11 +90,11 @@ struct CommandListEntry
using MenuBarList = std::vector < MenuBarListEntry >; using MenuBarList = std::vector < MenuBarListEntry >;
// to do: remove the extra indirection when Mac compiler moves to newer version // to do: remove the extra indirection when Mac compiler moves to newer version
using SubMenuList = std::vector < movable_ptr<SubMenuListEntry> >; using SubMenuList = std::vector < std::unique_ptr<SubMenuListEntry> >;
// This is an array of pointers, not structures, because the hash maps also point to them, // This is an array of pointers, not structures, because the hash maps also point to them,
// so we don't want the structures to relocate with vector operations. // so we don't want the structures to relocate with vector operations.
using CommandList = std::vector<movable_ptr<CommandListEntry>>; using CommandList = std::vector<std::unique_ptr<CommandListEntry>>;
namespace std namespace std
{ {

View File

@ -29,10 +29,10 @@ typedef std::map<wxString, bool> ParamBoolMap;
// Map from parameter name to a suitable Validator // Map from parameter name to a suitable Validator
// to do: use hash // to do: use hash
typedef std::map<wxString, movable_ptr<Validator>> ValidatorMap; typedef std::map<wxString, std::unique_ptr<Validator>> ValidatorMap;
// Map from command name to type // Map from command name to type
// to do: use hash // to do: use hash
typedef std::map<wxString, movable_ptr<OldStyleCommandType>> CommandMap; typedef std::map<wxString, std::unique_ptr<OldStyleCommandType>> CommandMap;
#endif /* End of include guard: __COMMANDMISC__ */ #endif /* End of include guard: __COMMANDMISC__ */

View File

@ -24,7 +24,7 @@ CommandSignature::~CommandSignature()
void CommandSignature::AddParameter(const wxString &name, void CommandSignature::AddParameter(const wxString &name,
const wxVariant &dft, const wxVariant &dft,
movable_ptr<Validator> &&valid) std::unique_ptr<Validator> &&valid)
{ {
wxASSERT_MSG(valid->Validate(dft), wxASSERT_MSG(valid->Validate(dft),
wxT("Invalid command signature: the default value of '") wxT("Invalid command signature: the default value of '")

View File

@ -41,7 +41,7 @@ public:
// valid: a suitable validator (caller doesn't need to DELETE it) // valid: a suitable validator (caller doesn't need to DELETE it)
void AddParameter(const wxString &name, void AddParameter(const wxString &name,
const wxVariant &dft, const wxVariant &dft,
movable_ptr<Validator> &&valid); std::unique_ptr<Validator> &&valid);
// Methods for accessing the signature // Methods for accessing the signature
ParamValueMap GetDefaults() const; ParamValueMap GetDefaults() const;

View File

@ -343,7 +343,7 @@ private:
FloatVector mRealFFTs; FloatVector mRealFFTs;
FloatVector mImagFFTs; FloatVector mImagFFTs;
}; };
std::vector<movable_ptr<Record>> mQueue; std::vector<std::unique_ptr<Record>> mQueue;
}; };
/****************************************************************//** /****************************************************************//**

View File

@ -64,7 +64,7 @@ struct __CFBundle;
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
using VSTEffectArray = std::vector < movable_ptr<VSTEffect> > ; using VSTEffectArray = std::vector < std::unique_ptr<VSTEffect> > ;
DECLARE_LOCAL_EVENT_TYPE(EVT_SIZEWINDOW, -1); DECLARE_LOCAL_EVENT_TYPE(EVT_SIZEWINDOW, -1);
DECLARE_LOCAL_EVENT_TYPE(EVT_UPDATEDISPLAY, -1); DECLARE_LOCAL_EVENT_TYPE(EVT_UPDATEDISPLAY, -1);

View File

@ -34,7 +34,7 @@
class AudioUnitEffect; class AudioUnitEffect;
using AudioUnitEffectArray = std::vector<movable_ptr<AudioUnitEffect>>; using AudioUnitEffectArray = std::vector<std::unique_ptr<AudioUnitEffect>>;
class AudioUnitEffectExportDialog; class AudioUnitEffectExportDialog;
class AudioUnitEffectImportDialog; class AudioUnitEffectImportDialog;

View File

@ -292,7 +292,7 @@ private:
bool mUseGUI; bool mUseGUI;
std::vector< movable_ptr_with_deleter<char, freer> > mURIMap; std::vector< std::unique_ptr<char, freer> > mURIMap;
LV2_URI_Map_Feature mUriMapFeature; LV2_URI_Map_Feature mUriMapFeature;
LV2_URID_Map mURIDMapFeature; LV2_URID_Map mURIDMapFeature;
@ -306,7 +306,7 @@ private:
LV2_Options_Interface *mOptionsInterface; LV2_Options_Interface *mOptionsInterface;
std::vector<LV2_Options_Option> mOptions; std::vector<LV2_Options_Option> mOptions;
std::vector<movable_ptr<LV2_Feature>> mFeatures; std::vector<std::unique_ptr<LV2_Feature>> mFeatures;
LV2_Feature *mInstanceAccessFeature; LV2_Feature *mInstanceAccessFeature;
LV2_Feature *mParentFeature; LV2_Feature *mParentFeature;

View File

@ -325,7 +325,7 @@ int Exporter::FindFormatIndex(int exportindex)
return 0; return 0;
} }
void Exporter::RegisterPlugin(movable_ptr<ExportPlugin> &&ExportPlugin) void Exporter::RegisterPlugin(std::unique_ptr<ExportPlugin> &&ExportPlugin)
{ {
mPlugins.push_back(std::move(ExportPlugin)); mPlugins.push_back(std::move(ExportPlugin));
} }

View File

@ -146,7 +146,7 @@ private:
std::vector<FormatInfo> mFormatInfos; std::vector<FormatInfo> mFormatInfos;
}; };
using ExportPluginArray = std::vector < movable_ptr< ExportPlugin > > ; using ExportPluginArray = std::vector < std::unique_ptr< ExportPlugin > > ;
WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxWindow *, WindowPtrArray, class AUDACITY_DLL_API); WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxWindow *, WindowPtrArray, class AUDACITY_DLL_API);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -161,7 +161,7 @@ public:
void SetFileDialogTitle( const wxString & DialogTitle ); void SetFileDialogTitle( const wxString & DialogTitle );
void SetDefaultFormat( const wxString & Format ){ mFormatName = Format;}; void SetDefaultFormat( const wxString & Format ){ mFormatName = Format;};
void RegisterPlugin(movable_ptr<ExportPlugin> &&plugin); void RegisterPlugin(std::unique_ptr<ExportPlugin> &&plugin);
bool Process(AudacityProject *project, bool selectedOnly, bool Process(AudacityProject *project, bool selectedOnly,
double t0, double t1); double t0, double t1);

View File

@ -545,7 +545,7 @@ wxWindow *ExportCL::OptionsCreate(wxWindow *parent, int format)
return safenew ExportCLOptions(parent, format); return safenew ExportCLOptions(parent, format);
} }
movable_ptr<ExportPlugin> New_ExportCL() std::unique_ptr<ExportPlugin> New_ExportCL()
{ {
return std::make_unique<ExportCL>(); return std::make_unique<ExportCL>();
} }

View File

@ -19,6 +19,6 @@ class ExportPlugin;
* factory method New_ExportCL() which creates a NEW ExportCL object and * factory method New_ExportCL() which creates a NEW ExportCL object and
* returns a pointer to it. The rest of the class declaration is in ExportCL.cpp * returns a pointer to it. The rest of the class declaration is in ExportCL.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportCL(); std::unique_ptr<ExportPlugin> New_ExportCL();
#endif #endif

View File

@ -1095,7 +1095,7 @@ wxWindow *ExportFFmpeg::OptionsCreate(wxWindow *parent, int format)
return ExportPlugin::OptionsCreate(parent, format); return ExportPlugin::OptionsCreate(parent, format);
} }
movable_ptr<ExportPlugin> New_ExportFFmpeg() std::unique_ptr<ExportPlugin> New_ExportFFmpeg()
{ {
return std::make_unique<ExportFFmpeg>(); return std::make_unique<ExportFFmpeg>();
} }

View File

@ -18,6 +18,6 @@ class ExportPlugin;
* factory method New_ExportFFmpeg() which creates a NEW ExportFFmpeg object and * factory method New_ExportFFmpeg() which creates a NEW ExportFFmpeg object and
* returns a pointer to it. The rest of the class declaration is in ExportFFmpeg.cpp * returns a pointer to it. The rest of the class declaration is in ExportFFmpeg.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportFFmpeg(); std::unique_ptr<ExportPlugin> New_ExportFFmpeg();
#endif #endif

View File

@ -450,7 +450,7 @@ bool ExportFLAC::GetMetadata(AudacityProject *project, const Tags *tags)
return true; return true;
} }
movable_ptr<ExportPlugin> New_ExportFLAC() std::unique_ptr<ExportPlugin> New_ExportFLAC()
{ {
return std::make_unique<ExportFLAC>(); return std::make_unique<ExportFLAC>();
} }

View File

@ -18,7 +18,7 @@ class ExportPlugin;
* factory method New_ExportFLAC() which creates a NEW ExportFLAC object and * factory method New_ExportFLAC() which creates a NEW ExportFLAC object and
* returns a pointer to it. The rest of the class declaration is in ExportFLAC.cpp * returns a pointer to it. The rest of the class declaration is in ExportFLAC.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportFLAC(); std::unique_ptr<ExportPlugin> New_ExportFLAC();
#endif #endif

View File

@ -464,7 +464,7 @@ void ExportMP2::AddFrame(struct id3_tag *tp, const wxString & n, const wxString
} }
#endif #endif
movable_ptr<ExportPlugin> New_ExportMP2() std::unique_ptr<ExportPlugin> New_ExportMP2()
{ {
return std::make_unique<ExportMP2>(); return std::make_unique<ExportMP2>();
} }

View File

@ -19,7 +19,7 @@ class ExportPlugin;
* factory method New_ExportMP2() which creates a NEW ExportMP2 object and * factory method New_ExportMP2() which creates a NEW ExportMP2 object and
* returns a pointer to it. The rest of the class declaration is in ExportMP2.cpp * returns a pointer to it. The rest of the class declaration is in ExportMP2.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportMP2(); std::unique_ptr<ExportPlugin> New_ExportMP2();
#endif #endif

View File

@ -2158,7 +2158,7 @@ void ExportMP3::AddFrame(struct id3_tag *tp, const wxString & n, const wxString
} }
#endif #endif
movable_ptr<ExportPlugin> New_ExportMP3() std::unique_ptr<ExportPlugin> New_ExportMP3()
{ {
return std::make_unique<ExportMP3>(); return std::make_unique<ExportMP3>();
} }

View File

@ -20,7 +20,7 @@ class wxWindow;
/** Factory method New_ExportMP3() which creates a NEW ExportMP3 object and /** Factory method New_ExportMP3() which creates a NEW ExportMP3 object and
* returns a pointer to it. The rest of the class declaration is in ExportMP3.cpp * returns a pointer to it. The rest of the class declaration is in ExportMP3.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportMP3(); std::unique_ptr<ExportPlugin> New_ExportMP3();
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Get MP3 library versioqn // Get MP3 library versioqn

View File

@ -400,7 +400,7 @@ bool ExportOGG::FillComment(AudacityProject *project, vorbis_comment *comment, c
return true; return true;
} }
movable_ptr<ExportPlugin> New_ExportOGG() std::unique_ptr<ExportPlugin> New_ExportOGG()
{ {
return std::make_unique<ExportOGG>(); return std::make_unique<ExportOGG>();
} }

View File

@ -18,7 +18,7 @@ class ExportPlugin;
* factory method New_ExportOGG() which creates a NEW ExportOGG object and * factory method New_ExportOGG() which creates a NEW ExportOGG object and
* returns a pointer to it. The rest of the class declaration is in ExportOGG.cpp * returns a pointer to it. The rest of the class declaration is in ExportOGG.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportOGG(); std::unique_ptr<ExportPlugin> New_ExportOGG();
#endif #endif

View File

@ -909,7 +909,7 @@ bool ExportPCM::CheckFileName(wxFileName &filename, int format)
return ExportPlugin::CheckFileName(filename, format); return ExportPlugin::CheckFileName(filename, format);
} }
movable_ptr<ExportPlugin> New_ExportPCM() std::unique_ptr<ExportPlugin> New_ExportPCM()
{ {
return std::make_unique<ExportPCM>(); return std::make_unique<ExportPCM>();
} }

View File

@ -18,7 +18,7 @@ class ExportPlugin;
* factory method New_ExportPCM() which creates a NEW ExportPCM object and * factory method New_ExportPCM() which creates a NEW ExportPCM object and
* returns a pointer to it. The rest of the class declaration is in ExportPCM.cpp * returns a pointer to it. The rest of the class declaration is in ExportPCM.cpp
*/ */
movable_ptr<ExportPlugin> New_ExportPCM(); std::unique_ptr<ExportPlugin> New_ExportPCM();
#endif #endif

View File

@ -307,7 +307,7 @@ void Importer::WriteImportItems()
} while( true ); } while( true );
} }
movable_ptr<ExtImportItem> Importer::CreateDefaultImportItem() std::unique_ptr<ExtImportItem> Importer::CreateDefaultImportItem()
{ {
auto new_item = std::make_unique<ExtImportItem>(); auto new_item = std::make_unique<ExtImportItem>();
new_item->extensions.Add(wxT("*")); new_item->extensions.Add(wxT("*"));

View File

@ -44,7 +44,7 @@ public:
class ExtImportItem; class ExtImportItem;
using FormatList = std::vector<Format> ; using FormatList = std::vector<Format> ;
using ExtImportItems = std::vector< movable_ptr<ExtImportItem> >; using ExtImportItems = std::vector< std::unique_ptr<ExtImportItem> >;
class ExtImportItem class ExtImportItem
{ {
@ -134,7 +134,7 @@ public:
* Allocates NEW ExtImportItem, fills it with default data * Allocates NEW ExtImportItem, fills it with default data
* and returns a pointer to it. * and returns a pointer to it.
*/ */
movable_ptr<ExtImportItem> CreateDefaultImportItem(); std::unique_ptr<ExtImportItem> CreateDefaultImportItem();
static bool IsMidi(const wxString &fName); static bool IsMidi(const wxString &fName);

View File

@ -584,7 +584,7 @@ ProgressResult FFmpegImportFileHandle::Import(TrackFactory *trackFactory,
//at this point we know the file is good and that we have to load the number of channels in mScs[s]->m_stream->codec->channels; //at this point we know the file is good and that we have to load the number of channels in mScs[s]->m_stream->codec->channels;
//so for OD loading we create the tracks and releasee the modal lock after starting the ODTask. //so for OD loading we create the tracks and releasee the modal lock after starting the ODTask.
if (mUsingOD) { if (mUsingOD) {
std::vector<movable_ptr<ODDecodeFFmpegTask>> tasks; std::vector<std::unique_ptr<ODDecodeFFmpegTask>> tasks;
//append blockfiles to each stream and add an individual ODDecodeTask for each one. //append blockfiles to each stream and add an individual ODDecodeTask for each one.
s = -1; s = -1;
for (const auto &stream : mChannels) { for (const auto &stream : mChannels) {

View File

@ -182,7 +182,7 @@ private:
bool mStreamInfoDone; bool mStreamInfoDone;
ProgressResult mUpdateResult; ProgressResult mUpdateResult;
TrackHolders mChannels; TrackHolders mChannels;
movable_ptr<ODDecodeFlacTask> mDecoderTask; std::unique_ptr<ODDecodeFlacTask> mDecoderTask;
}; };

View File

@ -16,8 +16,8 @@ class ImportPlugin;
class UnusableImportPlugin; class UnusableImportPlugin;
using ImportPluginList = using ImportPluginList =
std::vector< movable_ptr<ImportPlugin> >; std::vector< std::unique_ptr<ImportPlugin> >;
using UnusableImportPluginList = using UnusableImportPluginList =
std::vector< movable_ptr<UnusableImportPlugin> >; std::vector< std::unique_ptr<UnusableImportPlugin> >;
#endif #endif

View File

@ -232,7 +232,7 @@ private:
bool mAsyncDone; //!< true = 1st async-done message received bool mAsyncDone; //!< true = 1st async-done message received
GMutex mStreamsLock; //!< Mutex protecting the mStreams array GMutex mStreamsLock; //!< Mutex protecting the mStreams array
std::vector<movable_ptr<GStreamContext>> mStreams; //!< Array of pointers to stream contexts std::vector<std::unique_ptr<GStreamContext>> mStreams; //!< Array of pointers to stream contexts
}; };
/// A representative of GStreamer loader in /// A representative of GStreamer loader in

View File

@ -35,7 +35,7 @@ ODComputeSummaryTask::ODComputeSummaryTask()
mHasUpdateRan=false; mHasUpdateRan=false;
} }
movable_ptr<ODTask> ODComputeSummaryTask::Clone() const std::unique_ptr<ODTask> ODComputeSummaryTask::Clone() const
{ {
auto clone = std::make_unique<ODComputeSummaryTask>(); auto clone = std::make_unique<ODComputeSummaryTask>();
clone->mDemandSample = GetDemandSample(); clone->mDemandSample = GetDemandSample();

View File

@ -36,7 +36,7 @@ class ODComputeSummaryTask final : public ODTask
ODComputeSummaryTask(); ODComputeSummaryTask();
virtual ~ODComputeSummaryTask(){}; virtual ~ODComputeSummaryTask(){};
movable_ptr<ODTask> Clone() const override; std::unique_ptr<ODTask> Clone() const override;
///Subclasses should override to return respective type. ///Subclasses should override to return respective type.
unsigned int GetODType() override { return eODPCMSummary; } unsigned int GetODType() override { return eODPCMSummary; }

View File

@ -82,7 +82,7 @@ public:
bool SeekingAllowed() ; bool SeekingAllowed() ;
private: private:
void InsertCache(movable_ptr<FFMpegDecodeCache> &&cache); void InsertCache(std::unique_ptr<FFMpegDecodeCache> &&cache);
//puts the actual audio samples into the blockfile's data array //puts the actual audio samples into the blockfile's data array
int FillDataFromCache(samplePtr & data, sampleFormat outFormat, sampleCount & start, size_t& len, unsigned int channel); int FillDataFromCache(samplePtr & data, sampleFormat outFormat, sampleCount & start, size_t& len, unsigned int channel);
@ -100,7 +100,7 @@ private:
ScsPtr mScs; //!< Pointer to array of pointers to stream contexts. ScsPtr mScs; //!< Pointer to array of pointers to stream contexts.
ODDecodeFFmpegTask::Streams mChannels; ODDecodeFFmpegTask::Streams mChannels;
std::shared_ptr<FFmpegContext> mContext; //!< Format description, also contains metadata and some useful info std::shared_ptr<FFmpegContext> mContext; //!< Format description, also contains metadata and some useful info
std::vector<movable_ptr<FFMpegDecodeCache>> mDecodeCache; std::vector<std::unique_ptr<FFMpegDecodeCache>> mDecodeCache;
int mNumSamplesInCache; int mNumSamplesInCache;
sampleCount mCurrentPos; //the index of the next sample to be decoded sampleCount mCurrentPos; //the index of the next sample to be decoded
size_t mCurrentLen; //length of the last packet decoded size_t mCurrentLen; //length of the last packet decoded
@ -140,7 +140,7 @@ ODDecodeFFmpegTask::~ODDecodeFFmpegTask()
} }
movable_ptr<ODTask> ODDecodeFFmpegTask::Clone() const std::unique_ptr<ODTask> ODDecodeFFmpegTask::Clone() const
{ {
auto clone = std::make_unique<ODDecodeFFmpegTask>(mScs, Streams{ mChannels }, mContext, mStreamIndex); auto clone = std::make_unique<ODDecodeFFmpegTask>(mScs, Streams{ mChannels }, mContext, mStreamIndex);
clone->mDemandSample=GetDemandSample(); clone->mDemandSample=GetDemandSample();
@ -623,7 +623,7 @@ int ODFFmpegDecoder::DecodeFrame(streamContext *sc, bool flushing)
return ret; return ret;
} }
void ODFFmpegDecoder::InsertCache(movable_ptr<FFMpegDecodeCache> &&cache) { void ODFFmpegDecoder::InsertCache(std::unique_ptr<FFMpegDecodeCache> &&cache) {
int searchStart = 0; int searchStart = 0;
int searchEnd = mDecodeCache.size(); //size() is also a valid insert index. int searchEnd = mDecodeCache.size(); //size() is also a valid insert index.
int guess = 0; int guess = 0;

View File

@ -37,7 +37,7 @@ public:
ODDecodeFFmpegTask(const ScsPtr &scs, Streams &&channels, const std::shared_ptr<FFmpegContext> &context, int streamIndex); ODDecodeFFmpegTask(const ScsPtr &scs, Streams &&channels, const std::shared_ptr<FFmpegContext> &context, int streamIndex);
virtual ~ODDecodeFFmpegTask(); virtual ~ODDecodeFFmpegTask();
movable_ptr<ODTask> Clone() const override; std::unique_ptr<ODTask> Clone() const override;
///Creates an ODFileDecoder that decodes a file of filetype the subclass handles. ///Creates an ODFileDecoder that decodes a file of filetype the subclass handles.
ODFileDecoder* CreateFileDecoder(const wxString & fileName) override; ODFileDecoder* CreateFileDecoder(const wxString & fileName) override;

View File

@ -33,7 +33,7 @@ ODDecodeFlacTask::~ODDecodeFlacTask()
} }
movable_ptr<ODTask> ODDecodeFlacTask::Clone() const std::unique_ptr<ODTask> ODDecodeFlacTask::Clone() const
{ {
auto clone = std::make_unique<ODDecodeFlacTask>(); auto clone = std::make_unique<ODDecodeFlacTask>();
clone->mDemandSample = GetDemandSample(); clone->mDemandSample = GetDemandSample();

View File

@ -51,7 +51,7 @@ class ODDecodeFlacTask final : public ODDecodeTask
virtual ~ODDecodeFlacTask(); virtual ~ODDecodeFlacTask();
movable_ptr<ODTask> Clone() const override; std::unique_ptr<ODTask> Clone() const override;
///Creates an ODFileDecoder that decodes a file of filetype the subclass handles. ///Creates an ODFileDecoder that decodes a file of filetype the subclass handles.
ODFileDecoder* CreateFileDecoder(const wxString & fileName) override; ODFileDecoder* CreateFileDecoder(const wxString & fileName) override;

View File

@ -90,7 +90,7 @@ protected:
std::vector<std::weak_ptr<ODDecodeBlockFile>> mBlockFiles; std::vector<std::weak_ptr<ODDecodeBlockFile>> mBlockFiles;
std::vector<movable_ptr<ODFileDecoder>> mDecoders; std::vector<std::unique_ptr<ODFileDecoder>> mDecoders;
int mMaxBlockFiles; int mMaxBlockFiles;

View File

@ -142,7 +142,7 @@ void ODManager::RemoveTaskIfInQueue(ODTask* task)
/// ///
///@param task the task to add ///@param task the task to add
///@param lockMutex locks the mutexes if true (default). This function is used within other ODManager calls, which many need to set this to false. ///@param lockMutex locks the mutexes if true (default). This function is used within other ODManager calls, which many need to set this to false.
void ODManager::AddNewTask(movable_ptr<ODTask> &&mtask, bool lockMutex) void ODManager::AddNewTask(std::unique_ptr<ODTask> &&mtask, bool lockMutex)
{ {
auto task = mtask.get(); auto task = mtask.get();
ODWaveTrackTaskQueue* queue = NULL; ODWaveTrackTaskQueue* queue = NULL;

View File

@ -62,7 +62,7 @@ class ODManager final
void DecrementCurrentThreads(); void DecrementCurrentThreads();
///Adds a wavetrack, creates a queue member. ///Adds a wavetrack, creates a queue member.
void AddNewTask(movable_ptr<ODTask> &&mtask, bool lockMutex=true); void AddNewTask(std::unique_ptr<ODTask> &&mtask, bool lockMutex=true);
///Wakes the queue loop up by signalling its condition variable. ///Wakes the queue loop up by signalling its condition variable.
void SignalTaskQueueLoop(); void SignalTaskQueueLoop();
@ -140,7 +140,7 @@ class ODManager final
static std::unique_ptr<ODManager> pMan; static std::unique_ptr<ODManager> pMan;
//List of tracks and their active and inactive tasks. //List of tracks and their active and inactive tasks.
std::vector<movable_ptr<ODWaveTrackTaskQueue>> mQueues; std::vector<std::unique_ptr<ODWaveTrackTaskQueue>> mQueues;
ODLock mQueuesMutex; ODLock mQueuesMutex;
//List of current Task to do. //List of current Task to do.

View File

@ -55,7 +55,7 @@ class ODTask /* not final */
virtual ~ODTask(){}; virtual ~ODTask(){};
//clones everything except information about the tracks. //clones everything except information about the tracks.
virtual movable_ptr<ODTask> Clone() const = 0; virtual std::unique_ptr<ODTask> Clone() const = 0;
///Subclasses should override to return respective type. ///Subclasses should override to return respective type.
virtual unsigned int GetODType(){return eODNone;} virtual unsigned int GetODType(){return eODNone;}

View File

@ -101,7 +101,7 @@ void ODWaveTrackTaskQueue::AddWaveTrack(WaveTrack* track)
mTracksMutex.Unlock(); mTracksMutex.Unlock();
} }
void ODWaveTrackTaskQueue::AddTask(movable_ptr<ODTask> &&mtask) void ODWaveTrackTaskQueue::AddTask(std::unique_ptr<ODTask> &&mtask)
{ {
ODTask *task = mtask.get(); ODTask *task = mtask.get();

View File

@ -72,7 +72,7 @@ class ODWaveTrackTaskQueue final
int GetNumWaveTracks(); int GetNumWaveTracks();
///Add a task to the queue. ///Add a task to the queue.
void AddTask(movable_ptr<ODTask> &&mtask); void AddTask(std::unique_ptr<ODTask> &&mtask);
//returns true if either tracks or tasks are empty //returns true if either tracks or tasks are empty
bool IsEmpty(); bool IsEmpty();
@ -106,7 +106,7 @@ class ODWaveTrackTaskQueue final
ODLock mTracksMutex; ODLock mTracksMutex;
///the list of tasks associated with the tracks. This class owns these tasks. ///the list of tasks associated with the tracks. This class owns these tasks.
std::vector<movable_ptr<ODTask>> mTasks; std::vector<std::unique_ptr<ODTask>> mTasks;
ODLock mTasksMutex; ODLock mTasksMutex;
}; };

View File

@ -123,7 +123,7 @@ class ExpandingToolBar final : public wxPanelWrapper
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
friend class ExpandingToolBarEvtHandler; friend class ExpandingToolBarEvtHandler;
std::vector< movable_ptr< ExpandingToolBarEvtHandler > > mHandlers; std::vector< std::unique_ptr< ExpandingToolBarEvtHandler > > mHandlers;
}; };
class ToolBarGrabber final : public wxPanelWrapper class ToolBarGrabber final : public wxPanelWrapper

View File

@ -226,7 +226,7 @@ class Grid final : public wxGrid
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
GridAx *mAx; GridAx *mAx;
std::vector<movable_ptr<GridAx>> mChildren; std::vector<std::unique_ptr<GridAx>> mChildren;
int mObjNdx; int mObjNdx;
#endif #endif