![]() |
Audacity 3.2.0
|
#include <Tags.h>
Public Types | |
using | Iterators = IteratorRange< TagMap::const_iterator > |
Public Member Functions | |
Tags () | |
Tags (const Tags &)=default | |
virtual | ~Tags () |
std::shared_ptr< Tags > | Duplicate () const |
void | Merge (const Tags &other) |
Tags & | operator= (const Tags &src) |
bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override |
XMLTagHandler * | HandleXMLChild (const std::string_view &tag) override |
void | WriteXML (XMLWriter &xmlFile) const |
void | LoadDefaultGenres () |
void | LoadGenres () |
void | LoadDefaults () |
int | GetNumUserGenres () |
wxString | GetUserGenre (int value) |
wxString | GetGenre (int value) |
int | GetGenre (const wxString &name) |
bool | HasTag (const wxString &name) const |
wxString | GetTag (const wxString &name) const |
Iterators | GetRange () const |
void | SetTag (const wxString &name, const wxString &value, const bool bSpecialTag=false) |
void | SetTag (const wxString &name, const int &value) |
bool | IsEmpty () |
void | Clear () |
void | RestoreUndoRedoState (AudacityProject &) override |
Modify the project when undoing or redoing to some state in history. More... | |
![]() | |
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) |
![]() | |
virtual | ~Base () |
![]() | |
virtual | ~UndoStateExtension () |
virtual void | RestoreUndoRedoState (AudacityProject &project)=0 |
Modify the project when undoing or redoing to some state in history. More... | |
virtual bool | CanUndoOrRedo (const AudacityProject &project) |
Whether undo or redo is now permitted; default returns true. More... | |
Static Public Member Functions | |
static Tags & | Get (AudacityProject &project) |
static const Tags & | Get (const AudacityProject &project) |
static Tags & | Set (AudacityProject &project, const std::shared_ptr< Tags > &tags) |
Private Attributes | |
TagMap | mXref |
TagMap | mMap |
wxArrayString | mGenres |
Friends | |
TAGS_API bool | operator== (const Tags &lhs, const Tags &rhs) |
ID3 Tags (for MP3)
This class started as an ID3 tag
This class holds a few informational tags, such as Title, Author, etc. that can be associated with a project or other audio file. It is modeled after the ID3 format for MP3 files, and it can both import and export ID3 tags from/to MP2, MP3, and AIFF files.
It can present the user with a dialog for editing this information.
Use of this functionality requires that libid3tag be compiled in with Audacity.
using Tags::Iterators = IteratorRange<TagMap::const_iterator> |
Tags::Tags | ( | ) |
Definition at line 231 of file Tags.cpp.
References LoadDefaults(), and LoadGenres().
|
default |
void Tags::Clear | ( | ) |
Definition at line 308 of file Tags.cpp.
Referenced by FLACImportFileHandle::Import(), OggImportFileHandle::Import(), WavPackImportFileHandle::Import(), MP3ImportFileHandle::LoadID3(), TagsEditorDialog::OnClear(), and TagsEditorDialog::TransferDataFromWindow().
std::shared_ptr< Tags > Tags::Duplicate | ( | ) | const |
|
static |
Definition at line 214 of file Tags.cpp.
References key.
Referenced by TagsEditorDialog::DoEditMetadata(), ExportCL::Export(), ExportMP3::Export(), ExportPCM::Export(), ExportWavPack::Export(), ExportMultipleDialog::ExportMultipleByLabel(), ExportMultipleDialog::ExportMultipleByTrack(), ExportOGG::FillComment(), Get(), ExportFLAC::GetMetadata(), ProjectFileManager::Import(), anonymous_namespace{ProjectFileManager.cpp}::ImportProject(), and ExportFFmpeg::Init().
|
static |
Definition at line 219 of file Tags.cpp.
References Get().
int Tags::GetGenre | ( | const wxString & | name | ) |
Definition at line 394 of file Tags.cpp.
References DefaultGenres, and name.
wxString Tags::GetGenre | ( | int | value | ) |
Definition at line 383 of file Tags.cpp.
References DefaultGenres, and wxT().
Referenced by anonymous_namespace{ImportMP3_MPG123.cpp}::GetId3v2Genre(), PCMImportFileHandle::Import(), MP3ImportFileHandle::LoadID3(), and anonymous_namespace{ImportMP3_MPG123.cpp}::MP3ImportFileHandle::ReadTags().
int Tags::GetNumUserGenres | ( | ) |
Definition at line 343 of file Tags.cpp.
References mGenres.
Referenced by GetUserGenre(), TagsEditorDialog::OnEdit(), TagsEditorDialog::OnReset(), and TagsEditorDialog::PopulateGenres().
Tags::Iterators Tags::GetRange | ( | ) | const |
Definition at line 436 of file Tags.cpp.
References mMap.
Referenced by ExportPCM::AddID3Chunk(), ExportMP3::AddTags(), ExportWavPack::Export(), ExportOGG::FillComment(), ExportCL::GetMetaChunk(), ExportFLAC::GetMetadata(), TagsEditorDialog::OnSaveDefaults(), and TagsEditorDialog::TransferDataToWindow().
wxString Tags::GetTag | ( | const wxString & | name | ) | const |
Definition at line 416 of file Tags.cpp.
References key, mMap, mXref, and name.
Referenced by ExportPCM::AddStrings(), PCMImportFileHandle::Import(), MP3ImportFileHandle::LoadID3(), TagsEditorDialog::OnLoad(), TagsEditorDialog::OnSave(), TagsEditorDialog::OnSaveDefaults(), ExportFFmpeg::SetMetadata(), and TagsEditorDialog::TransferDataToWindow().
wxString Tags::GetUserGenre | ( | int | value | ) |
Definition at line 374 of file Tags.cpp.
References GetNumUserGenres(), mGenres, and wxT().
Referenced by TagsEditorDialog::OnEdit(), TagsEditorDialog::OnReset(), and TagsEditorDialog::PopulateGenres().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 536 of file Tags.cpp.
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 501 of file Tags.cpp.
References SetTag(), and wxT().
bool Tags::HasTag | ( | const wxString & | name | ) | const |
Definition at line 407 of file Tags.cpp.
References key, mXref, and name.
Referenced by ExportPCM::AddStrings(), FLACImportFileHandle::Import(), OggImportFileHandle::Import(), PCMImportFileHandle::Import(), WavPackImportFileHandle::Import(), IsEmpty(), MP3ImportFileHandle::LoadID3(), and ExportFFmpeg::SetMetadata().
bool Tags::IsEmpty | ( | ) |
Definition at line 297 of file Tags.cpp.
References HasTag(), TAG_ALBUM, TAG_ARTIST, and TAG_TITLE.
Referenced by FFmpegImportFileHandle::WriteMetadata().
void Tags::LoadDefaultGenres | ( | ) |
Definition at line 348 of file Tags.cpp.
References DefaultGenres, and mGenres.
Referenced by LoadGenres(), and TagsEditorDialog::OnReset().
void Tags::LoadDefaults | ( | ) |
Definition at line 266 of file Tags.cpp.
References FileConfig::GetFirstEntry(), FileConfig::GetNextEntry(), FileConfig::GetPath(), gPrefs, name, FileConfig::SetPath(), SetTag(), and wxT().
Referenced by Tags().
void Tags::LoadGenres | ( | ) |
Definition at line 356 of file Tags.cpp.
References FileNames::DataDir(), fn, LoadDefaultGenres(), mGenres, and wxT().
Referenced by TagsEditorDialog::OnEdit(), TagsEditorDialog::OnReset(), and Tags().
void Tags::Merge | ( | const Tags & | other | ) |
Definition at line 246 of file Tags.cpp.
References mMap, and SetTag().
Referenced by anonymous_namespace{ProjectFileManager.cpp}::ImportProject().
|
overridevirtual |
Modify the project when undoing or redoing to some state in history.
Implements UndoStateExtension.
Definition at line 579 of file Tags.cpp.
References Set().
|
static |
Definition at line 224 of file Tags.cpp.
References key.
Referenced by TagsEditorDialog::DoEditMetadata(), ProjectFileManager::Import(), and RestoreUndoRedoState().
void Tags::SetTag | ( | const wxString & | name, |
const int & | value | ||
) |
void Tags::SetTag | ( | const wxString & | name, |
const wxString & | value, | ||
const bool | bSpecialTag = false |
||
) |
Definition at line 441 of file Tags.cpp.
References TranslatableString::empty(), key, mMap, mXref, and name.
Referenced by FFmpegImportFileHandle::GetMetadata(), AUPImportFileHandle::HandleTag(), AUPImportFileHandle::HandleTags(), HandleXMLTag(), FLACImportFileHandle::Import(), OggImportFileHandle::Import(), PCMImportFileHandle::Import(), WavPackImportFileHandle::Import(), LoadDefaults(), MP3ImportFileHandle::LoadID3(), Merge(), TagsEditorDialog::OnLoad(), TagsEditorDialog::OnSave(), TagsEditorDialog::OnSaveDefaults(), GStreamerImportFileHandle::OnTag(), anonymous_namespace{ImportMP3_MPG123.cpp}::MP3ImportFileHandle::ReadTags(), SetTag(), and TagsEditorDialog::TransferDataFromWindow().
void Tags::WriteXML | ( | XMLWriter & | xmlFile | ) | const |
Definition at line 549 of file Tags.cpp.
References wxT().
Referenced by TagsEditorDialog::OnSave().
Definition at line 332 of file Tags.cpp.
|
private |
Definition at line 130 of file Tags.h.
Referenced by GetNumUserGenres(), GetUserGenre(), LoadDefaultGenres(), LoadGenres(), and operator=().
|
private |
Definition at line 128 of file Tags.h.
Referenced by Clear(), GetRange(), GetTag(), Merge(), operator=(), and SetTag().
|
private |