JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

Added an overload to sort a ValueTree using a lambda

Open ffAudio opened this issue 2 years ago • 6 comments

This Pull Request adds an function overload to ValueTree sort, which takes a lambda, so that sorting of ValueTree children can be done in one line instead of creating an ElementComparator struct.

Unit Tests for numbers and strings are included.

ffAudio avatar Aug 09 '22 14:08 ffAudio

Very nice. Perhaps something similar can be done for StringArray, ListBoxModel, etc., wherever a custom sort might be needed.

reFX-Mike avatar Aug 09 '22 18:08 reFX-Mike

Very nice. Perhaps something similar can be done for StringArray, ListBoxModel, etc., wherever a custom sort might be needed.

Indeed, this would be possible. Good idea. juce::StringArray just sits on top of juce::Array<juce::String> and Array has a sort using a similar ElementComparator. So the templated variant I had before would be doable for juce::Array. The ListBoxModel is abstract though, it is not really a container, so I think here it doesn't really apply.

ffAudio avatar Aug 28 '22 12:08 ffAudio

Bump with backlink to the forum https://forum.juce.com/t/std-sort-on-juce-valuetree/52532/10

ffAudio avatar Dec 05 '22 14:12 ffAudio

Anybody at juce?

ffAudio avatar Aug 15 '23 10:08 ffAudio

At the moment, when not fixing critical bugs, we are focusing on major features:

  • MIDI 2.0 support
  • Improved unicode rendering
  • Improved embedded webview support

Due to the limited size of the team we have to set our priorities carefully, so until JUCE 8 is released we're unlikely to add any features outside of these areas.

reuk avatar Aug 15 '23 11:08 reuk

Thanks for the feedback

ffAudio avatar Aug 15 '23 14:08 ffAudio