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 () |
size_t | Count () const |
void | RestoreUndoRedoState (AudacityProject &) override |
Modify the project when undoing or redoing to some state in history. More... | |
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) |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from UndoStateExtension | |
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 293 of file Tags.cpp.
Referenced by FLACImportFileHandle::Import(), OggImportFileHandle::Import(), and WavPackImportFileHandle::Import().
size_t Tags::Count | ( | ) | const |
std::shared_ptr< Tags > Tags::Duplicate | ( | ) | const |
|
static |
Definition at line 214 of file Tags.cpp.
Referenced by ProjectFileManager::DoImport(), TagsEditorDialog::EditProjectMetadata(), OGGExportProcessor::FillComment(), Get(), anonymous_namespace{ProjectFileManager.cpp}::ImportProject(), FFmpegExporter::Init(), CLExportProcessor::Initialize(), MP2ExportProcessor::Initialize(), MP3ExportProcessor::Initialize(), OpusExportProcessor::Initialize(), PCMExportProcessor::Initialize(), WavPackExportProcessor::Initialize(), FLACExportProcessor::MakeMetadata(), ExportAudioDialog::UpdateLabelExportSettings(), and ExportAudioDialog::UpdateTrackExportSettings().
|
static |
Definition at line 219 of file Tags.cpp.
References Get(), and project.
int Tags::GetGenre | ( | const wxString & | name | ) |
Definition at line 384 of file Tags.cpp.
References DefaultGenres, and name.
wxString Tags::GetGenre | ( | int | value | ) |
Definition at line 373 of file Tags.cpp.
References DefaultGenres, and wxT().
Referenced by anonymous_namespace{ImportMP3_MPG123.cpp}::GetId3v2Genre(), PCMImportFileHandle::Import(), and anonymous_namespace{ImportMP3_MPG123.cpp}::MP3ImportFileHandle::ReadTags().
int Tags::GetNumUserGenres | ( | ) |
Definition at line 333 of file Tags.cpp.
References mGenres.
Referenced by GetUserGenre().
Tags::Iterators Tags::GetRange | ( | ) | const |
Definition at line 426 of file Tags.cpp.
References mMap.
Referenced by PCMExportProcessor::AddID3Chunk(), MP2ExportProcessor::AddTags(), MP3ExportProcessor::AddTags(), OGGExportProcessor::FillComment(), CLExportProcessor::GetMetaChunk(), and FLACExportProcessor::MakeMetadata().
wxString Tags::GetTag | ( | const wxString & | name | ) | const |
Definition at line 406 of file Tags.cpp.
References key, mMap, mXref, and name.
Referenced by PCMExportProcessor::AddStrings(), PCMImportFileHandle::Import(), and FFmpegExporter::SetMetadata().
wxString Tags::GetUserGenre | ( | int | value | ) |
Definition at line 364 of file Tags.cpp.
References GetNumUserGenres(), mGenres, and wxT().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 526 of file Tags.cpp.
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 491 of file Tags.cpp.
References SetTag(), and wxT().
bool Tags::HasTag | ( | const wxString & | name | ) | const |
Definition at line 397 of file Tags.cpp.
References key, mXref, and name.
Referenced by PCMExportProcessor::AddStrings(), FLACImportFileHandle::Import(), OggImportFileHandle::Import(), OpusImportFileHandle::Import(), PCMImportFileHandle::Import(), WavPackImportFileHandle::Import(), IsEmpty(), and FFmpegExporter::SetMetadata().
bool Tags::IsEmpty | ( | ) |
Definition at line 282 of file Tags.cpp.
References HasTag(), TAG_ALBUM, TAG_ARTIST, and TAG_TITLE.
Referenced by FFmpegImportFileHandle::WriteMetadata().
void Tags::LoadDefaultGenres | ( | ) |
Definition at line 338 of file Tags.cpp.
References DefaultGenres, and mGenres.
Referenced by LoadGenres().
void Tags::LoadDefaults | ( | ) |
Definition at line 266 of file Tags.cpp.
References audacity::BasicSettings::BeginGroup(), audacity::BasicSettings::GetChildKeys(), gPrefs, key, audacity::BasicSettings::Read(), SetTag(), and wxT().
Referenced by Tags(), ExportAudioDialog::UpdateLabelExportSettings(), and ExportAudioDialog::UpdateTrackExportSettings().
void Tags::LoadGenres | ( | ) |
Definition at line 346 of file Tags.cpp.
References FileNames::DataDir(), fn, LoadDefaultGenres(), mGenres, and wxT().
Referenced by 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 569 of file Tags.cpp.
References project, and Set().
|
static |
Definition at line 224 of file Tags.cpp.
Referenced by ProjectFileManager::DoImport(), TagsEditorDialog::EditProjectMetadata(), 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 431 of file Tags.cpp.
References key, mMap, mXref, and name.
Referenced by FFmpegImportFileHandle::GetMetadata(), AUPImportFileHandle::HandleTag(), AUPImportFileHandle::HandleTags(), HandleXMLTag(), FLACImportFileHandle::Import(), OggImportFileHandle::Import(), OpusImportFileHandle::Import(), PCMImportFileHandle::Import(), WavPackImportFileHandle::Import(), LoadDefaults(), Merge(), TagsEditorDialog::OnLoad(), anonymous_namespace{ImportMP3_MPG123.cpp}::MP3ImportFileHandle::ReadTags(), SetTag(), ExportAudioDialog::UpdateLabelExportSettings(), and ExportAudioDialog::UpdateTrackExportSettings().
void Tags::WriteXML | ( | XMLWriter & | xmlFile | ) | const |
Definition at line 539 of file Tags.cpp.
References wxT().
Definition at line 322 of file Tags.cpp.
|
private |
Definition at line 132 of file Tags.h.
Referenced by GetNumUserGenres(), GetUserGenre(), LoadDefaultGenres(), LoadGenres(), and operator=().
|
private |
Definition at line 130 of file Tags.h.
Referenced by Clear(), Count(), GetRange(), GetTag(), Merge(), operator=(), and SetTag().
|
private |