98 wxT(
"Instrumental Pop"),
99 wxT(
"Instrumental Rock"),
103 wxT(
"Techno-Industrial"),
108 wxT(
"Southern Rock"),
113 wxT(
"Christian Rap"),
116 wxT(
"Native American"),
134 wxT(
"National Folk"),
144 wxT(
"Progressive Rock"),
145 wxT(
"Psychedelic Rock"),
146 wxT(
"Symphonic Rock"),
150 wxT(
"Easy Listening"),
156 wxT(
"Chamber Music"),
170 wxT(
"Rhythmic Soul"),
191 wxT(
"Christian Gangsta Rap"),
195 wxT(
"Contemporary Christian"),
196 wxT(
"Christian Rock"),
216 return project.AttachedObjects::Get<
Tags >(
key );
226 auto &result = *tags;
227 project.AttachedObjects::Assign(
key, tags );
243 return std::make_shared<Tags>(*
this);
248 for (
auto &pair : other.
mMap ) {
249 SetTag( pair.first, pair.second );
319 if (map1.size() != map2.size())
322 for (
const auto &pair : map2) {
323 auto iter = map1.find(pair.first);
324 if (iter == map1.end() || iter->second != pair.second)
359 wxTextFile tf(
fn.GetFullPath());
361 if (!tf.Exists() || !tf.Open()) {
368 int cnt = tf.GetLineCount();
369 for (
int i = 0; i < cnt; i++) {
370 mGenres.push_back(tf.GetLine(i));
387 if (i >= 0 && i < cnt) {
398 for (
int i = 0; i < cnt; i++) {
413 return (iter !=
mXref.end());
423 if (iter ==
mXref.end()) {
424 return wxEmptyString;
427 auto iter2 =
mMap.find(iter->second);
428 if (iter2 ==
mMap.end()) {
430 return wxEmptyString;
433 return iter2->second;
438 return {
mMap.begin(),
mMap.end() };
449 if (!
name.IsAscii()) {
450 wxLogError(
"Tag rejected (Non-ascii character in name)");
459 TagMap::iterator iter =
mXref.find(
key);
464 if (value.empty() && bSpecialTag) {
466 if (iter ==
mXref.end())
470 mMap.erase(iter->second);
476 if (iter ==
mXref.end()) {
483 else if (iter->second !=
name) {
486 mMap.erase(iter->second);
491 mMap[iter->second] = value;
510 for (
auto pair : attrs)
512 auto attr = pair.first;
513 auto value = pair.second;
515 if (attr ==
"name") {
516 n = value.ToWString();
518 else if (attr ==
"value") {
519 v = value.ToWString();
523 if (n ==
wxT(
"id3v2")) {
552 xmlFile.StartTag(
wxT(
"tags"));
554 for (
const auto &pair : GetRange()) {
555 const auto &n = pair.first;
556 const auto &v = pair.second;
557 xmlFile.StartTag(
wxT(
"tag"));
558 xmlFile.WriteAttr(
wxT(
"name"), n);
559 xmlFile.WriteAttr(
wxT(
"value"), v);
560 xmlFile.EndTag(
wxT(
"tag"));
563 xmlFile.EndTag(
wxT(
"tags"));
575 return Tags::Get(project).shared_from_this();
582 Tags::Set( project, shared_from_this() );
const TranslatableString name
std::vector< Attribute > AttributesList
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
virtual bool GetNextEntry(wxString &str, long &lIndex) const wxOVERRIDE
virtual const wxString & GetPath() const wxOVERRIDE
virtual void SetPath(const wxString &strPath) wxOVERRIDE
virtual bool GetFirstEntry(wxString &str, long &lIndex) const wxOVERRIDE
This class is an interface which should be implemented by classes which wish to be able to load and s...
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
FILES_API FilePath DataDir()
Audacity user data directory.
A convenience for use with range-for.
Typically statically constructed.
Typically statically constructed.