Browse Source

Change ParamQuantity/PortInfo label to name.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
ef89a96c87
6 changed files with 18 additions and 18 deletions
  1. +12
    -12
      include/engine/Module.hpp
  2. +1
    -1
      include/engine/ParamQuantity.hpp
  3. +1
    -1
      include/engine/PortInfo.hpp
  4. +2
    -2
      src/app/PortWidget.cpp
  5. +1
    -1
      src/core/MIDI_Map.cpp
  6. +1
    -1
      src/engine/ParamQuantity.cpp

+ 12
- 12
include/engine/Module.hpp View File

@@ -95,7 +95,7 @@ struct Module {
void config(int numParams, int numInputs, int numOutputs, int numLights = 0); void config(int numParams, int numInputs, int numOutputs, int numLights = 0);


template <class TParamQuantity = ParamQuantity> template <class TParamQuantity = ParamQuantity>
void configParam(int paramId, float minValue, float maxValue, float defaultValue, std::string label = "", std::string unit = "", float displayBase = 0.f, float displayMultiplier = 1.f, float displayOffset = 0.f) {
void configParam(int paramId, float minValue, float maxValue, float defaultValue, std::string name = "", std::string unit = "", float displayBase = 0.f, float displayMultiplier = 1.f, float displayOffset = 0.f) {
assert(paramId < (int) params.size() && paramId < (int) paramQuantities.size()); assert(paramId < (int) params.size() && paramId < (int) paramQuantities.size());
if (paramQuantities[paramId]) if (paramQuantities[paramId])
delete paramQuantities[paramId]; delete paramQuantities[paramId];
@@ -109,10 +109,10 @@ struct Module {
q->minValue = minValue; q->minValue = minValue;
q->maxValue = maxValue; q->maxValue = maxValue;
q->defaultValue = defaultValue; q->defaultValue = defaultValue;
if (label == "")
q->label = string::f("#%d", paramId + 1);
if (name == "")
q->name = string::f("#%d", paramId + 1);
else else
q->label = label;
q->name = name;
q->unit = unit; q->unit = unit;
q->displayBase = displayBase; q->displayBase = displayBase;
q->displayMultiplier = displayMultiplier; q->displayMultiplier = displayMultiplier;
@@ -120,29 +120,29 @@ struct Module {
paramQuantities[paramId] = q; paramQuantities[paramId] = q;
} }


void configInput(int portId, std::string label = "") {
void configInput(int portId, std::string name = "") {
assert(portId < (int) inputs.size() && portId < (int) inputInfos.size()); assert(portId < (int) inputs.size() && portId < (int) inputInfos.size());
if (inputInfos[portId]) if (inputInfos[portId])
delete inputInfos[portId]; delete inputInfos[portId];


PortInfo* p = new PortInfo; PortInfo* p = new PortInfo;
if (label == "")
p->label = string::f("#%d", portId + 1);
if (name == "")
p->name = string::f("#%d", portId + 1);
else else
p->label = label;
p->name = name;
inputInfos[portId] = p; inputInfos[portId] = p;
} }


void configOutput(int portId, std::string label = "") {
void configOutput(int portId, std::string name = "") {
assert(portId < (int) outputs.size() && portId < (int) outputInfos.size()); assert(portId < (int) outputs.size() && portId < (int) outputInfos.size());
if (outputInfos[portId]) if (outputInfos[portId])
delete outputInfos[portId]; delete outputInfos[portId];


PortInfo* p = new PortInfo; PortInfo* p = new PortInfo;
if (label == "")
p->label = string::f("#%d", portId + 1);
if (name == "")
p->name = string::f("#%d", portId + 1);
else else
p->label = label;
p->name = name;
outputInfos[portId] = p; outputInfos[portId] = p;
} }




+ 1
- 1
include/engine/ParamQuantity.hpp View File

@@ -25,7 +25,7 @@ struct ParamQuantity : Quantity {
/** The name of the parameter, using sentence capitalization. /** The name of the parameter, using sentence capitalization.
e.g. "Frequency", "Pulse width", "Alternative mode" e.g. "Frequency", "Pulse width", "Alternative mode"
*/ */
std::string label;
std::string name;
/** The numerical unit of measurement appended to the value. /** The numerical unit of measurement appended to the value.
Unit words and abbreviations should have a space to separate the numerical value from the number (e.g. " semitones", " V", " ms"). Unit words and abbreviations should have a space to separate the numerical value from the number (e.g. " semitones", " V", " ms").
Unit symbols should have no space (e.g. "%", "º"). Unit symbols should have no space (e.g. "%", "º").


+ 1
- 1
include/engine/PortInfo.hpp View File

@@ -11,7 +11,7 @@ struct PortInfo {
/** The name of the port, using sentence capitalization. /** The name of the port, using sentence capitalization.
e.g. "Sine", "Pitch input", "Mode CV" e.g. "Sine", "Pitch input", "Mode CV"
*/ */
std::string label;
std::string name;
/** An optional one-sentence description of the parameter. */ /** An optional one-sentence description of the parameter. */
std::string description; std::string description;
}; };


+ 2
- 2
src/app/PortWidget.cpp View File

@@ -22,7 +22,7 @@ struct PortTooltip : ui::Tooltip {
// Label // Label
text = (portWidget->type == engine::Port::INPUT) ? "Input" : "Output"; text = (portWidget->type == engine::Port::INPUT) ? "Input" : "Output";
text += ": "; text += ": ";
text += portInfo->label;
text += portInfo->name;
// Voltage, number of channels // Voltage, number of channels
int channels = port->getChannels(); int channels = port->getChannels();
for (int i = 0; i < channels; i++) { for (int i = 0; i < channels; i++) {
@@ -48,7 +48,7 @@ struct PortTooltip : ui::Tooltip {
text += "Connected to "; text += "Connected to ";
text += otherPw->module->model->getFullName(); text += otherPw->module->model->getFullName();
text += ": "; text += ": ";
text += otherPw->getPortInfo()->label;
text += otherPw->getPortInfo()->name;
} }
} }
Tooltip::step(); Tooltip::step();


+ 1
- 1
src/core/MIDI_Map.cpp View File

@@ -400,7 +400,7 @@ struct MIDI_MapChoice : LedDisplayChoice {
std::string s; std::string s;
s += mw->model->name; s += mw->model->name;
s += " "; s += " ";
s += paramQuantity->label;
s += paramQuantity->name;
return s; return s;
} }
}; };


+ 1
- 1
src/engine/ParamQuantity.cpp View File

@@ -110,7 +110,7 @@ void ParamQuantity::setDisplayValueString(std::string s) {
} }


std::string ParamQuantity::getLabel() { std::string ParamQuantity::getLabel() {
return label;
return name;
} }


std::string ParamQuantity::getUnit() { std::string ParamQuantity::getUnit() {


Loading…
Cancel
Save