Audacity 3.2.0
|
Implementation of SampleBlockFactory using Sqlite database. More...
Public Member Functions | |
SqliteSampleBlockFactory (AudacityProject &project) | |
~SqliteSampleBlockFactory () override | |
SampleBlockIDs | GetActiveBlockIDs () override |
SampleBlockPtr | DoCreate (constSamplePtr src, size_t numsamples, sampleFormat srcformat) override |
SampleBlockPtr | DoCreateSilent (size_t numsamples, sampleFormat srcformat) override |
SampleBlockPtr | DoCreateFromXML (sampleFormat srcformat, const AttributesList &attrs) override |
SampleBlockPtr | DoCreateFromId (sampleFormat srcformat, SampleBlockID id) override |
void | OnSampleBlockDtor (const SampleBlock &) |
Public Member Functions inherited from SampleBlockFactory | |
virtual | ~SampleBlockFactory () |
SampleBlockPtr | Create (constSamplePtr src, size_t numsamples, sampleFormat srcformat) |
SampleBlockPtr | CreateSilent (size_t numsamples, sampleFormat srcformat) |
SampleBlockPtr | CreateFromXML (sampleFormat srcformat, const AttributesList &attrs) |
SampleBlockPtr | CreateFromId (sampleFormat srcformat, SampleBlockID id) |
virtual SampleBlockIDs | GetActiveBlockIDs ()=0 |
Public Member Functions inherited from Observer::Publisher< SampleBlockCreateMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Private Types | |
using | AllBlocksMap = std::map< SampleBlockID, std::weak_ptr< SqliteSampleBlock > > |
Private Member Functions | |
void | OnBeginPurge (size_t begin, size_t end) |
void | OnEndPurge () |
Private Attributes | |
friend | SqliteSampleBlock |
AudacityProject & | mProject |
Observer::Subscription | mUndoSubscription |
std::function< void()> | mSampleBlockDeletionCallback |
const std::shared_ptr< ConnectionPtr > | mppConnection |
AllBlocksMap | mAllBlocks |
Additional Inherited Members | |
Public Types inherited from SampleBlockFactory | |
using | SampleBlockIDs = std::unordered_set< SampleBlockID > |
Public Types inherited from Observer::Publisher< SampleBlockCreateMessage > | |
using | message_type = SampleBlockCreateMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const SampleBlockCreateMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
Static Public Member Functions inherited from SampleBlockFactory | |
static SampleBlockFactoryPtr | New (AudacityProject &project) |
Static Public Attributes inherited from Observer::Publisher< SampleBlockCreateMessage > | |
static constexpr bool | notifies_all |
virtual SampleBlockPtr | DoCreate (constSamplePtr src, size_t numsamples, sampleFormat srcformat)=0 |
virtual SampleBlockPtr | DoCreateSilent (size_t numsamples, sampleFormat srcformat)=0 |
virtual SampleBlockPtr | DoCreateFromXML (sampleFormat srcformat, const AttributesList &attrs)=0 |
virtual SampleBlockPtr | DoCreateFromId (sampleFormat srcformat, SampleBlockID id)=0 |
Protected Member Functions inherited from Observer::Publisher< SampleBlockCreateMessage > | |
CallbackReturn | Publish (const SampleBlockCreateMessage &message) |
Send a message to connected callbacks. More... | |
Implementation of SampleBlockFactory using Sqlite database.
Definition at line 146 of file SqliteSampleBlock.cpp.
|
private |
Definition at line 193 of file SqliteSampleBlock.cpp.
|
explicit |
Definition at line 198 of file SqliteSampleBlock.cpp.
References UndoManager::Get(), mUndoSubscription, project, Observer::Publisher< Message, NotifyAll >::Subscribe(), and UndoRedoMessage::type.
|
overridedefault |
|
overridevirtual |
Implements SampleBlockFactory.
Definition at line 217 of file SqliteSampleBlock.cpp.
References mAllBlocks.
|
overridevirtual |
Implements SampleBlockFactory.
Definition at line 278 of file SqliteSampleBlock.cpp.
References DoCreateSilent(), floatSample, id, and mAllBlocks.
Referenced by DoCreateFromXML().
|
overridevirtual |
Implements SampleBlockFactory.
Definition at line 260 of file SqliteSampleBlock.cpp.
References DoCreateFromId().
|
overridevirtual |
Implements SampleBlockFactory.
Definition at line 242 of file SqliteSampleBlock.cpp.
References floatSample, id, and sSilentBlocks.
Referenced by DoCreateFromId().
|
overridevirtual |
Implements SampleBlockFactory.
Definition at line 227 of file SqliteSampleBlock.cpp.
References details::end().
|
private |
Definition at line 1100 of file SqliteSampleBlock.cpp.
References details::begin(), details::end(), EstimateRemovedBlocks(), BasicUI::MakeProgress(), mProject, mSampleBlockDeletionCallback, and XO().
|
private |
Definition at line 1129 of file SqliteSampleBlock.cpp.
References mSampleBlockDeletionCallback.
|
inline |
Definition at line 172 of file SqliteSampleBlock.cpp.
References mSampleBlockDeletionCallback.
|
private |
Definition at line 195 of file SqliteSampleBlock.cpp.
Referenced by DoCreate(), and DoCreateFromId().
|
private |
Definition at line 187 of file SqliteSampleBlock.cpp.
|
private |
Definition at line 184 of file SqliteSampleBlock.cpp.
Referenced by OnBeginPurge().
|
private |
Definition at line 186 of file SqliteSampleBlock.cpp.
Referenced by OnBeginPurge(), OnEndPurge(), and OnSampleBlockDtor().
|
private |
Definition at line 185 of file SqliteSampleBlock.cpp.
Referenced by SqliteSampleBlockFactory().
|
private |
Definition at line 182 of file SqliteSampleBlock.cpp.