Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chords and Mensuration Sign's Orientation and Loc #3790

Merged
merged 10 commits into from
Sep 19, 2024
Prev Previous commit
Next Next commit
Make a map for orientation
  • Loading branch information
martha-thomae committed Sep 19, 2024
commit 6105ae750b1b6e41f2e08c9fbf3fbe281ef8d6db
19 changes: 7 additions & 12 deletions src/iocmme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,19 +618,14 @@ void CmmeInput::CreateMensuration(pugi::xml_node mensurationNode)
}

/// Mensuration/Sign/Orientation to @orient
martha-thomae marked this conversation as resolved.
Show resolved Hide resolved
static const std::map<std::string, data_ORIENTATION> orientationMap{
{ "Reversed", ORIENTATION_reversed }, //
{ "90CW", ORIENTATION_90CW }, //
{ "90CCW", ORIENTATION_90CCW } //
};
std::string orientation = this->ChildAsString(signNode, "Orientation");
if (orientation == "Reversed") {
mensur->SetOrient(ORIENTATION_reversed);
}
else if (orientation == "90CW") {
mensur->SetOrient(ORIENTATION_90CW);
}
else if (orientation == "90CCW") {
mensur->SetOrient(ORIENTATION_90CCW);
}
else if (orientation != "") {
LogWarning("Unsupported mesuration orientation in CMME (not 'Reversed' or '90CW' or '90CCW')");
}
data_ORIENTATION orient = orientationMap.contains(orientation) ? orientationMap.at(orientation) : ORIENTATION_NONE;
mensur->SetOrient(orient);

/// Mensuration/Number/Num to @num and Number/Den to @numbase
pugi::xml_node numberNode = mensurationNode.child("Number");
Expand Down