44 auto bounds = getLocalBounds();
47 m_inputLevels->setBounds(bounds
48 .removeFromTop(bounds.getHeight() -
int(s_channelSize + s_channelGap))
49 .removeFromLeft(
int(m_inputMutes.size() * (s_channelSize + s_channelGap))));
51 if (!m_inputMutes.empty())
53 auto muteWidth = int(s_channelSize + s_channelGap);
54 for (
auto const& inputMuteKV : m_inputMutes)
56 inputMuteKV.second->setBounds(bounds.removeFromLeft(muteWidth).reduced(2));
110 if (m_channelCount != channelCount)
112 m_channelCount = channelCount;
113 DBG(__FUNCTION__ <<
" " <<
int(channelCount));
115 m_inputLevels->setChannelCount(channelCount);
117 auto channelsToRemove = std::vector<std::uint16_t>();
118 for (
auto const& inputMuteKV : m_inputMutes)
120 if (inputMuteKV.first > channelCount)
121 channelsToRemove.push_back(inputMuteKV.first);
123 for (
auto const& channel : channelsToRemove)
125 removeChildComponent(m_inputMutes.at(channel).get());
126 auto iter = std::find_if(m_inputMutes.begin(), m_inputMutes.end(), [=](
const auto& inputMuteKV) { return inputMuteKV.first == channel; });
127 if (iter != m_inputMutes.end())
128 m_inputMutes.erase(iter);
131 for (std::uint16_t channel = 1; channel <= channelCount; channel++)
133 if (m_inputMutes.count(channel) == 0)
135 m_inputMutes[channel] = std::make_unique<juce::TextButton>(
"M",
"Mute");
136 m_inputMutes.at(channel)->setClickingTogglesState(
true);
137 m_inputMutes.at(channel)->addListener(
this);
138 m_inputMutes.at(channel)->setColour(juce::TextButton::ColourIds::buttonOnColourId, juce::Colours::red);
139 addAndMakeVisible(m_inputMutes.at(channel).get());
152 auto iter = std::find_if(m_inputMutes.begin(), m_inputMutes.end(), [=](
const auto& inputMuteKV) { return inputMuteKV.second.get() == button; });
153 if (iter != m_inputMutes.end() &&
nullptr != iter->second)