I’ve been baffled for a long time why JUCE only has the ChangeBroadcaster and ActionBroadcaster classes for implementing classes that need to broadcast things to listeners. This leaves a hole for easily broadcasting things like ints, doubles and maybe pairs or tuples etc of such things. I know that possible solutions are using Value or std::function<void(T)> but both have their own issues. (For example Value makes it necessary for the broadcasting class to deal with Values instead of simple data types. std::function only supports one “listener” and doesn’t provide async/cross thread capabilities directly.)
Wouldn’t it make sense to have something like
GenericBroadcaster<T> and/or VarBroadcaster together with the necessary Listener base classes?