#include "app.hpp" #include "plugin.hpp" #include "window.hpp" #include #include #define BND_LABEL_FONT_SIZE 13 namespace rack { static std::set sFavoriteModels; bool isMatch(std::string s, std::string search) { s = lowercase(s); search = lowercase(search); return (s.find(search) != std::string::npos); } static bool isModelMatch(Model *model, std::string search) { if (search.empty()) return true; std::string s; s += model->plugin->slug; s += " "; s += model->manufacturer; s += " "; s += model->name; s += " "; s += model->slug; for (ModelTag tag : model->tags) { s += " "; s += gTagNames[tag]; } return isMatch(s, search); } struct FavoriteRadioButton : RadioButton { Model *model = NULL; void onAction(EventAction &e) override; }; struct SeparatorItem : OpaqueWidget { SeparatorItem() { box.size.y = BND_WIDGET_HEIGHT; } void setText(std::string text) { clearChildren(); Label *label = Widget::create