| @@ -110,10 +110,7 @@ struct Module { | |||||
| q->minValue = minValue; | q->minValue = minValue; | ||||
| q->maxValue = maxValue; | q->maxValue = maxValue; | ||||
| q->defaultValue = defaultValue; | q->defaultValue = defaultValue; | ||||
| if (name == "") | |||||
| q->name = string::f("#%d", paramId + 1); | |||||
| else | |||||
| q->name = name; | |||||
| q->name = name; | |||||
| q->unit = unit; | q->unit = unit; | ||||
| q->displayBase = displayBase; | q->displayBase = displayBase; | ||||
| q->displayMultiplier = displayMultiplier; | q->displayMultiplier = displayMultiplier; | ||||
| @@ -131,10 +128,7 @@ struct Module { | |||||
| p->module = this; | p->module = this; | ||||
| p->type = Port::INPUT; | p->type = Port::INPUT; | ||||
| p->portId = portId; | p->portId = portId; | ||||
| if (name == "") | |||||
| p->name = string::f("#%d", portId + 1); | |||||
| else | |||||
| p->name = name; | |||||
| p->name = name; | |||||
| inputInfos[portId] = p; | inputInfos[portId] = p; | ||||
| } | } | ||||
| @@ -148,10 +142,7 @@ struct Module { | |||||
| p->module = this; | p->module = this; | ||||
| p->type = Port::OUTPUT; | p->type = Port::OUTPUT; | ||||
| p->portId = portId; | p->portId = portId; | ||||
| if (name == "") | |||||
| p->name = string::f("#%d", portId + 1); | |||||
| else | |||||
| p->name = name; | |||||
| p->name = name; | |||||
| outputInfos[portId] = p; | outputInfos[portId] = p; | ||||
| } | } | ||||
| @@ -66,6 +66,7 @@ struct ParamQuantity : Quantity { | |||||
| int getDisplayPrecision() override; | int getDisplayPrecision() override; | ||||
| std::string getLabel() override; | std::string getLabel() override; | ||||
| std::string getUnit() override; | std::string getUnit() override; | ||||
| virtual std::string getDescription(); | |||||
| }; | }; | ||||
| @@ -7,6 +7,9 @@ namespace rack { | |||||
| namespace engine { | namespace engine { | ||||
| struct Module; | |||||
| struct PortInfo { | struct PortInfo { | ||||
| Module* module = NULL; | Module* module = NULL; | ||||
| Port::Type type; | Port::Type type; | ||||
| @@ -24,12 +27,8 @@ struct PortInfo { | |||||
| std::string description; | std::string description; | ||||
| virtual ~PortInfo() {} | virtual ~PortInfo() {} | ||||
| virtual std::string getName() { | |||||
| return name; | |||||
| } | |||||
| virtual std::string getDescription() { | |||||
| return description; | |||||
| } | |||||
| virtual std::string getName(); | |||||
| virtual std::string getDescription(); | |||||
| }; | }; | ||||
| @@ -69,9 +69,10 @@ struct ParamTooltip : ui::Tooltip { | |||||
| // Quantity string | // Quantity string | ||||
| text = pq->getString(); | text = pq->getString(); | ||||
| // Description | // Description | ||||
| if (pq->description != "") { | |||||
| std::string description = pq->getDescription(); | |||||
| if (description != "") { | |||||
| text += "\n"; | text += "\n"; | ||||
| text += pq->description; | |||||
| text += description; | |||||
| } | } | ||||
| } | } | ||||
| Tooltip::step(); | Tooltip::step(); | ||||
| @@ -110,6 +110,8 @@ void ParamQuantity::setDisplayValueString(std::string s) { | |||||
| } | } | ||||
| std::string ParamQuantity::getLabel() { | std::string ParamQuantity::getLabel() { | ||||
| if (name == "") | |||||
| return string::f("#%d", paramId + 1); | |||||
| return name; | return name; | ||||
| } | } | ||||
| @@ -117,6 +119,10 @@ std::string ParamQuantity::getUnit() { | |||||
| return unit; | return unit; | ||||
| } | } | ||||
| std::string ParamQuantity::getDescription() { | |||||
| return description; | |||||
| } | |||||
| } // namespace engine | } // namespace engine | ||||
| } // namespace rack | } // namespace rack | ||||
| @@ -0,0 +1,21 @@ | |||||
| #include <engine/PortInfo.hpp> | |||||
| #include <string.hpp> | |||||
| namespace rack { | |||||
| namespace engine { | |||||
| std::string PortInfo::getName() { | |||||
| if (name == "") | |||||
| return string::f("#%d", portId + 1); | |||||
| return name; | |||||
| } | |||||
| std::string PortInfo::getDescription() { | |||||
| return description; | |||||
| } | |||||
| } // namespace engine | |||||
| } // namespace rack | |||||