Skip to content

Commit be3918e

Browse files
committed
Fix Audio Monitor resetting selected channels on update when no spike channel is selected
1 parent 101fec1 commit be3918e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Source/Processors/AudioMonitor/AudioMonitor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ void AudioMonitor::updateSettings()
169169
CategoricalParameter* spikeChanParam = (CategoricalParameter*) stream->getParameter ("spike_channel");
170170
spikeChanParam->setCategories (spikeChannelNames);
171171

172-
parameterValueChanged (stream->getParameter ("spike_channel"));
172+
if (spikeChanParam->getSelectedIndex() > 0)
173+
parameterValueChanged (stream->getParameter ("spike_channel"));
173174
}
174175
}
175176

Source/Processors/Parameter/Parameter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,9 @@ void SelectedChannelsParameter::setChannelCount (int newCount)
857857

858858
currentValue = values;
859859
}
860-
else if (channelCount == 0 && currentValue.getArray()->size() == 0) // If the current count is 0, set the selected channels to the first maxSelectableChannels channels
860+
else if (channelCount == 0
861+
&& currentValue.getArray()->size() == 0
862+
&& maxSelectableChannels < std::numeric_limits<int>::max()) // If the current count is 0, set the selected channels to the first maxSelectableChannels channels
861863
{
862864
const int limit = jmin (maxSelectableChannels, newCount);
863865
values.ensureStorageAllocated (limit);

0 commit comments

Comments
 (0)