This commit is contained in:
Bertrand Songis
2017-04-25 21:25:46 +02:00
parent 6dd8524ea5
commit b0183efaf1
2 changed files with 13 additions and 2 deletions
+12 -2
View File
@@ -552,8 +552,8 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
result = QString(generalSettings->potName[genAryIdx]);
else if (isSlider(&genAryIdx))
result = QString(generalSettings->sliderName[genAryIdx]);
else
result = QString(generalSettings->stickName[index]);
else if (isStick(&genAryIdx))
result = QString(generalSettings->stickName[genAryIdx]);
}
if (result.isEmpty())
result = getCurrentFirmware()->getAnalogInputName(index);;
@@ -608,6 +608,16 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
}
}
bool RawSource::isStick(int * stickIndex) const
{
if (type == SOURCE_TYPE_STICK && index < getBoardCapability(getCurrentBoard(), Board::Sticks)) {
if (stickIndex)
*stickIndex = index;
return true;
}
return false;
}
bool RawSource::isPot(int * potsIndex) const
{
if (type == SOURCE_TYPE_STICK &&