Skip to content

Commit

Permalink
Merge pull request #4701 from remus32/traktor-key-import
Browse files Browse the repository at this point in the history
Traktor library: fix importing track key
  • Loading branch information
daschuer authored Apr 6, 2022
2 parents 2703c31 + a57b77e commit b2401b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/library/traktor/traktorfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "library/trackcollectionmanager.h"
#include "library/treeitem.h"
#include "moc_traktorfeature.cpp"
#include "track/keyutils.h"
#include "util/sandbox.h"
#include "util/semanticversion.h"

Expand Down Expand Up @@ -360,6 +361,15 @@ void TraktorFeature::parseTrack(QXmlStreamReader &xml, QSqlQuery &query) {
bpm = attr.value("BPM").toString().toFloat();
continue;
}
if (xml.name() == QLatin1String("MUSICAL_KEY")) {
QXmlStreamAttributes attr = xml.attributes();
// Traktor happens to use the same key numbering
key = KeyUtils::keyToString(
KeyUtils::keyFromNumericValue(
attr.value("VALUE").toInt()),
KeyUtils::KeyNotation::Custom);
continue;
}
}
//We leave the infinite loop, if twe have the closing tag "ENTRY"
if (xml.name() == QLatin1String("ENTRY") && xml.isEndElement()) {
Expand Down

0 comments on commit b2401b9

Please sign in to comment.