Audacity 3.2.0
|
An ImportFileHandle for AUP files (pre-AUP3) More...
Classes | |
struct | fileinfo |
struct | node |
Public Member Functions | |
AUPImportFileHandle (const FilePath &name, AudacityProject *project) | |
~AUPImportFileHandle () | |
TranslatableString | GetErrorMessage () const override |
TranslatableString | GetFileDescription () override |
ByteCount | GetFileUncompressedBytes () override |
void | Import (ImportProgressListener &progressListener, WaveTrackFactory *trackFactory, TrackHolders &outTracks, Tags *tags, std::optional< LibFileFormats::AcidizerTags > &outAcidTags) override |
wxInt32 | GetStreamCount () override |
const TranslatableStrings & | GetStreamInfo () override |
void | SetStreamUsage (wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)) override |
bool | Open () |
Public Member Functions inherited from ImportFileHandleEx | |
ImportFileHandleEx (const FilePath &filename) | |
FilePath | GetFilename () const override |
void | Cancel () override |
void | Stop () override |
Public Member Functions inherited from ImportFileHandle | |
virtual | ~ImportFileHandle () |
virtual FilePath | GetFilename () const =0 |
virtual TranslatableString | GetErrorMessage () const |
virtual TranslatableString | GetFileDescription ()=0 |
virtual ByteCount | GetFileUncompressedBytes ()=0 |
virtual wxInt32 | GetStreamCount ()=0 |
virtual const TranslatableStrings & | GetStreamInfo ()=0 |
virtual void | SetStreamUsage (wxInt32 StreamID, bool Use)=0 |
virtual void | Import (ImportProgressListener &progressListener, WaveTrackFactory *trackFactory, TrackHolders &outTracks, Tags *tags, std::optional< LibFileFormats::AcidizerTags > &acidTags)=0 |
virtual void | Cancel ()=0 |
virtual void | Stop ()=0 |
Public Member Functions inherited from XMLTagHandler | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
Private Types | |
using | stack = std::vector< struct node > |
using | BlockFileMap = std::map< wxString, std::pair< FilePath, std::shared_ptr< SampleBlock > > > |
Private Member Functions | |
bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override |
void | HandleXMLEndTag (const std::string_view &tag) override |
XMLTagHandler * | HandleXMLChild (const std::string_view &tag) override |
bool | HandleProject (XMLTagHandler *&handle) |
bool | HandleLabelTrack (XMLTagHandler *&handle) |
bool | HandleNoteTrack (XMLTagHandler *&handle) |
bool | HandleTimeTrack (XMLTagHandler *&handle) |
bool | HandleWaveTrack (XMLTagHandler *&handle) |
bool | HandleTags (XMLTagHandler *&handle) |
bool | HandleTag (XMLTagHandler *&handle) |
bool | HandleLabel (XMLTagHandler *&handle) |
bool | HandleWaveClip (XMLTagHandler *&handle) |
bool | HandleSequence (XMLTagHandler *&handle) |
bool | HandleWaveBlock (XMLTagHandler *&handle) |
bool | HandleEnvelope (XMLTagHandler *&handle) |
bool | HandleControlPoint (XMLTagHandler *&handle) |
bool | HandleSimpleBlockFile (XMLTagHandler *&handle) |
bool | HandleSilentBlockFile (XMLTagHandler *&handle) |
bool | HandlePCMAliasBlockFile (XMLTagHandler *&handle) |
bool | HandleImport (XMLTagHandler *&handle) |
void | AddFile (sampleCount len, sampleFormat format, const FilePath &blockFilename=wxEmptyString, const FilePath &audioFilename=wxEmptyString, sampleCount origin=0, int channel=0) |
bool | AddSilence (sampleCount len) |
bool | AddSamples (const FilePath &blockFilename, const FilePath &audioFilename, sampleCount len, sampleFormat format, sampleCount origin=0, int channel=0) |
bool | SetError (const TranslatableString &msg) |
bool | SetWarning (const TranslatableString &msg) |
Private Attributes | |
AudacityProject & | mProject |
Tags * | mTags |
struct { | |
} | mProjectAttrs |
std::vector< fileinfo > | mFiles |
sampleCount | mTotalSamples |
sampleFormat | mFormat |
unsigned long | mNumChannels |
stack | mHandlers |
std::string | mParentTag |
std::string | mCurrentTag |
AttributesList | mAttrs |
wxFileName | mProjDir |
BlockFileMap | mFileMap |
WaveTrack * | mWaveTrack |
WaveClip * | mClip |
std::vector< WaveClip * > | mClips |
TranslatableString | mErrorMsg |
bool | mHasParseError { false } |
Additional Inherited Members | |
Public Types inherited from ImportFileHandle | |
using | ByteCount = unsigned long long |
Protected Member Functions inherited from ImportFileHandleEx | |
void | BeginImport () |
bool | IsCancelled () const noexcept |
bool | IsStopped () const noexcept |
An ImportFileHandle for AUP files (pre-AUP3)
Definition at line 81 of file ImportAUP.cpp.
|
private |
Definition at line 207 of file ImportAUP.cpp.
|
private |
Definition at line 115 of file ImportAUP.cpp.
AUPImportFileHandle::AUPImportFileHandle | ( | const FilePath & | name, |
AudacityProject * | project | ||
) |
Definition at line 278 of file ImportAUP.cpp.
AUPImportFileHandle::~AUPImportFileHandle | ( | ) |
Definition at line 285 of file ImportAUP.cpp.
|
private |
Definition at line 1402 of file ImportAUP.cpp.
References AUPImportFileHandle::fileinfo::audioFile, AUPImportFileHandle::fileinfo::blockFile, AUPImportFileHandle::fileinfo::channel, AUPImportFileHandle::fileinfo::clip, AUPImportFileHandle::fileinfo::format, anonymous_namespace{ExportPCM.cpp}::format, AUPImportFileHandle::fileinfo::len, mClip, mFiles, mTotalSamples, mWaveTrack, AUPImportFileHandle::fileinfo::origin, and AUPImportFileHandle::fileinfo::track.
Referenced by HandlePCMAliasBlockFile(), HandleSilentBlockFile(), and HandleSimpleBlockFile().
|
private |
Definition at line 1443 of file ImportAUP.cpp.
References AddSilence(), sampleCount::as_long_long(), sampleCount::as_size_t(), CopySamples(), floatSample, anonymous_namespace{ExportPCM.cpp}::format, gHighQualityDither, int16Sample, int24Sample, mClip, mFileMap, mWaveTrack, SampleBuffer::ptr(), WaveTrack::RightmostOrNewClip(), SetWarning(), sf_subtype_is_integer(), sf_subtype_more_than_16_bits(), and XO().
Referenced by Import().
|
private |
Definition at line 1424 of file ImportAUP.cpp.
References WaveTrack::GetEndTime(), WaveClip::GetPlayEndTime(), WaveTrack::InsertSilence(), WaveClip::InsertSilence(), WideSampleSequence::LongSamplesToTime(), mClip, and mWaveTrack.
Referenced by AddSamples(), and Import().
|
overridevirtual |
Reimplemented from ImportFileHandle.
Definition at line 294 of file ImportAUP.cpp.
References mErrorMsg.
|
overridevirtual |
|
overridevirtual |
Implements ImportFileHandle.
Definition at line 299 of file ImportAUP.cpp.
|
overridevirtual |
|
overridevirtual |
Implements ImportFileHandle.
Definition at line 502 of file ImportAUP.cpp.
|
private |
Definition at line 1064 of file ImportAUP.cpp.
References AUPImportFileHandle::node::handler, audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, Envelope::HandleXMLChild(), mCurrentTag, mHandlers, and mParentTag.
Referenced by HandleXMLTag().
|
private |
Definition at line 1031 of file ImportAUP.cpp.
References TimeTrack::GetEnvelope(), WaveClip::GetEnvelope(), AUPImportFileHandle::node::handler, audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mHandlers, mParentTag, mWaveTrack, WaveTrack::RightmostOrNewClip(), WaveClip::WaveClip_tag, and WaveTrack::WaveTrack_tag.
Referenced by HandleXMLTag().
|
private |
Definition at line 1333 of file ImportAUP.cpp.
References TrackList::Get(), ProjectFileManager::Get(), ImportFileHandleEx::GetFilename(), GuardedCall(), ProjectFileManager::Import(), XMLValueChecker::IsGoodFileName(), XMLValueChecker::IsGoodPathName(), mAttrs, mProject, tracks, WaveTrack::WaveTrack_tag, and wxT().
Referenced by HandleXMLTag().
|
private |
Definition at line 992 of file ImportAUP.cpp.
References audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mHandlers, and mParentTag.
Referenced by HandleXMLTag().
|
private |
Definition at line 865 of file ImportAUP.cpp.
References TrackList::Add(), TrackList::Get(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, and mProject.
Referenced by HandleXMLTag().
|
private |
Definition at line 872 of file ImportAUP.cpp.
References TrackList::Add(), TrackList::Get(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mProject, ImportUtils::ShowMessageBox(), and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 1250 of file ImportAUP.cpp.
References AddFile(), anonymous_namespace{ImportAUP.cpp}::CaseInsensitiveEquals(), XMLValueChecker::IsGoodFileName(), XMLValueChecker::IsGoodPathName(), XMLValueChecker::IsGoodPathString(), mAttrs, mFormat, mProjDir, name, SetError(), SetWarning(), and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 677 of file ImportAUP.cpp.
References fn, ProjectFileManager::Get(), ImportFileHandleEx::GetFilename(), GetProjectFrame(), mAttrs, mFileMap, mProjDir, mProject, set, SetError(), ImportUtils::ShowMessageBox(), wxT(), and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 1083 of file ImportAUP.cpp.
References AUPImportFileHandle::node::handler, HandleWaveClip(), WaveClip::HandleXMLChild(), Sequence::IsValidSampleFormat(), mAttrs, mClip, mFormat, mHandlers, mParentTag, Sequence::Sequence_tag, SetError(), WaveTrack::WaveTrack_tag, and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 1221 of file ImportAUP.cpp.
References AddFile(), mAttrs, mFormat, SetError(), and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 1174 of file ImportAUP.cpp.
References AddFile(), anonymous_namespace{ImportAUP.cpp}::CaseInsensitiveEquals(), XMLValueChecker::IsGoodFileString(), mAttrs, mFileMap, mFormat, SetError(), SetWarning(), and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 954 of file ImportAUP.cpp.
References mAttrs, mParentTag, mTags, Tags::SetTag(), and wxT().
Referenced by HandleXMLTag().
|
private |
Definition at line 918 of file ImportAUP.cpp.
References mAttrs, mTags, Tags::SetTag(), and wxT().
Referenced by HandleXMLTag().
|
private |
Definition at line 885 of file ImportAUP.cpp.
References TrackList::Add(), TrackList::Get(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mProject, ImportUtils::ShowMessageBox(), tracks, and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 1151 of file ImportAUP.cpp.
References mAttrs, SetError(), and XO().
Referenced by HandleXMLTag().
|
private |
Definition at line 1005 of file ImportAUP.cpp.
References WaveTrack::CreateClip(), AUPImportFileHandle::node::handler, audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, WaveClip::HandleXMLChild(), WaveTrack::InsertInterval(), mClip, mClips, mCurrentTag, mHandlers, mParentTag, WaveClip::WaveClip_tag, and WaveTrack::WaveTrack_tag.
Referenced by HandleSequence(), and HandleXMLTag().
|
private |
Definition at line 904 of file ImportAUP.cpp.
References TrackList::Add(), TrackList::Get(), WaveTrackFactory::Get(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mClip, mProject, and mWaveTrack.
Referenced by HandleXMLTag().
|
overrideprivatevirtual |
|
overrideprivate |
Definition at line 551 of file ImportAUP.cpp.
References AUPImportFileHandle::node::handler, XMLTagHandler::HandleXMLEndTag(), mClip, mCurrentTag, mFormat, mHandlers, mHasParseError, mParentTag, mWaveTrack, AUPImportFileHandle::node::parent, WaveTrack::SetLegacyFormat(), AUPImportFileHandle::node::tag, WaveClip::WaveClip_tag, and WaveTrack::WaveTrack_tag.
|
overrideprivatevirtual |
Implements XMLTagHandler.
Definition at line 583 of file ImportAUP.cpp.
References HandleControlPoint(), HandleEnvelope(), HandleImport(), HandleLabel(), HandleLabelTrack(), HandleNoteTrack(), HandlePCMAliasBlockFile(), HandleProject(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, HandleSequence(), HandleSilentBlockFile(), HandleSimpleBlockFile(), HandleTag(), HandleTags(), HandleTimeTrack(), HandleWaveBlock(), HandleWaveClip(), HandleWaveTrack(), mAttrs, mCurrentTag, mHandlers, mHasParseError, mParentTag, Sequence::Sequence_tag, SetError(), Sequence::WaveBlock_tag, WaveClip::WaveClip_tag, WaveTrack::WaveTrack_tag, and XO().
|
overridevirtual |
Implements ImportFileHandle.
Definition at line 305 of file ImportAUP.cpp.
References AddSamples(), AddSilence(), sampleCount::as_double(), ImportFileHandleEx::BeginImport(), ImportProgressListener::Cancelled, TranslatableString::empty(), ImportProgressListener::Error, ProjectFileManager::FixTracks(), ProjectNumericFormats::Get(), ProjectHistory::Get(), ProjectRate::Get(), ProjectSnap::Get(), ViewInfo::Get(), TrackList::Get(), XMLFileReader::GetErrorStr(), ImportFileHandleEx::GetFilename(), ImportFileHandleEx::IsCancelled(), ImportFileHandleEx::IsStopped(), mClip, mClips, mErrorMsg, mFiles, mHasParseError, mProject, mProjectAttrs, mTags, mTotalSamples, mWaveTrack, ImportProgressListener::OnImportProgress(), ImportProgressListener::OnImportResult(), XMLFileReader::Parse(), SetError(), ProjectRate::SetRate(), ProjectSnap::SetSnapMode(), SetWarning(), ImportUtils::ShowMessageBox(), SNAP_NEAREST, SNAP_OFF, ImportProgressListener::Stopped, ImportProgressListener::Success, tracks, and XO().
bool AUPImportFileHandle::Open | ( | ) |
Definition at line 512 of file ImportAUP.cpp.
References ImportFileHandleEx::GetFilename(), ImportUtils::ShowMessageBox(), wxT(), and XO().
|
private |
Definition at line 1658 of file ImportAUP.cpp.
References TranslatableString::Debug(), TranslatableString::empty(), mErrorMsg, and mHasParseError.
Referenced by HandlePCMAliasBlockFile(), HandleProject(), HandleSequence(), HandleSilentBlockFile(), HandleSimpleBlockFile(), HandleWaveBlock(), HandleXMLTag(), and Import().
|
override |
Definition at line 508 of file ImportAUP.cpp.
|
private |
Definition at line 1671 of file ImportAUP.cpp.
References TranslatableString::Debug(), TranslatableString::empty(), and mErrorMsg.
Referenced by AddSamples(), HandlePCMAliasBlockFile(), HandleSimpleBlockFile(), and Import().
|
private |
Definition at line 204 of file ImportAUP.cpp.
Referenced by HandleImport(), HandlePCMAliasBlockFile(), HandleProject(), HandleSequence(), HandleSilentBlockFile(), HandleSimpleBlockFile(), HandleTag(), HandleTags(), HandleWaveBlock(), and HandleXMLTag().
|
private |
Definition at line 212 of file ImportAUP.cpp.
Referenced by AddFile(), AddSamples(), AddSilence(), HandleSequence(), HandleWaveClip(), HandleWaveTrack(), HandleXMLEndTag(), and Import().
|
private |
Definition at line 213 of file ImportAUP.cpp.
Referenced by HandleWaveClip(), and Import().
|
private |
Definition at line 203 of file ImportAUP.cpp.
Referenced by HandleControlPoint(), HandleWaveClip(), HandleXMLEndTag(), and HandleXMLTag().
|
private |
Definition at line 215 of file ImportAUP.cpp.
Referenced by GetErrorMessage(), Import(), SetError(), and SetWarning().
|
private |
Definition at line 209 of file ImportAUP.cpp.
Referenced by AddSamples(), HandleProject(), and HandleSimpleBlockFile().
|
private |
Definition at line 195 of file ImportAUP.cpp.
|
private |
Definition at line 198 of file ImportAUP.cpp.
Referenced by HandlePCMAliasBlockFile(), HandleSequence(), HandleSilentBlockFile(), HandleSimpleBlockFile(), and HandleXMLEndTag().
|
private |
Definition at line 201 of file ImportAUP.cpp.
Referenced by HandleControlPoint(), HandleEnvelope(), HandleLabel(), HandleSequence(), HandleWaveClip(), HandleXMLEndTag(), and HandleXMLTag().
|
private |
Definition at line 216 of file ImportAUP.cpp.
Referenced by HandleXMLEndTag(), HandleXMLTag(), Import(), and SetError().
|
private |
Definition at line 199 of file ImportAUP.cpp.
|
private |
Definition at line 202 of file ImportAUP.cpp.
Referenced by HandleControlPoint(), HandleEnvelope(), HandleLabel(), HandleSequence(), HandleTag(), HandleWaveClip(), HandleXMLEndTag(), and HandleXMLTag().
|
private |
Definition at line 206 of file ImportAUP.cpp.
Referenced by HandlePCMAliasBlockFile(), and HandleProject().
|
private |
Definition at line 160 of file ImportAUP.cpp.
Referenced by HandleImport(), HandleLabelTrack(), HandleNoteTrack(), HandleProject(), HandleTimeTrack(), HandleWaveTrack(), and Import().
struct { ... } AUPImportFileHandle::mProjectAttrs |
Referenced by Import().
|
private |
Definition at line 161 of file ImportAUP.cpp.
Referenced by HandleTag(), HandleTags(), and Import().
|
private |
Definition at line 196 of file ImportAUP.cpp.
|
private |
Definition at line 211 of file ImportAUP.cpp.
Referenced by AddFile(), AddSamples(), AddSilence(), HandleEnvelope(), HandleWaveTrack(), HandleXMLEndTag(), and Import().