![]() |
Audacity 3.2.0
|
Holds multiple objects as a single attachment to Track. More...
#include <ChannelAttachments.h>
Public Types | |
| using | Factory = std::function< std::shared_ptr< ChannelAttachment >(Track &, size_t)> |
Public Member Functions | |
| ChannelAttachmentsBase (Track &track, Factory factory) | |
| ~ChannelAttachmentsBase () override | |
| ChannelAttachmentsBase (const ChannelAttachmentsBase &)=delete | |
| ChannelAttachmentsBase & | operator= (const ChannelAttachmentsBase &)=delete |
| ChannelAttachmentsBase (ChannelAttachmentsBase &)=delete | |
| ChannelAttachmentsBase & | operator= (ChannelAttachmentsBase &&other) |
| size_t | Size () const |
| void | CopyTo (Track &track) const override |
| Copy state, for undo/redo purposes. More... | |
| void | Reparent (const std::shared_ptr< Track > &parent) override |
| Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
| void | WriteXMLAttributes (XMLWriter &writer) const override |
| Serialize persistent attributes. More... | |
| bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) override |
| Deserialize an attribute, returning true if recognized. More... | |
| void | MakeStereo (const std::shared_ptr< Track > &parent, ChannelAttachmentsBase &&other) |
| void | SwapChannels (const std::shared_ptr< Track > &parent) |
| void | Erase (const std::shared_ptr< Track > &parent, size_t index) |
Public Member Functions inherited from TrackAttachment | |
| virtual | ~TrackAttachment () |
| virtual void | CopyTo (Track &track) const |
| Copy state, for undo/redo purposes. More... | |
| virtual void | Reparent (const std::shared_ptr< Track > &parent) |
| Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
| virtual void | WriteXMLAttributes (XMLWriter &) const |
| Serialize persistent attributes. More... | |
| virtual bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
| Deserialize an attribute, returning true if recognized. More... | |
Public Member Functions inherited from ClientData::Base | |
| virtual | ~Base () |
Static Protected Member Functions | |
| static ChannelAttachment & | Get (const AttachedTrackObjects::RegisteredFactory &key, Track &track, size_t iChannel) |
| static ChannelAttachment * | Find (const AttachedTrackObjects::RegisteredFactory &key, Track *pTrack, size_t iChannel) |
Private Attributes | |
| const Factory | mFactory |
| std::vector< std::shared_ptr< ChannelAttachment > > | mAttachments |
Holds multiple objects as a single attachment to Track.
Definition at line 51 of file ChannelAttachments.h.
| using ChannelAttachmentsBase::Factory = std::function<std::shared_ptr<ChannelAttachment>(Track &, size_t)> |
Definition at line 54 of file ChannelAttachments.h.
Definition at line 76 of file ChannelAttachments.cpp.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, mAttachments, mFactory, and ChannelGroup::NChannels().
|
overridedefault |
|
delete |
|
delete |
|
overridevirtual |
Copy state, for undo/redo purposes.
Reimplemented from TrackAttachment.
Definition at line 86 of file ChannelAttachments.cpp.
References mAttachments, min(), and ChannelGroup::NChannels().
| void ChannelAttachmentsBase::Erase | ( | const std::shared_ptr< Track > & | parent, |
| size_t | index | ||
| ) |
Erase attachment at a given index, if it existed, moving later-indexed attachments to earlier indices
Calls Reparent, so it needs a track
Definition at line 156 of file ChannelAttachments.cpp.
References mAttachments, and size.
|
staticprotected |
!pTrack || iChannel < pTrack->NChannels() Definition at line 61 of file ChannelAttachments.cpp.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, key, and mAttachments.
Referenced by ChannelAttachments< Attachment >::Find().
|
staticprotected |
iChannel < track.NChannels() Definition at line 42 of file ChannelAttachments.cpp.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, key, mAttachments, mFactory, and ChannelGroup::NChannels().
Referenced by ChannelAttachments< Attachment >::Get().
|
overridevirtual |
Deserialize an attribute, returning true if recognized.
default recognizes no attributes, and returns false
Reimplemented from TrackAttachment.
Definition at line 115 of file ChannelAttachments.cpp.
References mAttachments.
| void ChannelAttachmentsBase::MakeStereo | ( | const std::shared_ptr< Track > & | parent, |
| ChannelAttachmentsBase && | other | ||
| ) |
Append the other's attachments to this, assuming concrete subclasses are the same
Calls Reparent, so it needs a track
typeid(*this) == typeid(other) Size() <= 1 other.Size() <= 1 Definition at line 128 of file ChannelAttachments.cpp.
References mAttachments, and Size().
| ChannelAttachmentsBase & ChannelAttachmentsBase::operator= | ( | ChannelAttachmentsBase && | other | ) |
typeid(*this) == typeid(other) Definition at line 17 of file ChannelAttachments.cpp.
References mAttachments.
|
delete |
|
overridevirtual |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it.
default does nothing
Reimplemented from TrackAttachment.
Definition at line 97 of file ChannelAttachments.cpp.
References mAttachments.
|
inline |
Definition at line 74 of file ChannelAttachments.h.
Referenced by MakeStereo(), and SwapChannels().
| void ChannelAttachmentsBase::SwapChannels | ( | const std::shared_ptr< Track > & | parent | ) |
Calls Reparent, so it needs a track
Size() <= 2 Definition at line 144 of file ChannelAttachments.cpp.
References mAttachments, Size(), and anonymous_namespace{NoteTrack.cpp}::swap().
|
overridevirtual |
Serialize persistent attributes.
default does nothing
Reimplemented from TrackAttachment.
Definition at line 106 of file ChannelAttachments.cpp.
References mAttachments.
|
private |
Definition at line 124 of file ChannelAttachments.h.
Referenced by ChannelAttachmentsBase(), CopyTo(), Erase(), Find(), Get(), HandleXMLAttribute(), MakeStereo(), operator=(), Reparent(), SwapChannels(), and WriteXMLAttributes().
|
private |
Definition at line 123 of file ChannelAttachments.h.
Referenced by ChannelAttachmentsBase(), and Get().