Browse Source

MidiLogger Demo: Avoid redrawing when no new messages have been received

v6.1.6
reuk 4 years ago
parent
commit
6b8d07a0f6
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      examples/Plugins/MidiLoggerPluginDemo.h

+ 3
- 0
examples/Plugins/MidiLoggerPluginDemo.h View File

@@ -80,6 +80,9 @@ public:
template <typename It>
void addMessages (It begin, It end)
{
if (begin == end)
return;
const auto numNewMessages = (int) std::distance (begin, end);
const auto numToAdd = juce::jmin (numToStore, numNewMessages);
const auto numToRemove = jmax (0, (int) messages.size() + numToAdd - numToStore);


Loading…
Cancel
Save