Browse Source

Add tag::getTag().

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
dd81e79d9e
3 changed files with 9 additions and 1 deletions
  1. +2
    -0
      include/tag.hpp
  2. +1
    -1
      src/app/ModuleWidget.cpp
  3. +6
    -0
      src/tag.cpp

+ 2
- 0
include/tag.hpp View File

@@ -23,6 +23,8 @@ Returns -1 if not found.
*/
int findId(const std::string& tag);

std::string getTag(int tagId);


} // namespace tag
} // namespace rack

+ 1
- 1
src/app/ModuleWidget.cpp View File

@@ -56,7 +56,7 @@ struct ModuleInfoItem : ui::MenuItem {

for (int tagId : model->tags) {
ui::MenuLabel* tagLabel = new ui::MenuLabel;
tagLabel->text = tag::tagAliases[tagId][0];
tagLabel->text = tag::getTag(tagId);
menu->addChild(tagLabel);
}



+ 6
- 0
src/tag.cpp View File

@@ -79,5 +79,11 @@ int findId(const std::string& tag) {
}


std::string getTag(int tagId) {
assert(0 <= tagId && tagId < (int) tagAliases.size());
return tagAliases[tagId][0];
}


} // namespace tag
} // namespace rack

Loading…
Cancel
Save