Skip to content

Commit

Permalink
use accurate method for filling colour options box
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jul 18, 2024
1 parent b3f1c74 commit b7328aa
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions Source/mapping_editors/MultiSelectControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,32 +210,36 @@ void MultiSelectControls::completeMappingLoaded(const LumatoneLayout &mappingDat

void MultiSelectControls::boardChanged(const LumatoneBoard &boardData)
{
auto boardColours = boardData.getBoardColours();
auto colourOptions = colourDropdown->getColourOptions();
for (auto colour : boardColours)
{
if (colourOptions.contains(colour))
continue;
// auto boardColours = boardData.getBoardColours();
// auto colourOptions = colourDropdown->getColourOptions();
// for (auto colour : boardColours)
// {
// if (colourOptions.contains(colour))
// continue;

// colourDropdown->addItem(colour.toDisplayString(false), colourDropdown->getNumItems() + 1);
// }

colourDropdown->addItem(colour.toDisplayString(false), colourDropdown->getNumItems() + 1);
}
completeMappingLoaded(*getMappingData());
}

void MultiSelectControls::keyChanged(int boardIndex, int keyIndex, const LumatoneKey &lumatoneKey)
{
auto colourOptions = colourDropdown->getColourOptions();
if (!colourOptions.contains(lumatoneKey.getColour()))
colourDropdown->addItem(lumatoneKey.getColour().toDisplayString(false), colourDropdown->getNumItems() + 1);
// auto colourOptions = colourDropdown->getColourOptions();
// if (!colourOptions.contains(lumatoneKey.getColour()))
// colourDropdown->addItem(lumatoneKey.getColour().toDisplayString(false), colourDropdown->getNumItems() + 1);
completeMappingLoaded(*getMappingData());
}

void MultiSelectControls::keySetChanged(juce::Array<MappedLumatoneKey> selection)
{
auto colourOptions = colourDropdown->getColourOptions();
for (auto key : selection)
{
if (colourOptions.contains(key.getColour()))
continue;

colourDropdown->addItem(key.getColour().toDisplayString(false), colourDropdown->getNumItems() + 1);
}
// auto colourOptions = colourDropdown->getColourOptions();
// for (auto key : selection)
// {
// if (colourOptions.contains(key.getColour()))
// continue;

// colourDropdown->addItem(key.getColour().toDisplayString(false), colourDropdown->getNumItems() + 1);
// }
completeMappingLoaded(*getMappingData());
}

0 comments on commit b7328aa

Please sign in to comment.